[llvm-commits] [llvm] r80702 - /llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp
David Goodwin
david_goodwin at apple.com
Tue Sep 1 11:34:03 PDT 2009
Author: david_goodwin
Date: Tue Sep 1 13:34:03 2009
New Revision: 80702
URL: http://llvm.org/viewvc/llvm-project?rev=80702&view=rev
Log:
Add hidden flags to allow binary search of post-RA scheduling errors.
Modified:
llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp
Modified: llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp?rev=80702&r1=80701&r2=80702&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp (original)
+++ llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp Tue Sep 1 13:34:03 2009
@@ -56,6 +56,16 @@
cl::desc("Enable exact hazard avoidance"),
cl::init(false), cl::Hidden);
+// If DebugDiv > 0 then only schedule MBB with (ID % DebugDiv) == DebugMod
+static cl::opt<int>
+DebugDiv("postra-sched-debugdiv",
+ cl::desc("Debug control MBBs that are scheduled"),
+ cl::init(0), cl::Hidden);
+static cl::opt<int>
+DebugMod("postra-sched-debugmod",
+ cl::desc("Debug control MBBs that are scheduled"),
+ cl::init(0), cl::Hidden);
+
namespace {
class VISIBILITY_HIDDEN PostRAScheduler : public MachineFunctionPass {
public:
@@ -212,6 +222,17 @@
// Loop over all of the basic blocks
for (MachineFunction::iterator MBB = Fn.begin(), MBBe = Fn.end();
MBB != MBBe; ++MBB) {
+#ifndef NDEBUG
+ // If DebugDiv > 0 then only schedule MBB with (ID % DebugDiv) == DebugMod
+ if (DebugDiv > 0) {
+ static int bbcnt = 0;
+ if (bbcnt++ % DebugDiv != DebugMod)
+ continue;
+ errs() << "*** DEBUG scheduling " << Fn.getFunction()->getNameStr() <<
+ ":MBB ID#" << MBB->getNumber() << " ***\n";
+ }
+#endif
+
// Initialize register live-range state for scheduling in this block.
Scheduler.GenerateLivenessForKills = false;
Scheduler.StartBlock(MBB);
More information about the llvm-commits
mailing list