summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2015-07-06 16:19:14 +0000
committerSanjay Patel <spatel@rotateright.com>2015-07-06 16:19:14 +0000
commit6d4c3e3ded00cafc1f92516e10454d4a1780a2a1 (patch)
treed7399d85d37d1e3bb76561f81ee99fe874a2b423 /llvm/lib
parent706f930b72659a34fb96e9d758b0d673df50012a (diff)
downloadbcm5719-llvm-6d4c3e3ded00cafc1f92516e10454d4a1780a2a1.tar.gz
bcm5719-llvm-6d4c3e3ded00cafc1f92516e10454d4a1780a2a1.zip
use range-based for loops; NFCI
llvm-svn: 241463
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/MachineTraceMetrics.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/MachineTraceMetrics.cpp b/llvm/lib/CodeGen/MachineTraceMetrics.cpp
index 10a984cbef6..ddeabbd08a3 100644
--- a/llvm/lib/CodeGen/MachineTraceMetrics.cpp
+++ b/llvm/lib/CodeGen/MachineTraceMetrics.cpp
@@ -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())
OpenPOWER on IntegriCloud