X86: Use the DataLayout size in the atomic expansion hooks
getPrimitiveSizeInBits is 0 for pointers and vectors of pointers, so a
128-bit <2 x ptr> atomic load or store without AVX was not expanded to
cmpxchg16b and was selected as a non-atomic movaps.
Expanding the load to cmpxchg then hit the same problem in
expandAtomicLoadToCmpXchg, which sized the cmpxchg integer type with
getPrimitiveSizeInBits. Use the same integer type and cast chain as the
other atomic integer conversions.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
CodeGen: Merge shrinkToUses live-in segments in one pass (#242699)
extendSegmentsToUses visits blocks in worklist order and inserted each
live-in segment into the middle of the segment vector, as did
createSegmentsForValues for the def segments. Sort both and merge them
in one pass instead, with at most one live-in segment per block. The
gain is largest in cases with large live ranges across many blocks.
llc instructions:u:
CTMark x86_64: -0.13%
CTMark arm64: -0.06%
AMDGPU sample: -0.28%
Largest AMDGPU improvements:
rocsolver potf2-specialized-kernels-d (gfx942): -4.40%
rocsolver getf2-small-d (gfx942): -2.62%
rocsolver getf2-small-d (gfx1100): -2.00%
rocprim warp_sort (gfx1100): -1.54%
Blender Cycles kernel (gfx1030/gfx1100/gfx1201): -0.9%
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Hexagon: Use LastSubtargetCache in getSubtargetImpl (#242791)
Migrate to the new common target pattern
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
AtomicExpand: Cast the xchg from an expanded atomic store to integer (#242963)
expandAtomicStoreToXChg created the atomicrmw xchg and expanded it
directly, skipping the cast to integer that shouldCastAtomicRMWIInIR
requests for other xchg instructions. A vector store expanded this way
reached the LL/SC expansion with a vector type, which asserted on ARM.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
AMDGPU: Add test for m0 kill flags after merging inits (#242558)
hoistAndMergeSGPRInits extends the live range of m0 across blocks,
which requires clearing kill flags but nothing tested this.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[offload][lit] Disable strided_update_multidim_gap.c on Intel GPU (#243105)
Newly added test failing on Intel runner. There was no comment on the PR
about the failure because the machine locked up and needed a reboot.
I manually updated https://github.com/llvm/llvm-project/issues/182897.
Signed-off-by: Nick Sarnie <nick.sarnie at intel.com>
[AMDGPU] Fix clamp folding through a COPY with other users (#242414)
tryFoldClamp looks through a COPY of the clamp's source (seen with
True16) to find the instruction that the clamp bit is set on. It only
checked that the COPY's result had a single user, so if the
instruction's own result had other users then they would wrongly see
the clamped value too.
Require every register in the COPY chain to have a single user.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[AMDGPU] Use the latency metric to break RP ties in the initial stages
When neither pressure is less than the other in mayCauseSpilling, the
schedule is reverted when there is a tie. In the initial stages, the old
schedule is just the input order, so a tie discarded a latency-aware
schedule in favor of an order that was never selected for performance.
Add a UseLatencyOnTie argument to mayCauseSpilling(). When it is set,
the region is reverted only if the old pressure is less than the new
one. On a complete tie, the new schedule is kept if its schedule
metric is lower than that of the old one. The Max Occupancy, ILP, and
Memory Clause initial stages set it. The rescheduling stages keep reverting
on a tie, since their old schedule was already selected by an earlier stage.
Fixes LCOMPILER-3191.
Co-authored-by: Cursor <cursoragent at cursor.com>
[LV] Make shouldOptimizeForSz vectorization-hint aware (#238309)
Make llvm::shouldOptimizeForSize take a UseProfilingInfo parameter, so
that profiling information does not take precedence over a user-supplied
hint.
[Object][SPARC] Infer subtarget features from SPARC ELF header (#241649)
Map the SPARC ELF machine type and e_flags to subtarget features so
llvm-objdump can disassemble V9 and VIS instructions without an
explicit --mcpu/--mattr:
- EM_SPARC32PLUS or EF_SPARC_32PLUS -> +v9
- EF_SPARC_SUN_US1 -> +vis
- EF_SPARC_SUN_US3 -> +vis2
Plain EM_SPARC objects without these flags still need --mcpu=v9, as
the header gives no indication that V9 instructions are present.
Fixes #122195
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
net-im/continuwuity: Fetch the distfiles via USE_FORGEJO
The framework knows how to fetch from Forgejo instances, so let it do the
work instead of spelling out the master sites, the distfiles and a revision
variable per source.
Sponsored by: Netzkommune GmbH
AMDGPU: Don't include stack size of chain callees
Chain callees are always tail called into and overwrite the caller's
stack. Therefore, their stack size should not be added up to that of
their caller when computing the resource usage.
Assisted-by: AI