[llvm] [AMDGPU] Avoid unneeded waitcounts before spill stores (PR #108303)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 13 11:54:44 PDT 2024


================
@@ -901,7 +901,18 @@ void WaitcntBrackets::updateByEvent(const SIInstrInfo *TII,
     }
   } else /* LGKM_CNT || EXP_CNT || VS_CNT || NUM_INST_CNTS */ {
     // Match the score to the destination registers.
-    for (unsigned I = 0, E = Inst.getNumOperands(); I != E; ++I) {
+    //
+    // Check only explicit operands. Stores, especially spill stores, include
+    // implicit uses and defs of their super registers which would create an
+    // artificial dependency, while these are there only for register liveness
+    // accounting purposes.
+    //
+    // Special cases where implicit register defs and uses exists, such as
+    // M0, FLAT_SCR or VCC, but there is no way to load these registers from
----------------
arsenm wrote:

I believe it's illegal to load to m0, but it should still be possible to load to flat_scr (it just would never happen in practice) 

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


More information about the llvm-commits mailing list