mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-21 20:12:56 +02:00
[MiSched] - Simplify ProcResEntry access
Reviewed by: @MatzeB Differential Revision: https://reviews.llvm.org/D38447 llvm-svn: 314775
This commit is contained in:
parent
14e90c0414
commit
f137acb8b5
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user