1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Fix the scheduler's MaxObservedStall computation.

WenHan Gu pointed out this bug that results in an assert
not being effective in some cases.

llvm-svn: 210846
This commit is contained in:
Andrew Trick 2014-06-12 22:36:28 +00:00
parent 429be5d609
commit e967f1bca1

View File

@ -691,7 +691,7 @@ void ScheduleDAGMI::schedule() {
}
}
// Notify the scheduling strategy before updating the DAG.
// This sets the scheduled nodes ReadyCycle to CurrCycle. When updateQueues
// This sets the scheduled node's ReadyCycle to CurrCycle. When updateQueues
// runs, it can then use the accurate ReadyCycle time to determine whether
// newly released nodes can move to the readyQ.
SchedImpl->schedNode(SU, IsTopNode);
@ -1747,6 +1747,10 @@ void SchedBoundary::releaseNode(SUnit *SU, unsigned ReadyCycle) {
assert(SU->getInstr() && "Scheduled SUnit must have instr");
#ifndef NDEBUG
// ReadyCycle was been bumped up to the CurrCycle when this node was
// scheduled, but CurrCycle may have been eagerly advanced immediately after
// scheduling, so may now be greater than ReadyCycle.
if (ReadyCycle > CurrCycle)
MaxObservedStall = std::max(ReadyCycle - CurrCycle, MaxObservedStall);
#endif