Patch by: Axel Davy
Differential Revision: https://reviews.llvm.org/D34967
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309028
91177308-0d34-0410-b5e6-
96231b3b80d8
else {
unsigned Depth = 0;
for (SIScheduleBlock *Pred : Block->getPreds()) {
- if (Depth < Pred->Depth + 1)
- Depth = Pred->Depth + 1;
+ if (Depth < Pred->Depth + Pred->getCost())
+ Depth = Pred->Depth + Pred->getCost();
}
Block->Depth = Depth;
}
else {
unsigned Height = 0;
for (const auto &Succ : Block->getSuccs())
- Height = std::min(Height, Succ.first->Height + 1);
+ Height = std::max(Height, Succ.first->Height + Succ.first->getCost());
Block->Height = Height;
}
}