[llvm] [MISched] Dump region header under -misched-print-dags (PR #215090)

Nathan Corbyn via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 02:46:58 PDT 2026


================
@@ -860,13 +860,20 @@ void MachineSchedulerBase::scheduleRegions(ScheduleDAGInstrs &Scheduler,
         Scheduler.exitRegion();
         continue;
       }
-      LLVM_DEBUG(dbgs() << "********** MI Scheduling **********\n");
-      LLVM_DEBUG(dbgs() << MF->getName() << ":" << printMBBReference(*MBB)
-                        << " " << MBB->getName() << "\n  From: " << *I
-                        << "    To: ";
-                 if (RegionEnd != MBB->end()) dbgs() << *RegionEnd;
-                 else dbgs() << "End\n";
-                 dbgs() << " RegionInstrs: " << NumRegionInstrs << '\n');
+      auto DumpRegionHeader = [&] {
+        dbgs() << "********** MI Scheduling **********\n";
----------------
cofibrant wrote:

I think it would require a separate patch only if we're changing it for debug printing, which I'm not suggesting. `-print-dags`, at least to me, should have the semantics: please print parseable representation of the schedule DAG. This `*** MI Scheduling ***` line is the (semi) standard pass start debug, not part of the DAG representation. All I'm suggesting is to lift that line out of `DumpRegionHeader()` and if you want a similar delineator for `-print-dags` output, to add one under `if (PrintDags)` explicitly.

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


More information about the llvm-commits mailing list