[llvm] [AMDGPU] Remove alignment constraint from spill pseudos (PR #177317)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 19 13:17:03 PST 2026
================
@@ -1536,12 +1536,39 @@ void SIRegisterInfo::buildSpillLoadStore(
const bool IsAGPR = !ST.hasGFX90AInsts() && isAGPRClass(RC);
const unsigned RegWidth = AMDGPU::getRegBitWidth(*RC) / 8;
+ // On targets with register tuple alignment requirements,
+ // for unaligned tuples, break the spill into 32-bit pieces.
+ // TODO: Optimize misaligned spills by using larger aligned chunks instead of
+ // 32-bit splits.
+ bool IsRegMisaligned = false;
+ if (!IsBlock && RegWidth > 4) {
+ unsigned SpillOpcode =
+ getFlatScratchSpillOpcode(TII, LoadStoreOp, std::min(RegWidth, 16u));
+ int VDataIdx =
+ IsStore ? AMDGPU::getNamedOperandIdx(SpillOpcode, AMDGPU::OpName::vdata)
+ : 0; // Restore Ops have data reg as the first (output) operand.
+ const TargetRegisterClass *ExpectedRC =
----------------
arsenm wrote:
The name doesn't really work. It's not an "expected" register class, it's the output real instruction's register class
https://github.com/llvm/llvm-project/pull/177317
More information about the llvm-commits
mailing list