[llvm] r314775 - [MiSched] - Simplify ProcResEntry access
Javed Absar via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 3 02:35:04 PDT 2017
Author: javed.absar
Date: Tue Oct 3 02:35:04 2017
New Revision: 314775
URL: http://llvm.org/viewvc/llvm-project?rev=314775&view=rev
Log:
[MiSched] - Simplify ProcResEntry access
Reviewed by: @MatzeB
Differential Revision: https://reviews.llvm.org/D38447
Modified:
llvm/trunk/lib/CodeGen/MachineScheduler.cpp
Modified: llvm/trunk/lib/CodeGen/MachineScheduler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineScheduler.cpp?rev=314775&r1=314774&r2=314775&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineScheduler.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineScheduler.cpp Tue Oct 3 02:35:04 2017
@@ -1962,16 +1962,18 @@ bool SchedBoundary::checkHazard(SUnit *S
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;
}
More information about the llvm-commits
mailing list