[llvm-objcopy] Address reviewer feedback on AMDGPU test cleanups
- Remove unused -DMACHINE yaml2obj template variable in cross-arch-headers.test,
hardcode Machine: EM_NONE directly in the YAML instead
- Remove unused Flags: [[FLAGS=<none>]] template variable in cross-arch-headers.test
- Add comment in binary-output-target.test explaining that Arch: unknown is
intentional when converting from binary (e_flags=0, no EF_AMDGPU_MACH set)
[Clang][ARM] Fix immediate range for NEON widening left-shifts (#212459)
The ACLE specifies the C intrinsic 'vshll_n to have a valid immediate
range size of [0..eltsize] but it has a range of [0..((eltsize*2) - 1)].
Update the range check to match the specified behavior
---------
Co-authored-by: Lukacma <Marian.Lukac at arm.com>
[SPIR-V] Preserve float types through wide float shuffles and atan2 legalization (#213785)
fixes https://github.com/llvm/llvm-project/issues/213783
Propagate result types through G_SHUFFLE_VECTOR and G_FATAN2 during
post-legalizer type deduction. This prevents wide float vectors from
producing integer-typed OpCompositeExtract instructions.
Add generic float shuffle and wide atan2 regression coverage.
assisted by Copilot (GPT-5.6-Sol)
[X86] Don't assume the FPCLASS category mask is a literal (#213171)
`llvm-mc` asserts on a FPCLASS category mask given as a symbol:
```asm
vfpclassps $f0, %zmm1, %k1
```
```
Assertion failed: isImm() && "This is not an immediate", MCInst.h:85
```
`printFPCLASSComments` reads the last operand with `getImm()` without
checking it is one. The value is only known at link time, so there is no
category to describe; return early and print no comment.
Note this is a comment printer, so encoding is unaffected.
`--filetype=obj` already succeeds today and emits a placeholder
immediate plus an `R_X86_64_8` relocation, which is correct. The issues
describe this as producing a wrong encoding in release builds, which I
[7 lines not shown]
[flang] Add LLVM dialect dependency to VScaleAttr (#213931)
`VScaleAttr` creates an LLVM `VScaleRangeAttr`, but did not declare the
LLVM dialect as a pass dependency. This aborts when the input does not
otherwise load LLVM.
Declare the dependency and remove the unused FIR-typed argument from the
existing test. Parsing `!fir.ref` loads `FIROpsDialect`, which loads
`LLVMDialect` as a dependency and previously masked the missing pass
dependency.
Signed-off-by: Keshav Vinayak Jha <keshavvinayakjha at gmail.com>
[AArch64] Update cttz and ctlz cost model test. NFC (#213999)
This updates the tests to match ctpop, how we test other operations.
Some extra
type coverage and cssc is added.
[Clang] Restrict ClangScanDeps darwin-specific test not to run in cross-compile (#213884)
The test added in 316a29603228c5d5000e0ddf8dfba2a494ac7ee9 fails when
run on MacOS but targeting Linux as a cross compiler.
[mlir][SPIR-V] Verify ExecutionMode operand count and kind (#212828)
Add a verifier for spirv.ExecutionMode enforcing the correct number of
literal operands per execution mode and rejecting `<id>`-only modes and
share the operand schema with spirv.ExecutionModeId
[AMDGPU] Limit register pressure of pipelined loops
Opt AMDGPU into the generic MachinePipeliner register-pressure detector via
shouldLimitRegPressure(), and supply an occupancy-aware verdict in
isScheduleRegPressureTooHigh(): reject a schedule whose SGPR or VGPR/AGPR
pressure would drop the kernel below its target occupancy, or exceed a
register class's addressability cap. On gfx90a+ VGPRs and AGPRs share one
register file, so their combined footprint is bounded together. These match
the limits GCNSchedStrategy enforces.
[libc++] Tweak comments for workaround about `fpclassify` overloads (#212388)
Explaining why we have `_LIBCPP_PREFERRED_OVERLOAD` and template
versions.
[AArch64][Windows] Fix swift async context slot placement (#212922)
Swift async functions can miscompile on Windows ARM64 at `-O2`, when
there's enough register pressure that a local gets scavenged into the
callee-save area: the local ends up sharing an address with the saved
caller x29, so the epilogue restores a value the function has already
overwritten. swiftlang/swift#90920 has a reduced repro.
`assignCalleeSavedSpillSlots` creates the swift async context object
before the callee-save loop instead of inside it next to the FP slot.
MachineFrameInfo ends up with it above the frame record while the
prologue stores it below at FP-8, and the 8 byte disagreement leaves a
hole in the middle of the callee-save area. PEI's scavenger hands that
hole to the local. Only reproduces at -O2 and up since scavenging is
gated on the opt level.
```
sub sp, sp, #112
str x19, [sp, #16] // 8-byte Spill
[22 lines not shown]
[Verifier] Clean up load atomic elementwise mem access sizes check (NFC) (#213864)
I refactored the `load atomic elementwise` check to have the same
cleaner pattern as `atomicrmw elementwise` and remove the `ScalarTy`
intermediate.
The previous code had this segment:
```
if (VecTy) {
checkAtomicMemAccessSize(ScalarTy, &LI);
ScalarTy = VecTy->getElementType();
}
```
Which is confusing because it's checking the atomic access size on the
whole vector and then assigning `ScalarTy` to the element type so that
the second check does the check on the element type. It's cleaner to
reverse this and have the first check operate on the element type so
that the second check always checks the entire type.
[libc++] Granularize <__locale> into __locale_dir (#213667)
The <__locale> header was a collection of distinct utilities. This patch
splits it up into granular headers under __locale_dir/. This patch
however does not use the granular headers from users of <__locale>: this
will be done in a separate patch.
Assisted by Claude
[Verifier] Reject elementwise atomicrmw with sub-byte element type (#213753)
In https://github.com/llvm/llvm-project/pull/208510/ I accidentally
introduced a bug where I allowed sub-byte element types with atomicrmw
elementwise (i.e. `<8 x i1>`).
The LangRef states:
```
The access type
must then be a fixed vector type whose total bit width is a power of two and
whose element type is supported by the corresponding scalar atomic instruction.
```
The second part of this sentence rejects sub-byte element types.
The fix is that elementwise atomics need to additionally call
`checkAtomicMemAccessSize` on the vector element type (they already call
it on the whole vector).
[dyndbg][AsmPrinter] Add tail padding attributes (#194852)
"tail-pad-to-size"="n": Pad functions up to at least 'n' bytes.
"tail-pad-value"="n": Pad using the value 'n' (default 0).
This patch is to support dynamic debugging, RFC:
https://discourse.llvm.org/t/90113
In order to transfer control from an optimized to an unoptimized function a
debugger may patch the optimized version with a jump to the unoptimized
one.
This patch adds a mechanism to ensure there's enough padding between functions
to avoid patches overwriting unrelated code. It adds padding to the end of
functions smaller then 'n' bytes.
The `.fill` directive expression was discussed here:
https://discourse.llvm.org/t/89658
See the RFC and pull request for discussions of alternative approaches.