diff options
author | Dan Gohman <gohman@apple.com> | 2008-11-18 00:38:59 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-11-18 00:38:59 +0000 |
commit | 2d093f356007979e2e071725a98894a36c3625e0 (patch) | |
tree | a4497d6de68dcae4522b6cacf796eee2dc978f53 /lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp | |
parent | cd40233429fce385ae4b22301ce705273a6951a1 (diff) |
Avoid using a loop in ReleasePred and ReleaseSucc methods to compute the
new CycleBound value. Instead, just update CycleBound on each call.
Also, make ReleasePred and ReleaseSucc methods more consistent accross
the various schedulers.
This also happens to make ScheduleDAGRRList's CycleBound computation
somewhat more interesting, though it still doesn't have any noticeable
effect, because no current targets that use the register-pressure
reduction scheduler provide pipeline models.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59475 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp index 5037f67c5e..c839eeb2c7 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp @@ -88,7 +88,7 @@ public: bool RemovePred(SUnit *M, SUnit *N, bool isCtrl, bool isSpecial); private: - void ReleasePred(SUnit*, bool, unsigned); + void ReleasePred(SUnit *SU, SUnit *PredSU, bool isChain); void ScheduleNodeBottomUp(SUnit*, unsigned); SUnit *CopyAndMoveSuccessors(SUnit*); void InsertCCCopiesAndMoveSuccs(SUnit*, unsigned, @@ -137,13 +137,12 @@ void ScheduleDAGFast::Schedule() { /// ReleasePred - Decrement the NumSuccsLeft count of a predecessor. Add it to /// the AvailableQueue if the count reaches zero. Also update its cycle bound. -void ScheduleDAGFast::ReleasePred(SUnit *PredSU, bool isChain, - unsigned CurCycle) { +void ScheduleDAGFast::ReleasePred(SUnit *SU, SUnit *PredSU, bool isChain) { --PredSU->NumSuccsLeft; #ifndef NDEBUG if (PredSU->NumSuccsLeft < 0) { - cerr << "*** List scheduling failed! ***\n"; + cerr << "*** Scheduling failed! ***\n"; PredSU->dump(DAG); cerr << " has been released too many times!\n"; assert(0); @@ -167,7 +166,7 @@ void ScheduleDAGFast::ScheduleNodeBottomUp(SUnit *SU, unsigned CurCycle) { // Bottom up: release predecessors for (SUnit::pred_iterator I = SU->Preds.begin(), E = SU->Preds.end(); I != E; ++I) { - ReleasePred(I->Dep, I->isCtrl, CurCycle); + ReleasePred(SU, I->Dep, I->isCtrl); if (I->Cost < 0) { // This is a physical register dependency and it's impossible or // expensive to copy the register. Make sure nothing that can |