[llvm] [AMDGPU] Remove alignment constraint from spill pseudos (PR #177317)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 12 01:03:18 PST 2026


================
@@ -1536,12 +1536,21 @@ 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 (ST.needsAlignedVGPRs() && IsFlat && !IsBlock && RegWidth > 4)
+    IsRegMisaligned = !isProperlyAlignedRC(*RC);
----------------
arsenm wrote:

Yes 

https://github.com/llvm/llvm-project/pull/177317


More information about the llvm-commits mailing list