aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-05-13 08:22:24 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-05-13 08:22:24 +0000
commit8820ad5154eae194a685a8735bd5999221fdffd0 (patch)
treefe551e00d9c4bfd65fa8923b69ba5ae487fd6a9c /lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
parentee00a1d12c631eb7360ddd4809bdde72331b2736 (diff)
Fixing 2006-05-01-SchedCausingSpills.ll; some clean up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28279 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/ScheduleDAG.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/ScheduleDAG.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
index 5100f3a3dc..3fab99e372 100644
--- a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
@@ -171,26 +171,26 @@ void ScheduleDAG::BuildSchedUnits() {
return;
}
-static void CalculateDepths(SUnit *SU, unsigned Depth, unsigned Max) {
- if (Depth > SU->Depth) {
+static void CalculateDepths(SUnit *SU, unsigned Depth) {
+ if (SU->Depth == 0 || Depth > SU->Depth) {
SU->Depth = Depth;
for (std::set<std::pair<SUnit*, bool> >::iterator I = SU->Succs.begin(),
E = SU->Succs.end(); I != E; ++I)
- CalculateDepths(I->first, Depth+1, Max);
+ CalculateDepths(I->first, Depth+1);
}
}
void ScheduleDAG::CalculateDepths() {
SUnit *Entry = SUnitMap[DAG.getEntryNode().Val];
- ::CalculateDepths(Entry, 0U, SUnits.size());
+ ::CalculateDepths(Entry, 0U);
for (unsigned i = 0, e = SUnits.size(); i != e; ++i)
if (SUnits[i].Preds.size() == 0 && &SUnits[i] != Entry) {
- ::CalculateDepths(&SUnits[i], 0U, SUnits.size());
+ ::CalculateDepths(&SUnits[i], 0U);
}
}
static void CalculateHeights(SUnit *SU, unsigned Height) {
- if (Height > SU->Height) {
+ if (SU->Height == 0 || Height > SU->Height) {
SU->Height = Height;
for (std::set<std::pair<SUnit*, bool> >::iterator I = SU->Preds.begin(),
E = SU->Preds.end(); I != E; ++I)