Change SUnit's dump method to take a ScheduleDAG* instead of
authorDan Gohman <gohman@apple.com>
Tue, 18 Nov 2008 02:06:40 +0000 (02:06 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 18 Nov 2008 02:06:40 +0000 (02:06 +0000)
a SelectionDAG*.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59488 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/ScheduleDAG.h
lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp
lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp

index 40945853680262612535e7e03ed8b4bcf4683d78..e90bceb7be50f656df299c28f8adcd97ad7fd9ba 100644 (file)
@@ -29,6 +29,7 @@ namespace llvm {
   class MachineRegisterInfo;
   class MachineInstr;
   class TargetRegisterInfo;
+  class ScheduleDAG;
   class SelectionDAG;
   class SelectionDAGISel;
   class TargetInstrInfo;
@@ -239,8 +240,8 @@ namespace llvm {
       return false;
     }
     
-    void dump(const SelectionDAG *G) const;
-    void dumpAll(const SelectionDAG *G) const;
+    void dump(const ScheduleDAG *G) const;
+    void dumpAll(const ScheduleDAG *G) const;
   };
 
   //===--------------------------------------------------------------------===//
index 3fb25159ea89c09093d82d5fae858f50d33502aa..ac7f6b9f56f4f02fa9eaf37876027af4c1e937b8 100644 (file)
@@ -440,7 +440,7 @@ unsigned ScheduleDAG::ComputeMemOperandsEnd(SDNode *Node) {
 void ScheduleDAG::dumpSchedule() const {
   for (unsigned i = 0, e = Sequence.size(); i != e; i++) {
     if (SUnit *SU = Sequence[i])
-      SU->dump(DAG);
+      SU->dump(this);
     else
       cerr << "**** NOOP ****\n";
   }
@@ -459,10 +459,10 @@ void ScheduleDAG::Run() {
 
 /// SUnit - Scheduling unit. It's an wrapper around either a single SDNode or
 /// a group of nodes flagged together.
-void SUnit::dump(const SelectionDAG *G) const {
+void SUnit::dump(const ScheduleDAG *G) const {
   cerr << "SU(" << NodeNum << "): ";
   if (getNode())
-    getNode()->dump(G);
+    getNode()->dump(G->DAG);
   else
     cerr << "CROSS RC COPY ";
   cerr << "\n";
@@ -471,13 +471,13 @@ void SUnit::dump(const SelectionDAG *G) const {
     FlaggedNodes.push_back(N);
   while (!FlaggedNodes.empty()) {
     cerr << "    ";
-    FlaggedNodes.back()->dump(G);
+    FlaggedNodes.back()->dump(G->DAG);
     cerr << "\n";
     FlaggedNodes.pop_back();
   }
 }
 
-void SUnit::dumpAll(const SelectionDAG *G) const {
+void SUnit::dumpAll(const ScheduleDAG *G) const {
   dump(G);
 
   cerr << "  # preds left       : " << NumPredsLeft << "\n";
index c839eeb2c72b194608d7ac4ef0265c933d03d23d..def8868da95460b3232cddd09846836ab7c24e70 100644 (file)
@@ -125,7 +125,7 @@ void ScheduleDAGFast::Schedule() {
   BuildSchedUnits();
 
   DEBUG(for (unsigned su = 0, e = SUnits.size(); su != e; ++su)
-          SUnits[su].dumpAll(DAG));
+          SUnits[su].dumpAll(this));
 
   // Execute the actual scheduling loop.
   ListScheduleBottomUp();
@@ -143,7 +143,7 @@ void ScheduleDAGFast::ReleasePred(SUnit *SU, SUnit *PredSU, bool isChain) {
 #ifndef NDEBUG
   if (PredSU->NumSuccsLeft < 0) {
     cerr << "*** Scheduling failed! ***\n";
-    PredSU->dump(DAG);
+    PredSU->dump(this);
     cerr << " has been released too many times!\n";
     assert(0);
   }
@@ -160,7 +160,7 @@ void ScheduleDAGFast::ReleasePred(SUnit *SU, SUnit *PredSU, bool isChain) {
 /// the Available queue.
 void ScheduleDAGFast::ScheduleNodeBottomUp(SUnit *SU, unsigned CurCycle) {
   DOUT << "*** Scheduling [" << CurCycle << "]: ";
-  DEBUG(SU->dump(DAG));
+  DEBUG(SU->dump(this));
   SU->Cycle = CurCycle;
 
   // Bottom up: release predecessors
@@ -613,14 +613,14 @@ void ScheduleDAGFast::ListScheduleBottomUp() {
       }
       if (!AnyNotSched)
         cerr << "*** List scheduling failed! ***\n";
-      SUnits[i].dump(DAG);
+      SUnits[i].dump(this);
       cerr << "has not been scheduled!\n";
       AnyNotSched = true;
     }
     if (SUnits[i].NumSuccsLeft != 0) {
       if (!AnyNotSched)
         cerr << "*** List scheduling failed! ***\n";
-      SUnits[i].dump(DAG);
+      SUnits[i].dump(this);
       cerr << "has successors left!\n";
       AnyNotSched = true;
     }
index 1bce96727dd900a48df1ccbc43b224ccccb9ad83..e7e14516eb7383287ef2c0794393ee3aaea6e01f 100644 (file)
@@ -113,7 +113,7 @@ void ScheduleDAGList::ReleaseSucc(SUnit *SU, SUnit *SuccSU, bool isChain) {
 #ifndef NDEBUG
   if (SuccSU->NumPredsLeft < 0) {
     cerr << "*** Scheduling failed! ***\n";
-    SuccSU->dump(DAG);
+    SuccSU->dump(this);
     cerr << " has been released too many times!\n";
     assert(0);
   }
@@ -142,7 +142,7 @@ void ScheduleDAGList::ReleaseSucc(SUnit *SU, SUnit *SuccSU, bool isChain) {
 /// the Available queue.
 void ScheduleDAGList::ScheduleNodeTopDown(SUnit *SU, unsigned CurCycle) {
   DOUT << "*** Scheduling [" << CurCycle << "]: ";
-  DEBUG(SU->dump(DAG));
+  DEBUG(SU->dump(this));
   
   Sequence.push_back(SU);
   SU->Cycle = CurCycle;
@@ -267,7 +267,7 @@ void ScheduleDAGList::ListScheduleTopDown() {
     if (SUnits[i].NumPredsLeft != 0) {
       if (!AnyNotSched)
         cerr << "*** List scheduling failed! ***\n";
-      SUnits[i].dump(DAG);
+      SUnits[i].dump(this);
       cerr << "has not been scheduled!\n";
       AnyNotSched = true;
     }
index 77ee6bd7e1e1e040a4baaf3b2ae8b1c8df8ce321..7cec092c0219ba16ff3791f38fe4914017cc4405 100644 (file)
@@ -186,7 +186,7 @@ void ScheduleDAGRRList::Schedule() {
   BuildSchedUnits();
 
   DEBUG(for (unsigned su = 0, e = SUnits.size(); su != e; ++su)
-          SUnits[su].dumpAll(DAG));
+          SUnits[su].dumpAll(this));
   if (!Fast) {
     CalculateDepths();
     CalculateHeights();
@@ -271,7 +271,7 @@ void ScheduleDAGRRList::ReleasePred(SUnit *SU, SUnit *PredSU, bool isChain) {
 #ifndef NDEBUG
   if (PredSU->NumSuccsLeft < 0) {
     cerr << "*** Scheduling failed! ***\n";
-    PredSU->dump(DAG);
+    PredSU->dump(this);
     cerr << " has been released too many times!\n";
     assert(0);
   }
@@ -301,7 +301,7 @@ void ScheduleDAGRRList::ReleasePred(SUnit *SU, SUnit *PredSU, bool isChain) {
 /// the Available queue.
 void ScheduleDAGRRList::ScheduleNodeBottomUp(SUnit *SU, unsigned CurCycle) {
   DOUT << "*** Scheduling [" << CurCycle << "]: ";
-  DEBUG(SU->dump(DAG));
+  DEBUG(SU->dump(this));
   SU->Cycle = CurCycle;
 
   AvailableQueue->ScheduledNode(SU);
@@ -368,7 +368,7 @@ void ScheduleDAGRRList::CapturePred(SUnit *PredSU, SUnit *SU, bool isChain) {
 /// its predecessor states to reflect the change.
 void ScheduleDAGRRList::UnscheduleNodeBottomUp(SUnit *SU) {
   DOUT << "*** Unscheduling [" << SU->Cycle << "]: ";
-  DEBUG(SU->dump(DAG));
+  DEBUG(SU->dump(this));
 
   AvailableQueue->UnscheduledNode(SU);
 
@@ -1084,14 +1084,14 @@ void ScheduleDAGRRList::ListScheduleBottomUp() {
       }
       if (!AnyNotSched)
         cerr << "*** List scheduling failed! ***\n";
-      SUnits[i].dump(DAG);
+      SUnits[i].dump(this);
       cerr << "has not been scheduled!\n";
       AnyNotSched = true;
     }
     if (SUnits[i].NumSuccsLeft != 0) {
       if (!AnyNotSched)
         cerr << "*** List scheduling failed! ***\n";
-      SUnits[i].dump(DAG);
+      SUnits[i].dump(this);
       cerr << "has successors left!\n";
       AnyNotSched = true;
     }
@@ -1117,7 +1117,7 @@ void ScheduleDAGRRList::ReleaseSucc(SUnit *SU, SUnit *SuccSU, bool isChain) {
 #ifndef NDEBUG
   if (SuccSU->NumPredsLeft < 0) {
     cerr << "*** Scheduling failed! ***\n";
-    SuccSU->dump(DAG);
+    SuccSU->dump(this);
     cerr << " has been released too many times!\n";
     assert(0);
   }
@@ -1148,7 +1148,7 @@ void ScheduleDAGRRList::ReleaseSucc(SUnit *SU, SUnit *SuccSU, bool isChain) {
 /// the Available queue.
 void ScheduleDAGRRList::ScheduleNodeTopDown(SUnit *SU, unsigned CurCycle) {
   DOUT << "*** Scheduling [" << CurCycle << "]: ";
-  DEBUG(SU->dump(DAG));
+  DEBUG(SU->dump(this));
 
   SU->Cycle = CurCycle;
   Sequence.push_back(SU);
@@ -1213,14 +1213,14 @@ void ScheduleDAGRRList::ListScheduleTopDown() {
       }
       if (!AnyNotSched)
         cerr << "*** List scheduling failed! ***\n";
-      SUnits[i].dump(DAG);
+      SUnits[i].dump(this);
       cerr << "has not been scheduled!\n";
       AnyNotSched = true;
     }
     if (SUnits[i].NumPredsLeft != 0) {
       if (!AnyNotSched)
         cerr << "*** List scheduling failed! ***\n";
-      SUnits[i].dump(DAG);
+      SUnits[i].dump(this);
       cerr << "has predecessors left!\n";
       AnyNotSched = true;
     }