[llvm] r198124 - Added debugging options: -misched-only-func/block

Andrew Trick atrick at apple.com
Sat Dec 28 13:57:02 PST 2013


Author: atrick
Date: Sat Dec 28 15:57:02 2013
New Revision: 198124

URL: http://llvm.org/viewvc/llvm-project?rev=198124&view=rev
Log:
Added debugging options: -misched-only-func/block

Modified:
    llvm/trunk/lib/CodeGen/MachineScheduler.cpp

Modified: llvm/trunk/lib/CodeGen/MachineScheduler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineScheduler.cpp?rev=198124&r1=198123&r2=198124&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineScheduler.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineScheduler.cpp Sat Dec 28 15:57:02 2013
@@ -49,6 +49,11 @@ static cl::opt<bool> ViewMISchedDAGs("vi
 
 static cl::opt<unsigned> MISchedCutoff("misched-cutoff", cl::Hidden,
   cl::desc("Stop scheduling after N instructions"), cl::init(~0U));
+
+static cl::opt<std::string> SchedOnlyFunc("misched-only-func", cl::Hidden,
+  cl::desc("Only schedule this function"));
+static cl::opt<unsigned> SchedOnlyBlock("misched-only-block", cl::Hidden,
+  cl::desc("Only schedule this MBB#"));
 #else
 static bool ViewMISchedDAGs = false;
 #endif // NDEBUG
@@ -377,6 +382,14 @@ void MachineSchedulerBase::scheduleRegio
 
     Scheduler.startBlock(MBB);
 
+#ifndef NDEBUG
+    if (SchedOnlyFunc.getNumOccurrences() && SchedOnlyFunc != MF->getName())
+      continue;
+    if (SchedOnlyBlock.getNumOccurrences()
+        && (int)SchedOnlyBlock != MBB->getNumber())
+      continue;
+#endif
+
     // Break the block into scheduling regions [I, RegionEnd), and schedule each
     // region as soon as it is discovered. RegionEnd points the scheduling
     // boundary at the bottom of the region. The DAG does not include RegionEnd,





More information about the llvm-commits mailing list