IR: Introduce "debugger-tuning" module flag
Prepare to replace TargetOptions::DebuggerTuning with a module flag. Unlike
other TargetOptions recently moved to module flags, debugger tuning is not a
firm ABI property. Mismatches and unrecognized names are tolerated.
Co-authored-by: Claude Sonnet 5 <noreply at anthropic.com>
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>
[AMDGPU] Keep dst flags when unpacking packed F32 instructions (#234858)
performF32Unpacking copied the new instructions' dst operands by value,
so
its setIsUndef and setIsRenamable calls never reached the instructions.
Take
the operands by reference.
Assisted-by: Claude Opus 5.5
AMDGPU: Don't reserve the implicit buffer pointer with architected flat scratch
Mesa shaders always had s[0:1] reserved for the implicit buffer
pointer, which is only needed to set up the scratch buffer
resource. With architected flat scratch, scratch is initialized by the
hardware and the pointer is unused. The driver stopped passing this
pointer so all user SGPRs were off by 2.
Don't reserve it on targets with architected flat scratch, so the user
SGPRs of Mesa shaders start at s0. Diagnose the use in the unsupported
contexts. This fixes many test failures on my system when running
piglit.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[MIR] Address review: merge error tests, un-lambda count parsing
Merge the three "ops:N" error tests into one with split-file, move the
operand count parsing out of a lambda into MIParser, and shorten the
round-trip test's comment.
Assisted-by: Claude Opus 5.5
AMDGPU: Use S_ADD_I32 to select uniform uaddsat (#235242)
95ff1fa00ed4 selected uniform uaddsat.i32 to an S_ADD_U32 sequence.
S_ADD_U32 defines a carry out, so when the instructions have to be
moved to the VALU it is replaced with V_ADD_CO_U32_e32, which doesn't
exist on gfx10+. This would later assert when encoded. moveToVALU
should probably learn to handle that correctly, or at least assert.
The carry isn't needed, so use S_ADD_I32 like the usubsat pattern,
which is moved to V_ADD_U32_e64 where available.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[libc++] Add benchmarks for std::reduce and std::transform_reduce (#233374)
The PR adds benchmarks for these algorithms:
- `std::reduce()`
- `std::transform_reduce()`, unary transform
- `std::transform_reduce()`, binary transform
The benchmarks run minimal reduction and transformation operators with
`int`, `float` and `double` parameters.
`std::vector` and `std::list` containers are tested, `std::deque` is not
included to reduce the number of added benchmarks.
Fixes #226211
---------
Co-authored-by: Louis Dionne <ldionne.2 at gmail.com>
[CIR] Fix cir.cast fold crash on a same type integral cast (#234236)
The fold called fold() on the source defining op, which is null for
block arguments
[CIR] Narrow blanket -fopenmp NYI guards to OGCG conditions (#233671)
Ordinary code compiled with -fopenmp hit errorNYI on every assignment,
inc/dec, member access and global reference
AMDGPU: Use S_ADD_I32 to select uniform uaddsat
95ff1fa00ed4 selected uniform uaddsat.i32 to an S_ADD_U32 sequence.
S_ADD_U32 defines a carry out, so when the instructions have to be
moved to the VALU it is replaced with V_ADD_CO_U32_e32, which doesn't
exist on gfx10+. This would later assert when encoded. moveToVALU
should probably learn to handle that correctly, or at least assert.
The carry isn't needed, so use S_ADD_I32 like the usubsat pattern,
which is moved to V_ADD_U32_e64 where available.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[lld-macho] Fix export trie for names containing 0xff bytes (#233399)
On signed-char hosts, charAt() promotes a 0xff byte to -1, aliasing the
end-of-string sentinel used by the three-way radix sort. As a result, an
export could be silently dropped or truncated. Fix is to convert the
byte to unsigned char before promoting it to int. I also verified that
ld-prime handles 0xff perfectly fine.
Assisted by Opus 5.5
---------
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[Clang] Detect emutls separately
OSes like FreeBSD support clang-rapl but doesn't provide emutls
implementation. In this case, the test fails to run. To fix it, we
detect thread local and set a new flag.
[TailCallElim] Place byval copy-back after trailing instructions (#234699)
Fix the insertion point of the byval copy operation we insert when
updating our incoming byval argument when transforming tail calls into
loops. We should insert the argument update memcpy at the point of the
**return**, not the call. There may be side-effect free instructions
between the call and the return, and they may read the incoming
argument, and using the incorrect insertion point results in a
miscompile.
Fixes #234334
LLM-aided