1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

use range-based for loops; NFCI

llvm-svn: 255171
This commit is contained in:
Sanjay Patel 2015-12-09 22:45:45 +00:00
parent 88c4494d79
commit cbf65ba44a

View File

@ -724,13 +724,12 @@ static void updatePhysDepsDownwards(const MachineInstr *UseMI,
// Update RegUnits to reflect live registers after UseMI. // Update RegUnits to reflect live registers after UseMI.
// First kills. // First kills.
for (unsigned i = 0, e = Kills.size(); i != e; ++i) for (unsigned Kill : Kills)
for (MCRegUnitIterator Units(Kills[i], TRI); Units.isValid(); ++Units) for (MCRegUnitIterator Units(Kill, TRI); Units.isValid(); ++Units)
RegUnits.erase(*Units); RegUnits.erase(*Units);
// Second, live defs. // Second, live defs.
for (unsigned i = 0, e = LiveDefOps.size(); i != e; ++i) { for (unsigned DefOp : LiveDefOps) {
unsigned DefOp = LiveDefOps[i];
for (MCRegUnitIterator Units(UseMI->getOperand(DefOp).getReg(), TRI); for (MCRegUnitIterator Units(UseMI->getOperand(DefOp).getReg(), TRI);
Units.isValid(); ++Units) { Units.isValid(); ++Units) {
LiveRegUnit &LRU = RegUnits[*Units]; LiveRegUnit &LRU = RegUnits[*Units];
@ -756,8 +755,7 @@ computeCrossBlockCriticalPath(const TraceBlockInfo &TBI) {
assert(TBI.HasValidInstrDepths && "Missing depth info"); assert(TBI.HasValidInstrDepths && "Missing depth info");
assert(TBI.HasValidInstrHeights && "Missing height info"); assert(TBI.HasValidInstrHeights && "Missing height info");
unsigned MaxLen = 0; unsigned MaxLen = 0;
for (unsigned i = 0, e = TBI.LiveIns.size(); i != e; ++i) { for (const LiveInReg &LIR : TBI.LiveIns) {
const LiveInReg &LIR = TBI.LiveIns[i];
if (!TargetRegisterInfo::isVirtualRegister(LIR.Reg)) if (!TargetRegisterInfo::isVirtualRegister(LIR.Reg))
continue; continue;
const MachineInstr *DefMI = MTM.MRI->getVRegDef(LIR.Reg); const MachineInstr *DefMI = MTM.MRI->getVRegDef(LIR.Reg);