diff options
Diffstat (limited to 'llvm/lib/Target/X86/X86PadShortFunction.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86PadShortFunction.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/Target/X86/X86PadShortFunction.cpp b/llvm/lib/Target/X86/X86PadShortFunction.cpp index 77b345352f3..62a9aafc2cf 100644 --- a/llvm/lib/Target/X86/X86PadShortFunction.cpp +++ b/llvm/lib/Target/X86/X86PadShortFunction.cpp @@ -187,19 +187,17 @@ bool PadShortFunc::cyclesUntilReturn(MachineBasicBlock *MBB, unsigned int CyclesToEnd = 0; - for (MachineBasicBlock::iterator MBBI = MBB->begin(); - MBBI != MBB->end(); ++MBBI) { - MachineInstr *MI = MBBI; + for (MachineInstr &MI : *MBB) { // Mark basic blocks with a return instruction. Calls to other // functions do not count because the called function will be padded, // if necessary. - if (MI->isReturn() && !MI->isCall()) { + if (MI.isReturn() && !MI.isCall()) { VisitedBBs[MBB] = VisitedBBInfo(true, CyclesToEnd); Cycles += CyclesToEnd; return true; } - CyclesToEnd += TII->getInstrLatency(STI->getInstrItineraryData(), *MI); + CyclesToEnd += TII->getInstrLatency(STI->getInstrItineraryData(), MI); } VisitedBBs[MBB] = VisitedBBInfo(false, CyclesToEnd); |