[llvm-commits] [llvm] r157437 - /llvm/trunk/lib/CodeGen/MachineScheduler.cpp

Andrew Trick atrick at apple.com
Thu May 24 16:11:17 PDT 2012


Author: atrick
Date: Thu May 24 18:11:17 2012
New Revision: 157437

URL: http://llvm.org/viewvc/llvm-project?rev=157437&view=rev
Log:
misched: Use the same scheduling heuristics with -misched-topdown/bottomup.

(except the part about choosing direction)

Modified:
    llvm/trunk/lib/CodeGen/MachineScheduler.cpp

Modified: llvm/trunk/lib/CodeGen/MachineScheduler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineScheduler.cpp?rev=157437&r1=157436&r2=157437&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineScheduler.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineScheduler.cpp Thu May 24 18:11:17 2012
@@ -1168,11 +1168,25 @@
   }
   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 {





More information about the llvm-commits mailing list