[llvm-commits] [llvm] r42442 - in /llvm/trunk: include/llvm/CodeGen/ScheduleDAG.h lib/CodeGen/SelectionDAG/ScheduleDAG.cpp lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp

Evan Cheng evan.cheng at apple.com
Fri Sep 28 12:24:24 PDT 2007


Author: evancheng
Date: Fri Sep 28 14:24:24 2007
New Revision: 42442

URL: http://llvm.org/viewvc/llvm-project?rev=42442&view=rev
Log:
Trim some unneeded fields.

Modified:
    llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h
    llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
    llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
    llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp

Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h?rev=42442&r1=42441&r2=42442&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h (original)
+++ llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h Fri Sep 28 14:24:24 2007
@@ -113,8 +113,6 @@
     short NumSuccs;                     // # of sucss.
     short NumPredsLeft;                 // # of preds not scheduled.
     short NumSuccsLeft;                 // # of succs not scheduled.
-    short NumChainPredsLeft;            // # of chain preds not scheduled.
-    short NumChainSuccsLeft;            // # of chain succs not scheduled.
     bool isTwoAddress     : 1;          // Is a two-address instruction.
     bool isCommutable     : 1;          // Is a commutable instruction.
     bool hasImplicitDefs  : 1;          // Has implicit physical reg defs.
@@ -131,7 +129,6 @@
     SUnit(SDNode *node, unsigned nodenum)
       : Node(node), InstanceNo(0), NodeNum(nodenum), Latency(0),
         NumPreds(0), NumSuccs(0), NumPredsLeft(0), NumSuccsLeft(0),
-        NumChainPredsLeft(0), NumChainSuccsLeft(0),
         isTwoAddress(false), isCommutable(false), hasImplicitDefs(false),
         isPending(false), isAvailable(false), isScheduled(false),
         CycleBound(0), Cycle(0), Depth(0), Height(0),
@@ -147,19 +144,14 @@
           return false;
       Preds.push_back(SDep(N, PhyReg, Cost, isCtrl, isSpecial));
       N->Succs.push_back(SDep(this, PhyReg, Cost, isCtrl, isSpecial));
-      if (isCtrl) {
-        if (!N->isScheduled)
-          ++NumChainPredsLeft;
-        if (!isScheduled)
-          ++N->NumChainSuccsLeft;
-      } else {
+      if (!isCtrl) {
         ++NumPreds;
         ++N->NumSuccs;
-        if (!N->isScheduled)
-          ++NumPredsLeft;
-        if (!isScheduled)
-          ++N->NumSuccsLeft;
       }
+      if (!N->isScheduled)
+        ++NumPredsLeft;
+      if (!isScheduled)
+        ++N->NumSuccsLeft;
       return true;
     }
 
@@ -178,19 +170,14 @@
             }
           assert(FoundSucc && "Mismatching preds / succs lists!");
           Preds.erase(I);
-          if (isCtrl) {
-            if (!N->isScheduled)
-              --NumChainPredsLeft;
-            if (!isScheduled)
-              --NumChainSuccsLeft;
-          } else {
+          if (!isCtrl) {
             --NumPreds;
             --N->NumSuccs;
-            if (!N->isScheduled)
-              --NumPredsLeft;
-            if (!isScheduled)
-              --N->NumSuccsLeft;
           }
+          if (!N->isScheduled)
+            --NumPredsLeft;
+          if (!isScheduled)
+            --N->NumSuccsLeft;
           return true;
         }
       return false;

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp?rev=42442&r1=42441&r2=42442&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Fri Sep 28 14:24:24 2007
@@ -941,8 +941,6 @@
 
   cerr << "  # preds left       : " << NumPredsLeft << "\n";
   cerr << "  # succs left       : " << NumSuccsLeft << "\n";
