summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
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
commita306a8a844dbfa6d3d379ed3c8f693cca753a2dd (patch)
treeecfe9f90a2bf64458849f8e04397cd1387e901f0 /llvm/lib/CodeGen
parentc37a1d6e0fc6b56dcdd7018322a9a8dac6d69c1c (diff)
downloadbcm5719-llvm-a306a8a844dbfa6d3d379ed3c8f693cca753a2dd.tar.gz
bcm5719-llvm-a306a8a844dbfa6d3d379ed3c8f693cca753a2dd.zip
misched: Use the same scheduling heuristics with -misched-topdown/bottomup.
(except the part about choosing direction) llvm-svn: 157437
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/MachineScheduler.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp
index 78a5b8d8cd5..662b16fa0a0 100644
--- a/llvm/lib/CodeGen/MachineScheduler.cpp
+++ b/llvm/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 {
OpenPOWER on IntegriCloud