diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-09-28 19:37:35 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-09-28 19:37:35 +0000 |
commit | f72693f36e80c65dc7b45c8f0e54a1a44c687025 (patch) | |
tree | 1485ed0e98c9b293598ef5eb029f26ef9b1e264c | |
parent | 038dcc51363738025ed3e084d84eef5827ae129f (diff) | |
download | bcm5719-llvm-f72693f36e80c65dc7b45c8f0e54a1a44c687025.tar.gz bcm5719-llvm-f72693f36e80c65dc7b45c8f0e54a1a44c687025.zip |
Remove a poor scheduling heuristic.
llvm-svn: 42443
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp | 39 |
1 files changed, 5 insertions, 34 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp index db5ee24e3e3..92dbb7cfd0d 100644 --- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp @@ -1071,26 +1071,6 @@ static unsigned closestSucc(const SUnit *SU) { return MaxCycle; } -/// 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". -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) { - if (I->isCtrl) continue; // ignore chain preds - if (!I->Dep->Node || I->Dep->Node->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->Dep->Node || I->Dep->Node->getOpcode() != ISD::CopyToReg) - Scratches += 10; - } - return Scratches; -} - // Bottom up bool bu_ls_rr_sort::operator()(const SUnit *left, const SUnit *right) const { // There used to be a special tie breaker here that looked for @@ -1133,23 +1113,14 @@ bool bu_ls_rr_sort::operator()(const SUnit *left, const SUnit *right) const { if (LDist < RDist) return true; else if (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. - unsigned LScratch = calcMaxScratches(left); - unsigned RScratch = calcMaxScratches(right); - if (LScratch > RScratch) + if (left->Height > right->Height) return true; - else if (LScratch == RScratch) - if (left->Height > right->Height) + else if (left->Height == right->Height) + if (left->Depth < right->Depth) return true; - else if (left->Height == right->Height) - if (left->Depth < right->Depth) + else if (left->Depth == right->Depth) + if (left->CycleBound > right->CycleBound) return true; - else if (left->Depth == right->Depth) - if (left->CycleBound > right->CycleBound) - return true; } } return false; |