diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2009-02-12 08:59:45 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2009-02-12 08:59:45 +0000 |
| commit | 3a14efacb69a0de38f90fd6cb0fa4162b8d438e8 (patch) | |
| tree | 09c695e8e0de470d14290db0040fe4e99a0f737f /llvm/lib/CodeGen | |
| parent | eef883327a4a029ffc4717a6730d30fce002afe4 (diff) | |
| download | bcm5719-llvm-3a14efacb69a0de38f90fd6cb0fa4162b8d438e8.tar.gz bcm5719-llvm-3a14efacb69a0de38f90fd6cb0fa4162b8d438e8.zip | |
Replace one of burr scheduling heuristic with something more sensible. Now calcMaxScratches simply compute the number of true data dependencies. This actually improve a couple of tests in dejagnu suite as many tests in llvm nightly test suite.
llvm-svn: 64369
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp index a0652a72c94..912e8ed7f7c 100644 --- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp @@ -916,7 +916,7 @@ CalcNodeSethiUllmanNumber(const SUnit *SU, std::vector<unsigned> &SUNumbers) { if (PredSethiUllman > SethiUllmanNumber) { SethiUllmanNumber = PredSethiUllman; Extra = 0; - } else if (PredSethiUllman == SethiUllmanNumber && !I->isCtrl()) + } else if (PredSethiUllman == SethiUllmanNumber) ++Extra; } @@ -1070,24 +1070,13 @@ static unsigned closestSucc(const SUnit *SU) { } /// calcMaxScratches - Returns an cost estimate of the worse case requirement -/// for scratch registers. Live-in operands and live-out results don't count -/// since they are "fixed". +/// for scratch registers, i.e. number of data dependencies. static unsigned calcMaxScratches(const SUnit *SU) { unsigned Scratches = 0; for (SUnit::const_pred_iterator I = SU->Preds.begin(), E = SU->Preds.end(); - I != E; ++I) { + I != E; ++I) if (I->isCtrl()) continue; // ignore chain preds - if (!I->getSUnit()->getNode() || - I->getSUnit()->getNode()->getOpcode() != ISD::CopyFromReg) Scratches++; - } - for (SUnit::const_succ_iterator I = SU->Succs.begin(), E = SU->Succs.end(); - I != E; ++I) { - if (I->isCtrl()) continue; // ignore chain succs - if (!I->getSUnit()->getNode() || - I->getSUnit()->getNode()->getOpcode() != ISD::CopyToReg) - Scratches += 10; - } return Scratches; } @@ -1120,10 +1109,7 @@ bool bu_ls_rr_sort::operator()(const SUnit *left, const SUnit *right) const { if (LDist != RDist) return LDist < RDist; - // Intuitively, it's good to push down instructions whose results are - // liveout so their long live ranges won't conflict with other values - // which are needed inside the BB. Further prioritize liveout instructions - // by the number of operands which are calculated within the BB. + // How many registers becomes live when the node is scheduled. unsigned LScratch = calcMaxScratches(left); unsigned RScratch = calcMaxScratches(right); if (LScratch != RScratch) |

