summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2014-06-27 04:57:05 +0000
committerAndrew Trick <atrick@apple.com>2014-06-27 04:57:05 +0000
commite8f8db1c5af2504f8d5100df44cf131e15d33002 (patch)
tree403ca9a9272f99a5c0f4f9c27672e53ceb20d1bd /lib
parent9fc1a6ffb71e88d3139ef9ad2ccbaddd80a18562 (diff)
downloadllvm-e8f8db1c5af2504f8d5100df44cf131e15d33002.tar.gz
llvm-e8f8db1c5af2504f8d5100df44cf131e15d33002.tar.bz2
llvm-e8f8db1c5af2504f8d5100df44cf131e15d33002.tar.xz
MachineScheduler: add some book-keeping to fix an assert.
Fixe for Bug 20057 - Assertion failied in llvm::SUnit* llvm::SchedBoundary::pickOnlyChoice(): Assertion `i <= (HazardRec->getMaxLookAhead() + MaxObservedStall) && "permanent hazard"' Thanks to Chad for the test case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211865 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/MachineScheduler.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/CodeGen/MachineScheduler.cpp b/lib/CodeGen/MachineScheduler.cpp
index 0baf2a6c1c..b37f689689 100644
--- a/lib/CodeGen/MachineScheduler.cpp
+++ b/lib/CodeGen/MachineScheduler.cpp
@@ -1687,8 +1687,14 @@ bool SchedBoundary::checkHazard(SUnit *SU) {
for (TargetSchedModel::ProcResIter
PI = SchedModel->getWriteProcResBegin(SC),
PE = SchedModel->getWriteProcResEnd(SC); PI != PE; ++PI) {
- if (getNextResourceCycle(PI->ProcResourceIdx, PI->Cycles) > CurrCycle)
+ unsigned NRCycle = getNextResourceCycle(PI->ProcResourceIdx, PI->Cycles);
+ if (NRCycle > CurrCycle) {
+ MaxObservedStall = std::max(NRCycle - CurrCycle, MaxObservedStall);
+ DEBUG(dbgs() << " SU(" << SU->NodeNum << ") "
+ << SchedModel->getResourceName(PI->ProcResourceIdx)
+ << "=" << NRCycle << "c\n");
return true;
+ }
}
}
return false;