[llvm] r273615 - MachineScheduler: Improve debug messages

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 23 14:27:39 PDT 2016


Author: matze
Date: Thu Jun 23 16:27:38 2016
New Revision: 273615

URL: http://llvm.org/viewvc/llvm-project?rev=273615&view=rev
Log:
MachineScheduler: Improve debug messages

Consistenly display available and pending queues immediately before the
scheduling choice is done.

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=273615&r1=273614&r2=273615&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineScheduler.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineScheduler.cpp Thu Jun 23 16:27:38 2016
@@ -2258,6 +2258,10 @@ SUnit *SchedBoundary::pickOnlyChoice() {
     bumpCycle(CurrCycle + 1);
     releasePending();
   }
+
+  DEBUG(Pending.dump());
+  DEBUG(Available.dump());
+
   if (Available.size() == 1)
     return *Available.begin();
   return nullptr;
@@ -2886,13 +2890,10 @@ void GenericScheduler::tryCandidate(Sche
 void GenericScheduler::pickNodeFromQueue(SchedBoundary &Zone,
                                          const RegPressureTracker &RPTracker,
                                          SchedCandidate &Cand) {
-  ReadyQueue &Q = Zone.Available;
-
-  DEBUG(Q.dump());
-
   // getMaxPressureDelta temporarily modifies the tracker.
   RegPressureTracker &TempTracker = const_cast<RegPressureTracker&>(RPTracker);
 
+  ReadyQueue &Q = Zone.Available;
   for (ReadyQueue::iterator I = Q.begin(), E = Q.end(); I != E; ++I) {
 
     SchedCandidate TryCand(Cand.Policy);
@@ -2933,6 +2934,7 @@ SUnit *GenericScheduler::pickNodeBidirec
   setPolicy(TopCand.Policy, /*IsPostRA=*/false, Top, &Bot);
 
   // Prefer bottom scheduling when heuristics are silent.
+  DEBUG(dbgs() << "Picking from Bot:\n");
   pickNodeFromQueue(Bot, DAG->getBotRPTracker(), BotCand);
   assert(BotCand.Reason != NoCand && "failed to find the first candidate");
 
@@ -2951,6 +2953,7 @@ SUnit *GenericScheduler::pickNodeBidirec
     return BotCand.SU;
   }
   // Check if the top Q has a better candidate.
+  DEBUG(dbgs() << "Picking from Top:\n");
   pickNodeFromQueue(Top, DAG->getTopRPTracker(), TopCand);
   assert(TopCand.Reason != NoCand && "failed to find the first candidate");
 
@@ -3160,9 +3163,6 @@ void PostGenericScheduler::tryCandidate(
 
 void PostGenericScheduler::pickNodeFromQueue(SchedCandidate &Cand) {
   ReadyQueue &Q = Top.Available;
-
-  DEBUG(Q.dump());
-
   for (ReadyQueue::iterator I = Q.begin(), E = Q.end(); I != E; ++I) {
     SchedCandidate TryCand(Cand.Policy);
     TryCand.SU = *I;




More information about the llvm-commits mailing list