[MLIR][XeGPU] Prefer the nearer consumer's layout in LayoutInfo::meet (#208365)
**Summary**
During backward layout propagation a value can be demanded by multiple
consumers with conflicting
layouts. Previously LayoutInfo::meet kept whichever demand was assigned
first, so the winner depended on
the dataflow worklist's visitation order — nondeterministic and often
not what we want.
This changes meet to prefer the layout demanded by the consumer nearer
to the producer in program order.
This tends to preserve a consumer's layout as far up the def chain as
possible, reducing layout
conversions. It is a heuristic hint, not a proven optimum.
- Each op gets a program-order index from a pre-order walk (matching
printed-IR order), so a use inside
[16 lines not shown]
AMDGPU: Migrate CodeGen tests to amdgpu subarch triple (27) (#209488)
Mechanically migrate the command-line target spelling on llc/opt RUN
lines in llvm/test/CodeGen/AMDGPU from -mtriple=amdgcn ... -mcpu=<gfx> to the
folded subarch triple form (e.g. -mtriple=amdgpu9.00-amd-amdhsa), dropping the
redundant -mcpu.
Co-Authored-By: Claude <noreply at anthropic.com> (Claude-Opus-4.8)
[lldb][bazel] Generate SafeAutoloadPaths.inc in the Bazel overlay (#209454)
The auto-load-paths mechanism added in #187031 generates
SafeAutoloadPaths.inc via a CMake configure_file() of
SafeAutoloadPaths.inc.in (lldb/source/Core/CMakeLists.txt), gated by the
LLDB_SAFE_AUTO_LOAD_PATHS cache variable which defaults to empty.
Debugger.cpp #includes SafeAutoloadPaths.inc, but the Bazel overlay
never modeled the configure_file(), so the header is missing from the
Bazel build of lldb Core.
Reproduce the generation with expand_template (substituting
@SAFE_PATH_ENTRIES@ with "" to match the empty default). Emit the header
under include/ and expose it via includes = ["include"] so the bare
#include resolves, matching how Config.h and Version.inc are handled in
this overlay.
assisted with: claude
I ensured this is valid bazel that Meta can translate into valid BUCK
and build lldb with internally via buck2. This appears to match a few
other template/library pairs.
[AMDGPU] Fix CFI emission when scratch instructions are used to spill
4b1cfc5d7c606e "[NFCI][AMDGPU] Final touch before moving to
`GET_SUBTARGETINFO_MACRO` (#177401)" (or more generally the move to
hasFlatScratchEnabled over just enableFlatScratch) was missed during the
CFI upstreaming for AMDGPU, and so we currently define the CFA
incorrectly for the architected flat scratch case.
This incorrect CFI is generated for e.g. gfx942. For such architecture,
the stack pointer (s32) holds a swizzled address (per-lane offset) but
the CFA needs to be an unswizzled address (per-wave).
In the incorrect program, we have a prologue looking like:
s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
s_mov_b32 s0, s33
s_mov_b32 s33, s32
[...]
s_add_i32 s32, s32, 16
[24 lines not shown]
[AMDGPU] Add stackPtrOffsetReg to llvm/test/CodeGen/AMDGPU/misaligned-vgpr-regsequence.mir
Prepare for this being observable to the CFA generation code.
Change-Id: I56d00133148fd2c8f0e0ed41edca446553c664bc
[AMDGPU] Fix type for DWARF register number in SIFrameLowering
It so happened that using MCRegister here happened to work, but
the encoded dwarf number is definitely not an MCRegister.
Change-Id: I13ef6a9ee870cf12db11f0cd20e03268e70e9bf9
[lldb] Gate `PolicyStack::Current()` log behind verbose (#209527)
`Process::GetState()` calls `PolicyStack::Get().Current()` on every
prompt redraw, so the previous unconditional LLDB_LOG at the read site
fired on every keypress once `log enable lldb process` was on, drowning
out any other process log output. Keep the dump for when it's actually
wanted, but only fire it if the log is set to verbose.
Signed-off-by: Med Ismail Bennani <ismail at bennani.ma>
[llvm-mc] Remove unused MCRegisterInfo/MCAsmInfo in Disassembler (NFC) (#208483)
Disassembler::disassemble() creates MCRegisterInfo and MCAsmInfo
instances that are no longer used.
Initially, they were introduced in a1bc0f5 to construct MCContext after
MCDisassembler began requiring one, but became dead in 2cb2707.
llvm-mc's main() already creates both objects and passes them into the
MCContext that disassemble() receives, so the error paths here are
unreachable.
Removing these objects also makes the MCTargetOptions parameter unused,
so drop it as well.
[RISCV] Fold 26-bit frame-index offsets into Xqcilo/Xqcilia load/store/addi (#209315)
Extend frame-index addressing such that the sp-relative offset resolved for a stack access that fits within 26-bit and not 12-bits; folds directly into the wide Xqcilo/Xqcilia instructions. This is achieved by adding the support for the following:
- Adding support for stack accesses to complex pattern `SelectAddrRegImm26` for 26-bit loads and stores
- Adding support for frame index operand to qc.e.addi instruction
- Allowing 26-bit offsets to fold into the loads and store instructions from qcilo/qcilia extension
[AMDGPU][CodeGen] Fix `S_NOP` insertion during `S_SET_VGPR_MSB` placement
The issue arises when co-issue optimizations move the initial insertion
position for `S_SET_VGPR_MSB` to an earlier spot, creating a mismatch
with the position used to determine whether a `S_NOP` is needed.