[llvm] [AMDGPU][SIInsertWaitCnts] Use RegUnits-based tracking (PR #162077)

Pierre van Houtryve via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 9 04:51:11 PST 2025


================
@@ -1084,21 +1094,20 @@ void WaitcntBrackets::updateByEvent(WaitEventType E, MachineInstr &Inst) {
         }
         if (Slot)
           break;
-        // The slot may not be valid because it can be >= NUM_LDS_VGPRS which
+        // The slot may not be valid because it can be >= NUM_LDSDMA which
         // means the scoreboard cannot track it. We still want to preserve the
         // MI in order to check alias information, though.
         LDSDMAStores.push_back(&Inst);
         Slot = LDSDMAStores.size();
         break;
       }
-      if (Slot < NUM_LDS_VGPRS)
-        setRegScore(FIRST_LDS_VGPR + Slot, T, CurrScore);
-      if (Slot)
-        setRegScore(FIRST_LDS_VGPR, T, CurrScore);
+      setVMemScore(LDSDMA_BEGIN, T, CurrScore);
+      if (Slot && Slot < NUM_LDSDMA)
----------------
Pierre-vh wrote:

Yes, we always set the `LDSDMA_BEGIN` slot no matter what, so we can fall back to that if needed.

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


More information about the llvm-commits mailing list