summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/PostRASchedulerList.cpp
diff options
context:
space:
mode:
authorDavid Goodwin <david_goodwin@apple.com>2009-09-01 18:34:03 +0000
committerDavid Goodwin <david_goodwin@apple.com>2009-09-01 18:34:03 +0000
commit7f6516949bec62591d14dce417133cd82efd3508 (patch)
tree189d9c9e121e68f227c4a2b75df3b958be841f46 /llvm/lib/CodeGen/PostRASchedulerList.cpp
parent6b8b4b459d0851ca7630a9584242df56687afc3c (diff)
downloadbcm5719-llvm-7f6516949bec62591d14dce417133cd82efd3508.tar.gz
bcm5719-llvm-7f6516949bec62591d14dce417133cd82efd3508.zip
Add hidden flags to allow binary search of post-RA scheduling errors.
llvm-svn: 80702
Diffstat (limited to 'llvm/lib/CodeGen/PostRASchedulerList.cpp')
-rw-r--r--llvm/lib/CodeGen/PostRASchedulerList.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/PostRASchedulerList.cpp b/llvm/lib/CodeGen/PostRASchedulerList.cpp
index f6e8a786a8d..91d4ad74323 100644
--- a/llvm/lib/CodeGen/PostRASchedulerList.cpp
+++ b/llvm/lib/CodeGen/PostRASchedulerList.cpp
@@ -56,6 +56,16 @@ EnablePostRAHazardAvoidance("avoid-hazards",
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 @@ bool PostRAScheduler::runOnMachineFunction(MachineFunction &Fn) {
// 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);
OpenPOWER on IntegriCloud