diff options
author | Andrew Trick <atrick@apple.com> | 2014-06-12 22:36:28 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2014-06-12 22:36:28 +0000 |
commit | 491e34a13936940df420e6d1b5308626283bd4cc (patch) | |
tree | f6fb088c030eda8bb9f5a30b4b64a698948218e3 /llvm/lib/CodeGen/MachineScheduler.cpp | |
parent | f55a224920faf87507f38b5486fc74a8e8500daf (diff) | |
download | llvm-491e34a13936940df420e6d1b5308626283bd4cc.zip llvm-491e34a13936940df420e6d1b5308626283bd4cc.tar.gz llvm-491e34a13936940df420e6d1b5308626283bd4cc.tar.bz2 |
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
Diffstat (limited to 'llvm/lib/CodeGen/MachineScheduler.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineScheduler.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp index cbe937a..0baf2a6 100644 --- a/llvm/lib/CodeGen/MachineScheduler.cpp +++ b/llvm/lib/CodeGen/MachineScheduler.cpp @@ -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,7 +1747,11 @@ void SchedBoundary::releaseNode(SUnit *SU, unsigned ReadyCycle) { assert(SU->getInstr() && "Scheduled SUnit must have instr"); #ifndef NDEBUG - MaxObservedStall = std::max(ReadyCycle - CurrCycle, MaxObservedStall); + // 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 if (ReadyCycle < MinReadyCycle) |