[llvm-commits] [llvm] r59458 - /llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp

Dan Gohman gohman at apple.com
Mon Nov 17 11:45:20 PST 2008


Author: djg
Date: Mon Nov 17 13:45:19 2008
New Revision: 59458

URL: http://llvm.org/viewvc/llvm-project?rev=59458&view=rev
Log:
Use SUnit's CycleBound field instead of duplicating it in
a side-car datastructure

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp

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

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp Mon Nov 17 13:45:19 2008
@@ -55,9 +55,8 @@
   /// PendingQueue - This contains all of the instructions whose operands have
   /// been issued, but their results are not ready yet (due to the latency of
   /// the operation).  Once the operands becomes available, the instruction is
-  /// added to the AvailableQueue.  This keeps track of each SUnit and the
-  /// number of cycles left to execute before the operation is available.
-  std::vector<std::pair<unsigned, SUnit*> > PendingQueue;
+  /// added to the AvailableQueue.
+  std::vector<SUnit*> PendingQueue;
 
   /// HazardRec - The hazard recognizer to use.
   HazardRecognizer *HazardRec;
@@ -134,7 +133,9 @@
       AvailableCycle = std::max(AvailableCycle, PredDoneCycle);
     }
     
-    PendingQueue.push_back(std::make_pair(AvailableCycle, SuccSU));
+    assert(SuccSU->CycleBound == 0 && "CycleBound already assigned!");
+    SuccSU->CycleBound = AvailableCycle;
+    PendingQueue.push_back(SuccSU);
   }
 }
 
@@ -176,14 +177,14 @@
     // Check to see if any of the pending instructions are ready to issue.  If
     // so, add them to the available queue.
     for (unsigned i = 0, e = PendingQueue.size(); i != e; ++i) {
-      if (PendingQueue[i].first == CurCycle) {
-        AvailableQueue->push(PendingQueue[i].second);
-        PendingQueue[i].second->isAvailable = true;
+      if (PendingQueue[i]->CycleBound == CurCycle) {
+        AvailableQueue->push(PendingQueue[i]);
+        PendingQueue[i]->isAvailable = true;
         PendingQueue[i] = PendingQueue.back();
         PendingQueue.pop_back();
         --i; --e;
       } else {
-        assert(PendingQueue[i].first > CurCycle && "Negative latency?");
+        assert(PendingQueue[i]->CycleBound > CurCycle && "Negative latency?");
       }
     }
     





More information about the llvm-commits mailing list