[llvm-branch-commits] [llvm] [AMDGPU] Add stalls for DS FIFO buffer (PR #192323)

Jeffrey Byrnes via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Apr 24 09:57:49 PDT 2026


================
@@ -666,14 +695,33 @@ bool AMDGPUCoExecSchedStrategy::tryCandidateCoexec(SchedCandidate &Cand,
 
 bool AMDGPUCoExecSchedStrategy::tryEffectiveStall(SchedCandidate &Cand,
                                                   SchedCandidate &TryCand,
-                                                  SchedBoundary &Zone) const {
+                                                  SchedBoundary &Zone) {
+  auto getBufferFullStalls = [this, &Zone](SUnit *SU) -> unsigned {
+    InstructionFlavor Flavor = classifyFlavor(
+        *SU->getInstr(), *static_cast<const SIInstrInfo *>(DAG->TII));
+    HardwareUnitInfo *HWUI = Heurs.getHWUIFromFlavor(Flavor);
+
+    if (HWUI->getBufferSize() <= 1)
+      return 0;
+
+    // getBufferAvailableCycle assumes top-down scheduling.
+    assert(Zone.isTop());
+    unsigned CurrCycle = Zone.getCurrCycle();
+    unsigned BufferReadyCycle = HWUI->getBufferAvailableCycle(CurrCycle);
+    if (BufferReadyCycle <= CurrCycle)
+      return 0;
----------------
jrbyrnes wrote:

Yes, if the number of scheduling instructions is greater than the buffer size, but we have scheduled more than enough instructions to clear the stall from buffer full.

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


More information about the llvm-branch-commits mailing list