CodeGen: Replace TargetOptions::DebuggerTuning with module flag
Read the debugger tuning from the module's "debugger-tuning" flag instead of
TargetOptions. Delete the now-dead -debugger-tune= cl::opt and the
TargetOptions::DebuggerTuning field.
Update the tests relying on it to directly use the module flag. The cases
that exercise multiple values do a text substitution to swap the value.
Alternatively this could be changed to synthesize the module flag in the
llc flag like some of the other widely used module flags do.
Co-authored-by: Claude Sonnet 5 <noreply at anthropic.com>
[SPIRV] Keep the allocated type of allocas passed to mangled declarations (#236532)
Since #230342, applyDemangledPtrArgTypes() records the pointee type
parsed
from a mangled declaration on an alloca passed to it, replacing the
allocated type. The variable is then sized from the callee's parameter
type, e.g. `alloca [8 x i32]` passed to `_Z3fooPj` becomes an OpVariable
of a single uint. Since #232579 this also affects constant-count
allocas.
Handle allocas like GEPs: keep the allocated type and cast the pointer
to
the parameter type at the call.
[UTC][AArch64] Accept function names with multiple leading underscores (#237947)
ASM_FUNCTION_AARCH64_RE only allowed a single optional leading
underscore before the first letter of a function name (`_?[a-zA-Z]`), so
functions such as `__muloti4` were never matched on ELF AArch64 targets
and update_llc_test_checks.py silently emitted no CHECK lines for them.
Allow any number of leading underscores, add a regression test, and
regenerate CodeGen/AArch64/umulo-128-legalisation-lowering.ll, whose
__muloti4 checks had been hand-edited.
Fixes #237934
[AMDGPU][NFC] Use Select/Select_vi for FLAT real instruction encodings (#237849)
Replace explicit SIMCInstr, AssemblerPredicate and DecoderNamespace
settings in FLAT real instruction classes with the Select helpers.
[AMDGPU] Recognize workitem.id.x as the lane ID in isThreadID (#231235)
The matchers for wave shuffles use `isThreadID`, which only recognized
the mbcnt()-based form. However,
1) This gets canonicalized to workitem-id-based checks in some cases
and
2) Masking the workitem ID (when we know it changes between waves at a
power of 2) is a valid and typical way to express the lane ID.
Therefore, amend isThreadID to catch these forms of lane ID.
AI disclosure: Claude found this and wrote the code, I looked at and
wrote the commit message and got rid of pointless comments
RuntimeLibcalls: Use element alignment for vector libcall out pointers
The pointer arguments of the vector modf, sincos and sincospi functions
are linear pointers to the scalar element type (e.g. the l4 in
_ZGVnN4vl4l4_sincosf), not pointers to the vector type. Only the element
alignment is guaranteed, so stop declaring them with the ABI alignment
of the vector.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Describe vector FuncArgTypes by element type and count
Define the vector libcall argument types from an element type and
count. Derive the matching integer and mask vector types from them
instead of spelling each one out.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Add signatures for more runtime functions
Add type missing signatures for assorted functions which were missing
type information.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[AMDGPU] Align banked ArchVGPRs in the unified VGPR count
Compute the combined VGPR count from the banked ArchVGPR and AGPR counts
in initCandidate and checkScheduling.
Co-authored-by: Cursor <cursoragent at cursor.com>
[CIR] Change vectorize_enable loop hint to a bool. (#235148)
I originally made this a UnitAttr since we can't really create this as
anything but enable in CIR, but while attempting the lowering, I
discovered that it made that harder for no good reason. I've left the
'NYI' in place so that we can make sure we properly test this when OMP
gets this functionality, but switching it to a 'bool' will make future
lowering easier, and make it so the OMP changes don't have to do more
work when they start using these loop hints.
RuntimeLibcalls: Describe vector FuncArgTypes by element type and count
Define the vector libcall argument types from an element type and
count. Derive the matching integer and mask vector types from them
instead of spelling each one out.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Use element alignment for vector libcall out pointers
The pointer arguments of the vector modf, sincos and sincospi functions
are linear pointers to the scalar element type (e.g. the l4 in
_ZGVnN4vl4l4_sincosf), not pointers to the vector type. Only the element
alignment is guaranteed, so stop declaring them with the ABI alignment
of the vector.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Add signatures for more runtime functions
Add type missing signatures for assorted functions which were missing
type information.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[SPIRV] Declare SPV_KHR_relaxed_extended_instruction only when used
Whether one is needed is only known while building the module-scope NSDI,
which used to be streamed in sections 7 and 10, after OpExtension had been printed.
Split NSDI generation from output: generateModuleDebugInfo() now builds
the module-scope OpStrings and debug instructions into per-section
buffers before the module header is printed, and adds the extension if a
forward reference was built.
emitNonSemanticDebugStrings() and emitNonSemanticGlobalDebugInfo() output
the buffers in sections 7 and 10.
Function-body NSDI is still streamed.
With the extension no longer declared unconditionally.
RuntimeLibcalls: Use the correct target C long width (#237482)
Long and ULong were mapped to the int width, which is wrong on LP64
targets (e.g. scalbln was declared taking i32 on x86_64 linux) and on
16-bit targets where long is 32 bits.
Also fix strtoul, strtoull, and the unsigned long operator new/delete
variants to use the unsigned types.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[compiler-rt][Darwin] Add SANITIZER_IPHONEOS/VISIONOS, use in GetOSMajorKernelOffset
SANITIZER_IOS remains "iOS and iOS-like" (TARGET_OS_IPHONE). Add
SANITIZER_IPHONEOS (TARGET_OS_IOS, iOS only) and SANITIZER_VISIONOS
(TARGET_OS_VISION), and use the SANITIZER_* macros in
GetOSMajorKernelOffset.
Assisted-By: Claude
[lldb-dap] Report isOptimized on compileUnits (#235981)
Add isOptimized to the CompileUnit type in the compileUnits response, so
a client can tell whether a frame's code was built with optimizations.
Clients look the compile unit up with the frame's moduleId and
compileUnitId.
rdar://190656814
[clang] Implement fast isOutOfLine() for static data members. (#237773)
Taking advantage of C++ standard rules, we can take a shortcut to
determine if a static data member is out-of-line. Use this to speed up
VarDecl::isThisDeclarationADefinition.
Expected ctt improvement around 0.4%.
[llvm-profgen] Make missing frame inference deterministic (#235079)
Missing frame inference memoized the results of a DFS for tail call
paths. Inside a cycle, a result depends on the functions already on
the searched path, so reusing it made the inferred frames depend on
the order of searches. That order follows pointer-keyed containers,
so profiles differed from run to run.
Fix: cache only complete searches. Keep functions visited for the
whole search, so each is walked once, and check that a single path
found is the only one in extra pass: another simple path leaves it
through another tail call and rejoins it at a later function, so
walking from the functions of the path in order, keeping functions
visited, finds it. Each search takes linear time, so remove
max-search-depth, which only capped it.
On XL AArch64 binary with cycles of tail calls, it caused run-to-run
difference in 5..11 of 162,664 top-level profiles. With the fix,
profiles are identical across runs and allocators (jemalloc/glibc).
[4 lines not shown]
Expand testing for global merge symbol table info on AIX. (#224099)
Add a test that checks the symbol table info for merged global symbols
when they do not have an explicit section attribute. Uses the option
nozero-initialized-in-bss so we get symbol table entries for the zero
initialized globals as well.