[X86] Update tests for SlotIndexes compaction
The rebase onto eeee317b1f30 left four tests with upstream's checks
and a stale merge of pdep-vector-128.ll, and missed the new
pr246251.ll. Regenerate them with compaction on; each one's
compaction-off regeneration matches upstream, so only allocation
changes.
[CIR] Return the value stored to the return slot directly (#246252)
Classic codegen returns the value stored to the return slot directly
when that store dominates the return, and then drops the slot
(`findDominatingStoreToReturnValue` in CGCall.cpp). CIR always lowered
the slot to an alloca, store, load and ret, so most functions returning
a scalar differed from classic codegen.
This adds a `cir-forward-return-slot` function pass. In a function with
a single `cir.return` of a load from the return slot, it returns the
stored value directly when either:
- the store is the slot's only other use and reaches the load through a
chain of single predecessors, or
- the store immediately precedes the load.
These are classic codegen's rules. Volatile, atomic, record, array and
complex slots are left alone. The return keeps its own location, which
CIRGen already sets to the return statement's.
[5 lines not shown]
[AMDGPU] Describe MFMAs with a variant in MAIInstInfoTable (NFC)
- Add an MFMAVariant enum. Each MFMA pseudo gets its variant from
MAIInstInfoTable, a TableGen GenericTable. Each real MFMA opcode
inherits the variant of its pseudo through VOP3P_Real.
- Look up an MFMA's co-execution info by its variant, as gfx1250 does
for WMMA, instead of matching every opcode.
- Replace the is_dgemm and is_gfx940_xdl fields with the variant.
- Describe each MFMA row by the first stage at which SALU, memory, VALU
and the next MFMA may issue, plus the window length.
Assisted-by: Claude Opus 5.5
[AMDGPU] Remove SGPR-only SMEM real instructions on GFX10 and GFX11 (#247544)
On GFX10 and GFX11 there is no dedicated encoding for an SMEM
instruction with an SGPR offset and no immediate offset. It is encoded
in the same way as an SGPR offset plus a zero immediate offset, so there
were two real instructions with the same encoding.
Remove the SGPR-only real instructions and make the immediate offset
optional in the assembler for the SGPR+IMM ones instead, as is already
done on GFX12 and GFX13.
The assembler still accepts the same syntax and generates the same
encodings. The differences are:
- An SGPR offset is now always printed with "offset:0x0", by both the
assembler and the disassembler.
- An encoding with a zero immediate offset and the null register as
the SGPR offset is now disassembled as an immediate offset of 0x0
[5 lines not shown]
[AMDGPU] Ignore meta instructions when forming S_ANDN2_SAVEEXEC (#247568)
The S_OR_SAVEEXEC and S_XOR that lower an SI_ELSE were only combined
into S_ANDN2_SAVEEXEC if nothing but debug instructions separated them.
Ignore other meta instructions too, in particular the IMPLICIT_DEFs that
are often left in the block that holds the SI_ELSE.
Assisted-by: Claude Fable 5.2 <noreply at anthropic.com>
fixup! [AArch64] Support direct RCPC3 FP atomic loads and stores
Move the manually added tests to a separate file to prevent the tests
from being dropped when auto-generated tests are regenerated.
[libc++] Remove unnecessary HIDE_FROM_ABI annotations from the PSTL (#246303)
All of the PSTL code is currently explicitly annotated, even though most
doesn't need to be. This removes the unnecessary annotations.
[AMDGPU] Exclude real V_ACCVGPR_READ/WRITE_B32_vi opcodes from isMFMA (#245900)
Currently, only pseudo V_ACCVGPR_{READ,WRITE}_B32_e64 is excluded, fix
by also exclude real V_ACCVGPR_READ/WRITE_B32_vi.
[libc++][NFC] Simplify the implementation of ranges::advance a bit (#246851)
There is no need to have separate functions for iterating forward and
backward. We can just check for `bidirectional_iterator` and iterate
back first and then forward.
[libc++] Remove more _LIBCPP_HIDE_FROM_ABI throughout the library (#246301)
This removes redundant `_LIBCPP_HIDE_FROM_ABI` annotations which were
either missed during the initial pass or have been added since.
[OpenMP][MLIR] RegionBranchOpInterface for TargetOp, TargetDataOp (#209710)
This adds RegionBranchOpInterface support to `omp.target` and
`omp.target_data`, and adds RegionBranchTerminatorOpInterface to
`omp.terminator`.
Both `omp.target` and `omp.target_data` contain structured regions whose
control flow enters the region and eventually returns to the parent
operation. Without RegionBranchOpInterface, generic region-aware
data-flow analyses cannot propagate lattice state across these region
boundaries.
For example, an analysis that tracks the host and device states of
mapped values cannot propagate its state into an `omp.target` region and
back to the parent operation after a mapped value is modified and copied
out.
Changes:
- Add RegionBranchOpInterface to omp.target.
[7 lines not shown]
[AMDGPU][Disassembler] Drop -ignore-fully-defined-operands
ed3597e2f7c4 added -ignore-fully-defined-operands to all targets
as a temporary option keeping the old decoder behaviour, where
operands with all bits known are not decoded. AMDGPU is the
last target still using it.
Without the option, such operands are decoded by the generated
decoder, so the code adding the gds operand of DS instructions on
targets without GDS and the a16 operand of BVH instructions is
not needed anymore.
This also means DS instructions on gfx90a, gfx942 and gfx950,
where the gds bit is decoded, no longer get a second gds operand,
and the BVH instructions that have no a16 operand no longer get
one.
Assisted-By: Claude
[X86][APX] Test the relocation of an NF add
test_regclass_not_updated_by_regalloc_2 only produced an NDD/NF add
with a GOT operand because the allocator happened to give the add a
destination different from its source. With SlotIndexes compaction it
picks the same register, so the add is compressed to the legacy form
and the CODE_6 TODO lost its test.
Add a function whose add keeps its source live, so it stays NDD and
becomes NF under any allocation.
[X86][APX] Keep hoist-folded-copy test effective
inline-spiller-hoist-folded-copy.ll reproduces a null VNInfo
dereference in HoistSpillHelper that needs greedy to fold a spill
into the COPY inserted by an NDD reload fold. SlotIndexes compaction
shortens the outer loop in index space, greedy spills differently,
and the test passes even with the fix reverted.
Add four empty asm statements to lengthen the loop again. The test
then crashes without the fix whether compaction is on or off.
[X86] Enable SlotIndexes compaction by default
Compacting SlotIndexes before greedy allocation drops the entries of
erased instructions, so live range sizes and instruction distances
reflect the code being allocated rather than how much was erased
before it. AMDGPU has done this since #235806; do the same for X86.
Codegen changes only through allocation: no new crashes, verifier
errors or allocation failures in the lit suites, including
EXPENSIVE_CHECKS, and a stage-2 build of LLVM, clang and lld with
-verify-machineinstrs passes its own tests. On llvm-test-suite at -O3,
spills drop 0.3% and .text 0.06%, with compile time unchanged.
Most test updates are regenerated checks. misched-matmul now inserts
20 spills instead of 24. live-debug-vars-stale-slotindexes.mir gets
one more use of %27 so that accumulate_fit still reaches the stale
index path it was written for.
[DAG] isGuaranteedNotToBeUndefOrPoison - add ISD::ABS handling
ISD::ABS and ISD::ABS_MIN_POISON are elementwise, so pass DemandedElts
to the operand, like the other elementwise nodes.
#245048 needs this to drop the blend with zero in
vzext_movl_abs_trunc_v2i64.
Assisted-by: Claude Code (Claude Opus 5.5)
[VPlan] Fix use-before-def in transformToPartialReduction
transformToPartialReduction was inserting the partial reduction at the widen recipe, but in the test case added the widen recipe is defined before Link.Blend's mask and hit a use-before-def assertion. simplifyCFG can sometimes produce CFGs that trigger this.
This fixes it by creating the partial reduction before the blend instead.