diff options
author | Andrew Trick <atrick@apple.com> | 2014-07-01 03:23:13 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2014-07-01 03:23:13 +0000 |
commit | f1b307bcb0f27eeb2cfabfe56c30b9982a4af998 (patch) | |
tree | 8cb363fe7862d22d38e2005378f8cbc7a8b37e30 /llvm/lib/CodeGen/MachineScheduler.cpp | |
parent | 60c88cbf7fb90ed98caa2c920c01b38f31a3734e (diff) | |
download | llvm-f1b307bcb0f27eeb2cfabfe56c30b9982a4af998.zip llvm-f1b307bcb0f27eeb2cfabfe56c30b9982a4af998.tar.gz llvm-f1b307bcb0f27eeb2cfabfe56c30b9982a4af998.tar.bz2 |
MachineScheduler: better book-keeping for asserts.
Fixes another test case under PR20057.
llvm-svn: 212088
Diffstat (limited to 'llvm/lib/CodeGen/MachineScheduler.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineScheduler.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp index 8365330..5b5b3f3 100644 --- a/llvm/lib/CodeGen/MachineScheduler.cpp +++ b/llvm/lib/CodeGen/MachineScheduler.cpp @@ -1690,7 +1690,7 @@ bool SchedBoundary::checkHazard(SUnit *SU) { unsigned NRCycle = getNextResourceCycle(PI->ProcResourceIdx, PI->Cycles); if (NRCycle > CurrCycle) { #ifndef NDEBUG - MaxObservedStall = std::max(NRCycle - CurrCycle, MaxObservedStall); + MaxObservedStall = std::max(PI->Cycles, MaxObservedStall); #endif DEBUG(dbgs() << " SU(" << SU->NodeNum << ") " << SchedModel->getResourceName(PI->ProcResourceIdx) @@ -1954,10 +1954,12 @@ void SchedBoundary::bumpNode(SUnit *SU) { PE = SchedModel->getWriteProcResEnd(SC); PI != PE; ++PI) { unsigned PIdx = PI->ProcResourceIdx; if (SchedModel->getProcResource(PIdx)->BufferSize == 0) { - ReservedCycles[PIdx] = isTop() ? NextCycle + PI->Cycles : NextCycle; -#ifndef NDEBUG - MaxObservedStall = std::max(PI->Cycles, MaxObservedStall); -#endif + if (isTop()) { + ReservedCycles[PIdx] = + std::max(getNextResourceCycle(PIdx, 0), NextCycle + PI->Cycles); + } + else + ReservedCycles[PIdx] = NextCycle; } } } |