forked from OSchip/llvm-project
AMDGPU/SI: Fix Depth and Height computation for SI scheduler
Patch by: Axel Davy Differential Revision: https://reviews.llvm.org/D34967 llvm-svn: 309028
This commit is contained in:
parent
e6f74384b1
commit
6096f542d1
|
@ -1422,8 +1422,8 @@ void SIScheduleBlockCreator::fillStats() {
|
|||
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;
|
||||
}
|
||||
|
@ -1437,7 +1437,7 @@ void SIScheduleBlockCreator::fillStats() {
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue