aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2012-03-21 04:12:07 +0000
committerAndrew Trick <atrick@apple.com>2012-03-21 04:12:07 +0000
commit0b0d899f917d4771c940e7fa92990d981822a6db (patch)
tree120f17e5fa851065e3b23dac63e439941f22e165
parente0b51ab8d3484b5b526a942f26c4db8082fed1e1 (diff)
downloadexternal_llvm-0b0d899f917d4771c940e7fa92990d981822a6db.zip
external_llvm-0b0d899f917d4771c940e7fa92990d981822a6db.tar.gz
external_llvm-0b0d899f917d4771c940e7fa92990d981822a6db.tar.bz2
misched: cleanup main loop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153159 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/MachineScheduler.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/lib/CodeGen/MachineScheduler.cpp b/lib/CodeGen/MachineScheduler.cpp
index f1a2532..9f67d6d 100644
--- a/lib/CodeGen/MachineScheduler.cpp
+++ b/lib/CodeGen/MachineScheduler.cpp
@@ -306,6 +306,7 @@ public:
protected:
void moveInstruction(MachineInstr *MI, MachineBasicBlock::iterator InsertPos);
+ bool checkSchedLimit();
void releaseSucc(SUnit *SU, SDep *SuccEdge);
void releaseSuccessors(SUnit *SU);
@@ -374,6 +375,17 @@ void ScheduleDAGMI::moveInstruction(MachineInstr *MI,
RegionBegin = MI;
}
+bool ScheduleDAGMI::checkSchedLimit() {
+#ifndef NDEBUG
+ if (NumInstrsScheduled == MISchedCutoff && MISchedCutoff != ~0U) {
+ CurrentTop = CurrentBottom;
+ return false;
+ }
+ ++NumInstrsScheduled;
+#endif
+ return true;
+}
+
/// schedule - Called back from MachineScheduler::runOnMachineFunction
/// after setting up the current scheduling region.
void ScheduleDAGMI::schedule() {
@@ -406,18 +418,10 @@ void ScheduleDAGMI::schedule() {
CurrentBottom = RegionEnd;
bool IsTopNode = false;
while (SUnit *SU = SchedImpl->pickNode(IsTopNode)) {
-
-#ifndef NDEBUG
- // Enable break
- if (NumInstrsScheduled == MISchedCutoff && MISchedCutoff != ~0U) {
- CurrentTop = CurrentBottom;
- break;
- }
- ++NumInstrsScheduled;
-#endif
-
DEBUG(dbgs() << "*** " << (IsTopNode ? "Top" : "Bottom")
<< " Scheduling Instruction:\n"; SU->dump(this));
+ if (!checkSchedLimit())
+ break;
// Move the instruction to its new location in the instruction stream.
MachineInstr *MI = SU->getInstr();