[PATCH] D38447: [MiSched] - Simplify ProcResEntry access
Javed Absar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 3 02:36:48 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL314775: [MiSched] - Simplify ProcResEntry access (authored by javed.absar).
Changed prior to commit:
https://reviews.llvm.org/D38447?vs=117289&id=117488#toc
Repository:
rL LLVM
https://reviews.llvm.org/D38447
Files:
llvm/trunk/lib/CodeGen/MachineScheduler.cpp
Index: llvm/trunk/lib/CodeGen/MachineScheduler.cpp
===================================================================
--- llvm/trunk/lib/CodeGen/MachineScheduler.cpp
+++ llvm/trunk/lib/CodeGen/MachineScheduler.cpp
@@ -1962,16 +1962,18 @@
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;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38447.117488.patch
Type: text/x-patch
Size: 1366 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171003/dcd19695/attachment.bin>
More information about the llvm-commits
mailing list