[llvm] [AMDGPU] Examine instructions in pending queues during scheduling (PR #147653)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 8 23:20:44 PDT 2025
================
@@ -319,17 +327,45 @@ void GCNSchedStrategy::initCandidate(SchedCandidate &Cand, SUnit *SU,
}
}
+static bool shouldCheckPending(SchedBoundary &Zone,
+ const TargetSchedModel *SchedModel) {
+ const unsigned ReadyListLimit = 256;
+ bool HasBufferedModel =
+ SchedModel->hasInstrSchedModel() && SchedModel->getMicroOpBufferSize();
+ return ExaminePendingQueue &&
+ Zone.Available.size() + Zone.Pending.size() <= ReadyListLimit &&
+ HasBufferedModel;
+}
+
+static SUnit *pickOnlyChoice(SchedBoundary &Zone,
+ const TargetSchedModel *SchedModel) {
+ if (!shouldCheckPending(Zone, SchedModel) || Zone.Pending.empty())
+ return Zone.pickOnlyChoice();
+ return nullptr;
+}
+
+#ifndef NDEBUG
----------------
arsenm wrote:
Just leave it in? The body will be empty in release build anyway
https://github.com/llvm/llvm-project/pull/147653
More information about the llvm-commits
mailing list