diff options
author | Javed Absar <javed.absar@arm.com> | 2017-10-03 09:35:04 +0000 |
---|---|---|
committer | Javed Absar <javed.absar@arm.com> | 2017-10-03 09:35:04 +0000 |
commit | 1f4dc266e2a55264dfecb3217da6241f4e20817d (patch) | |
tree | c2dd8f083b82fab3e549e70a62559537f621f776 | |
parent | 13e3610bacfb4bd54087b382bbacd883acc73957 (diff) |
[MiSched] - Simplify ProcResEntry accesslinaro-local/peter.smith/errata-section
Reviewed by: @MatzeB
Differential Revision: https://reviews.llvm.org/D38447
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314775 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/MachineScheduler.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/CodeGen/MachineScheduler.cpp b/lib/CodeGen/MachineScheduler.cpp index 6780d76e876..9a86d0850b3 100644 --- a/lib/CodeGen/MachineScheduler.cpp +++ b/lib/CodeGen/MachineScheduler.cpp @@ -1962,16 +1962,18 @@ bool SchedBoundary::checkHazard(SUnit *SU) { if (SchedModel->hasInstrSchedModel() && SU->hasReservedResource) { const MCSchedClassDesc *SC = DAG->getSchedClass(SU); - for (TargetSchedModel::ProcResIter - PI = SchedModel->getWriteProcResBegin(SC), - PE = SchedModel->getWriteProcResEnd(SC); PI != PE; ++PI) { - unsigned NRCycle = getNextResourceCycle(PI->ProcResourceIdx, PI->Cycles); + for (const MCWriteProcResEntry &PE : + make_range(SchedModel->getWriteProcResBegin(SC), + SchedModel->getWriteProcResEnd(SC))) { + unsigned ResIdx = PE.ProcResourceIdx; + unsigned Cycles = PE.Cycles; + unsigned NRCycle = getNextResourceCycle(ResIdx, Cycles); if (NRCycle > CurrCycle) { #ifndef NDEBUG - MaxObservedStall = std::max(PI->Cycles, MaxObservedStall); + MaxObservedStall = std::max(Cycles, MaxObservedStall); #endif DEBUG(dbgs() << " SU(" << SU->NodeNum << ") " - << SchedModel->getResourceName(PI->ProcResourceIdx) + << SchedModel->getResourceName(ResIdx) << "=" << NRCycle << "c\n"); return true; } |