diff options
author | Dan Gohman <gohman@apple.com> | 2008-12-09 22:54:47 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-12-09 22:54:47 +0000 |
commit | 2d170896ee45030a5de0aa150c6629945f367e29 (patch) | |
tree | 4a821901cfb637e4532b278062611b2ad7f07e93 /llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp | |
parent | 0318b56f0ea438611d211a98319347ddc5c0d82d (diff) | |
download | bcm5719-llvm-2d170896ee45030a5de0aa150c6629945f367e29.tar.gz bcm5719-llvm-2d170896ee45030a5de0aa150c6629945f367e29.zip |
Rewrite the SDep class, and simplify some of the related code.
The Cost field is removed. It was only being used in a very limited way,
to indicate when the scheduler should attempt to protect a live register,
and it isn't really needed to do that. If we ever want the scheduler to
start inserting copies in non-prohibitive situations, we'll have to
rethink some things anyway.
A Latency field is added. Instead of giving each node a single
fixed latency, each edge can have its own latency. This will eventually
be used to model various micro-architecture properties more accurately.
The PointerIntPair class and an internal union are now used, which
reduce the overall size.
llvm-svn: 60806
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp index d4acf5fa5fe..b01700e37c5 100644 --- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp @@ -78,7 +78,7 @@ public: void Schedule(); private: - void ReleaseSucc(SUnit *SU, SUnit *SuccSU, bool isChain); + void ReleaseSucc(SUnit *SU, const SDep &D); void ScheduleNodeTopDown(SUnit *SU, unsigned CurCycle); void ListScheduleTopDown(); }; @@ -107,7 +107,8 @@ void ScheduleDAGList::Schedule() { /// ReleaseSucc - Decrement the NumPredsLeft count of a successor. Add it to /// the PendingQueue if the count reaches zero. Also update its cycle bound. -void ScheduleDAGList::ReleaseSucc(SUnit *SU, SUnit *SuccSU, bool isChain) { +void ScheduleDAGList::ReleaseSucc(SUnit *SU, const SDep &D) { + SUnit *SuccSU = D.getSUnit(); --SuccSU->NumPredsLeft; #ifndef NDEBUG @@ -121,14 +122,7 @@ void ScheduleDAGList::ReleaseSucc(SUnit *SU, SUnit *SuccSU, bool isChain) { // Compute the cycle when this SUnit actually becomes available. This // is the max of the start time of all predecessors plus their latencies. - // If this is a token edge, we don't need to wait for the latency of the - // preceeding instruction (e.g. a long-latency load) unless there is also - // some other data dependence. - unsigned PredDoneCycle = SU->Cycle; - if (!isChain) - PredDoneCycle += SU->Latency; - else if (SU->Latency) - PredDoneCycle += 1; + unsigned PredDoneCycle = SU->Cycle + SU->Latency; SuccSU->CycleBound = std::max(SuccSU->CycleBound, PredDoneCycle); if (SuccSU->NumPredsLeft == 0) { @@ -149,7 +143,7 @@ void ScheduleDAGList::ScheduleNodeTopDown(SUnit *SU, unsigned CurCycle) { // Top down: release successors. for (SUnit::succ_iterator I = SU->Succs.begin(), E = SU->Succs.end(); I != E; ++I) - ReleaseSucc(SU, I->Dep, I->isCtrl); + ReleaseSucc(SU, *I); SU->isScheduled = true; AvailableQueue->ScheduledNode(SU); |