[llvm] [MachineScheduler] Add support for scheduling while in SSA (PR #161054)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 28 23:36:59 PDT 2025


================
@@ -668,12 +789,40 @@ bool MachineSchedulerLegacy::runOnMachineFunction(MachineFunction &MF) {
   return Impl.run(MF, TM, {MLI, MDT, AA, LIS});
 }
 
+bool SSAMachineScheduler::runOnMachineFunction(MachineFunction &MF) {
+  if (skipFunction(MF.getFunction()))
+    return false;
+
+  if (EnableSSAMachineSched.getNumOccurrences()) {
+    if (!EnableSSAMachineSched)
+      return false;
+  } else if (!MF.getSubtarget().enableSSAMachineScheduler()) {
+    return false;
+  }
+
+  LLVM_DEBUG(dbgs() << "Before ssa-MI-sched:\n"; MF.print(dbgs()));
----------------
arsenm wrote:

```suggestion
```

This will be noisy and this kind of printing should be the PM's job 

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


More information about the llvm-commits mailing list