[llvm] [AMDGPU][WIP] Optimize SGPR spills (PR #93668)

Vikash Gupta via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 4 23:21:37 PDT 2024


================
@@ -1775,10 +1775,13 @@ bool SIRegisterInfo::spillSGPR(MachineBasicBlock::iterator MI, int Index,
 
   if (SpillToVGPR) {
 
+    // Since stack slot coloring pass is trying to optimize SGPR spills,
+    // VGPR lanes (mapped from spill stack slot) may be shared for unequal SGPR
+    // spills. This accounts for number of VGPR lanes alloted equal to the
+    // largest SGPR being spilled in them.
     assert(SB.NumSubRegs <= VGPRSpills.size() &&
-           "Num of VGPR lanes should be greater or equal to num of SGPRs "
-           "spilled, as Stack Slot Coloring pass assigns different SGPR spills "
-           "into same stack slots");
+           "Num of VGPR lanes mapped should be greater or equal to num of "
----------------
vg0204 wrote:

> I guess it is more appropriate to use 'shouldn't be less than' instead of 'should be greater or equal'

Then should I reverse the assert statement, so that 'shouldn't be less than' can be used?

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


More information about the llvm-commits mailing list