[PATCH] D52255: MachineScheduler: Add -misched-print-dags flag

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 18 18:29:05 PDT 2018


MatzeB created this revision.
MatzeB added reviewers: fhahn, javed.absar, evandro.
Herald added a subscriber: mcrosier.

Add a flag to dump the schedule DAG to the debug stream. This will be
used in upcoming commits to test schedule DAG mutations such as macro
fusion.


Repository:
  rL LLVM

https://reviews.llvm.org/D52255

Files:
  lib/CodeGen/MachineScheduler.cpp


Index: lib/CodeGen/MachineScheduler.cpp
===================================================================
--- lib/CodeGen/MachineScheduler.cpp
+++ lib/CodeGen/MachineScheduler.cpp
@@ -100,8 +100,11 @@
   cl::desc("Only schedule this function"));
 static cl::opt<unsigned> SchedOnlyBlock("misched-only-block", cl::Hidden,
                                         cl::desc("Only schedule this MBB#"));
+static cl::opt<bool> PrintDAGs("misched-print-dags", cl::Hidden,
+                              cl::desc("Print schedule DAGs"));
 #else
-static bool ViewMISchedDAGs = false;
+static const bool ViewMISchedDAGs = false;
+static const bool PrintDAGs = false;
 #endif // NDEBUG
 
 /// Avoid quadratic complexity in unusually large basic blocks by limiting the
@@ -765,6 +768,7 @@
   findRootsAndBiasEdges(TopRoots, BotRoots);
 
   LLVM_DEBUG(dump());
+  if (PrintDAGs) dump();
   if (ViewMISchedDAGs) viewGraph();
 
   // Initialize the strategy before modifying the DAG.
@@ -1218,6 +1222,7 @@
   SchedImpl->initialize(this);
 
   LLVM_DEBUG(dump());
+  if (PrintDAGs) dump();
   if (ViewMISchedDAGs) viewGraph();
 
   // Initialize ready queues now that the DAG and priority data are finalized.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52255.166060.patch
Type: text/x-patch
Size: 1196 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180919/e5bbdee7/attachment.bin>


More information about the llvm-commits mailing list