diff options
author | Dan Gohman <gohman@apple.com> | 2008-11-17 19:45:19 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-11-17 19:45:19 +0000 |
commit | 2dcca9d53ec9359c554e05a38a7a5eed695b2a86 (patch) | |
tree | dba2d949b350ee6ae43ed3131aded50339dc05d5 /lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp | |
parent | 3d631c2d5deeb3e9a593fef70fdf609d28f5add7 (diff) | |
download | external_llvm-2dcca9d53ec9359c554e05a38a7a5eed695b2a86.zip external_llvm-2dcca9d53ec9359c554e05a38a7a5eed695b2a86.tar.gz external_llvm-2dcca9d53ec9359c554e05a38a7a5eed695b2a86.tar.bz2 |
Use SUnit's CycleBound field instead of duplicating it in
a side-car datastructure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59458 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp index f22812f..901a2a8 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp @@ -55,9 +55,8 @@ private: /// 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 @@ void ScheduleDAGList::ReleaseSucc(SUnit *SuccSU, bool isChain) { 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 @@ void ScheduleDAGList::ListScheduleTopDown() { // 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?"); } } |