aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineScheduler.cpp
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2012-05-24 23:11:17 +0000
committerAndrew Trick <atrick@apple.com>2012-05-24 23:11:17 +0000
commit8ddd9d5b2bee3ccdb36aee4423ca4443d7b3dc32 (patch)
treee351efd2d3970b2d1175a023cd4b527b91fedab6 /lib/CodeGen/MachineScheduler.cpp
parentb1ebd6981fe2654a295200d18d479f092201d394 (diff)
misched: Use the same scheduling heuristics with -misched-topdown/bottomup.
(except the part about choosing direction) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157437 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineScheduler.cpp')
-rw-r--r--lib/CodeGen/MachineScheduler.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/CodeGen/MachineScheduler.cpp b/lib/CodeGen/MachineScheduler.cpp
index 78a5b8d8cd..662b16fa0a 100644
--- a/lib/CodeGen/MachineScheduler.cpp
+++ b/lib/CodeGen/MachineScheduler.cpp
@@ -1168,11 +1168,25 @@ SUnit *ConvergingScheduler::pickNode(bool &IsTopNode) {
}
SUnit *SU;
if (ForceTopDown) {
- SU = DAG->getSUnit(DAG->top());
+ SU = Top.pickOnlyChoice();
+ if (!SU) {
+ SchedCandidate TopCand;
+ CandResult TopResult =
+ pickNodeFromQueue(Top.Available, DAG->getTopRPTracker(), TopCand);
+ assert(TopResult != NoCand && "failed to find the first candidate");
+ SU = TopCand.SU;
+ }
IsTopNode = true;
}
else if (ForceBottomUp) {
- SU = DAG->getSUnit(priorNonDebug(DAG->bottom(), DAG->top()));
+ SU = Bot.pickOnlyChoice();
+ if (!SU) {
+ SchedCandidate BotCand;
+ CandResult BotResult =
+ pickNodeFromQueue(Bot.Available, DAG->getBotRPTracker(), BotCand);
+ assert(BotResult != NoCand && "failed to find the first candidate");
+ SU = BotCand.SU;
+ }
IsTopNode = false;
}
else {