mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 04:24:00 +00:00
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
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user