[llvm] [MachineScheduler] Add option to skip large regions with high pressure (PR #178422)

Francesco Petrogalli via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 28 07:56:55 PST 2026


================
@@ -1694,6 +1700,18 @@ void ScheduleDAGMILive::schedule() {
   LLVM_DEBUG(SchedImpl->dumpPolicy());
   buildDAGWithRegPressure();
 
+  // Skip scheduling for large regions with critical register pressure that
+  // exceed the large region skip threshold.
+  unsigned SkipThreshold = SchedImpl->getPolicy().LargeRegionSkipThreshold;
+  if (SkipThreshold && NumRegionInstrs > SkipThreshold &&
+      !RegionCriticalPSets.empty()) {
----------------
fpetrogalli wrote:

maybe it would be helpful to have an option to control this with a threshold too? set to 0 by default so that it gives the same effect of !empty

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


More information about the llvm-commits mailing list