[llvm] [MachineScheduler][RISCV] Release the pending queue base on condition (PR #125468)

Pengcheng Wang via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 9 23:05:52 PST 2025


================
@@ -3741,6 +3776,16 @@ SUnit *GenericScheduler::pickNode(bool &IsTopNode) {
            Bot.Available.empty() && Bot.Pending.empty() && "ReadyQ garbage");
     return nullptr;
   }
+
+  if (EnableReleasePendingQ && !RegionPolicy.OnlyBottomUp &&
+      TRI->shouldReleasePendingQueue(
+          DAG->MF, DAG->getTopRPTracker().getPressure().MaxSetPressure))
+    bumpCycleUntilReleaseSUFromPending(/*IsTop=*/true);
+  if (EnableReleasePendingQ && !RegionPolicy.OnlyTopDown &&
+      TRI->shouldReleasePendingQueue(
+          DAG->MF, DAG->getBotRPTracker().getPressure().MaxSetPressure))
+    bumpCycleUntilReleaseSUFromPending(/*IsTop=*/false);
----------------
wangpc-pp wrote:

```suggestion
  if(EnableReleasePendingQ) {
    if (!RegionPolicy.OnlyBottomUp && TRI->shouldReleasePendingQueue(DAG->MF, DAG->getTopRPTracker().getPressure().MaxSetPressure))
      bumpCycleUntilReleaseSUFromPending(/*IsTop=*/true);
    if (!RegionPolicy.OnlyTopDown && TRI->shouldReleasePendingQueue(DAG->MF, DAG->getBotRPTracker().getPressure().MaxSetPressure))
      bumpCycleUntilReleaseSUFromPending(/*IsTop=*/false);
  }
```

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


More information about the llvm-commits mailing list