-  cerr << "  # chain preds left : " << NumChainPredsLeft << "\n";
-  cerr << "  # chain succs left : " << NumChainSuccsLeft << "\n";
   cerr << "  Latency            : " << Latency << "\n";
   cerr << "  Depth              : " << Depth << "\n";
   cerr << "  Height             : " << Height << "\n";

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp?rev=42442&r1=42441&r2=42442&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp Fri Sep 28 14:24:24 2007
@@ -116,15 +116,12 @@
 /// ReleaseSucc - Decrement the NumPredsLeft count of a successor. Add it to
 /// the PendingQueue if the count reaches zero.
 void ScheduleDAGList::ReleaseSucc(SUnit *SuccSU, bool isChain) {
-  if (!isChain)
-    SuccSU->NumPredsLeft--;
-  else
-    SuccSU->NumChainPredsLeft--;
+  SuccSU->NumPredsLeft--;
   
-  assert(SuccSU->NumPredsLeft >= 0 && SuccSU->NumChainPredsLeft >= 0 &&
+  assert(SuccSU->NumPredsLeft >= 0 &&
          "List scheduling internal error");
   
-  if ((SuccSU->NumPredsLeft + SuccSU->NumChainPredsLeft) == 0) {
+  if (SuccSU->NumPredsLeft == 0) {
     // Compute how many cycles it will be before this actually becomes
     // available.  This is the max of the start time of all predecessors plus
     // their latencies.
@@ -276,7 +273,7 @@
   // Verify that all SUnits were scheduled.
   bool AnyNotSched = false;
   for (unsigned i = 0, e = SUnits.size(); i != e; ++i) {
-    if (SUnits[i].NumPredsLeft != 0 || SUnits[i].NumChainPredsLeft != 0) {
+    if (SUnits[i].NumPredsLeft != 0) {
       if (!AnyNotSched)
         cerr << "*** List scheduling failed! ***\n";
       SUnits[i].dump(&DAG);

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=42442&r1=42441&r2=42442&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Fri Sep 28 14:24:24 2007
@@ -202,13 +202,10 @@
   // interrupt model (drain vs. freeze).
   PredSU->CycleBound = std::max(PredSU->CycleBound, CurCycle + PredSU->Latency);
 
-  if (!isChain)
-    --PredSU->NumSuccsLeft;
-  else
-    --PredSU->NumChainSuccsLeft;
+  --PredSU->NumSuccsLeft;
   
 #ifndef NDEBUG
-  if (PredSU->NumSuccsLeft < 0 || PredSU->NumChainSuccsLeft < 0) {
+  if (PredSU->NumSuccsLeft < 0) {
     cerr << "*** List scheduling failed! ***\n";
     PredSU->dump(&DAG);
     cerr << " has been released too many times!\n";
@@ -216,7 +213,7 @@
   }
 #endif
   
-  if ((PredSU->NumSuccsLeft + PredSU->NumChainSuccsLeft) == 0) {
+  if (PredSU->NumSuccsLeft == 0) {
     // EntryToken has to go last!  Special case it here.
     if (!PredSU->Node || PredSU->Node->getOpcode() != ISD::EntryToken) {
       PredSU->isAvailable = true;
@@ -287,10 +284,7 @@
       AvailableQueue->remove(PredSU);
   }
 
-  if (!isChain)
-    ++PredSU->NumSuccsLeft;
-  else
-    ++PredSU->NumChainSuccsLeft;
+  ++PredSU->NumSuccsLeft;
 }
 
 /// UnscheduleNodeBottomUp - Remove the node from the schedule, update its and
@@ -713,7 +707,7 @@
   // Verify that all SUnits were scheduled.
   bool AnyNotSched = false;
   for (unsigned i = 0, e = SUnits.size(); i != e; ++i) {
-    if (SUnits[i].NumSuccsLeft != 0 || SUnits[i].NumChainSuccsLeft != 0) {
+    if (SUnits[i].NumSuccsLeft != 0) {
       if (!AnyNotSched)
         cerr << "*** List scheduling failed! ***\n";
       SUnits[i].dump(&DAG);
@@ -739,13 +733,10 @@
   // interrupt model (drain vs. freeze).
   SuccSU->CycleBound = std::max(SuccSU->CycleBound, CurCycle + SuccSU->Latency);
 
-  if (!isChain)
-    --SuccSU->NumPredsLeft;
-  else
-    --SuccSU->NumChainPredsLeft;
+  --SuccSU->NumPredsLeft;
   
 #ifndef NDEBUG
-  if (SuccSU->NumPredsLeft < 0 || SuccSU->NumChainPredsLeft < 0) {
+  if (SuccSU->NumPredsLeft < 0) {
     cerr << "*** List scheduling failed! ***\n";
     SuccSU->dump(&DAG);
     cerr << " has been released too many times!\n";
@@ -753,7 +744,7 @@
   }
 #endif
   
-  if ((SuccSU->NumPredsLeft + SuccSU->NumChainPredsLeft) == 0) {
+  if (SuccSU->NumPredsLeft == 0) {
     SuccSU->isAvailable = true;
     AvailableQueue->push(SuccSU);
   }





More information about the llvm-commits mailing list