mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
use range-based for loops; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241463 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6fe7acaaf8
commit
98d447c206
@ -998,8 +998,7 @@ computeInstrHeights(const MachineBasicBlock *MBB) {
|
||||
// MBB is the highest precomputed block in the trace.
|
||||
if (MBB) {
|
||||
TraceBlockInfo &TBI = BlockInfo[MBB->getNumber()];
|
||||
for (unsigned i = 0, e = TBI.LiveIns.size(); i != e; ++i) {
|
||||
LiveInReg LI = TBI.LiveIns[i];
|
||||
for (LiveInReg &LI : TBI.LiveIns) {
|
||||
if (TargetRegisterInfo::isVirtualRegister(LI.Reg)) {
|
||||
// For virtual registers, the def latency is included.
|
||||
unsigned &Height = Heights[MTM.MRI->getVRegDef(LI.Reg)];
|
||||
@ -1209,8 +1208,7 @@ unsigned MachineTraceMetrics::Trace::getResourceLength(
|
||||
unsigned ResourceIdx)
|
||||
->unsigned {
|
||||
unsigned Cycles = 0;
|
||||
for (unsigned I = 0; I != Instrs.size(); ++I) {
|
||||
const MCSchedClassDesc *SC = Instrs[I];
|
||||
for (const MCSchedClassDesc *SC : Instrs) {
|
||||
if (!SC->isValid())
|
||||
continue;
|
||||
for (TargetSchedModel::ProcResIter
|
||||
@ -1228,8 +1226,8 @@ unsigned MachineTraceMetrics::Trace::getResourceLength(
|
||||
|
||||
for (unsigned K = 0; K != PRDepths.size(); ++K) {
|
||||
unsigned PRCycles = PRDepths[K] + PRHeights[K];
|
||||
for (unsigned I = 0; I != Extrablocks.size(); ++I)
|
||||
PRCycles += TE.MTM.getProcResourceCycles(Extrablocks[I]->getNumber())[K];
|
||||
for (const MachineBasicBlock *MBB : Extrablocks)
|
||||
PRCycles += TE.MTM.getProcResourceCycles(MBB->getNumber())[K];
|
||||
PRCycles += extraCycles(ExtraInstrs, K);
|
||||
PRCycles -= extraCycles(RemoveInstrs, K);
|
||||
PRMax = std::max(PRMax, PRCycles);
|
||||
@ -1240,8 +1238,8 @@ unsigned MachineTraceMetrics::Trace::getResourceLength(
|
||||
// Instrs: #instructions in current trace outside current block.
|
||||
unsigned Instrs = TBI.InstrDepth + TBI.InstrHeight;
|
||||
// Add instruction count from the extra blocks.
|
||||
for (unsigned i = 0, e = Extrablocks.size(); i != e; ++i)
|
||||
Instrs += TE.MTM.getResources(Extrablocks[i])->InstrCount;
|
||||
for (const MachineBasicBlock *MBB : Extrablocks)
|
||||
Instrs += TE.MTM.getResources(MBB)->InstrCount;
|
||||
Instrs += ExtraInstrs.size();
|
||||
Instrs -= RemoveInstrs.size();
|
||||
if (unsigned IW = TE.MTM.SchedModel.getIssueWidth())
|
||||
|
Loading…
Reference in New Issue
Block a user