[llvm] [AMDGPU] Multi dword spilling for unaligned tuples (PR #183701)

Juan Manuel Martinez CaamaƱo via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 9 02:36:49 PDT 2026


================
@@ -1561,14 +1565,24 @@ void SIRegisterInfo::buildSpillLoadStore(
   // Always use 4 byte operations for AGPRs because we need to scavenge
   // a temporary VGPR.
   // If we're using a block operation, the element should be the whole block.
-  // For misaligned registers, use 4-byte elements to avoid alignment errors.
+  // clang-format off
   unsigned EltSize = IsBlock ? RegWidth
-                     : (IsFlat && !IsAGPR && !IsRegMisaligned)
+                     : (IsFlat && !IsAGPR)
                          ? std::min(RegWidth, 16u)
                          : 4u;
+  // clang-format on
----------------
jmmartinez wrote:

What do you think about splitting a bit this assignment instead of disabling clang-format. We could even inline the comment above and make the condition match the comments.

Why non-flat uses a `4u` `EltSize`? 

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


More information about the llvm-commits mailing list