diff options
author | Sanjay Patel <spatel@rotateright.com> | 2015-08-10 23:29:41 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2015-08-10 23:29:41 +0000 |
commit | 05e835fb9df47bfb68530f5c974c1c3d0cdc770d (patch) | |
tree | 57bd5cc4f0e56fc7cd14a6960e4e7059edd5f6d9 /lib/CodeGen/TailDuplication.cpp | |
parent | 8615171600b44fad021d06a3c22dd328475f5f2c (diff) |
use range-based for loop; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244531 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/TailDuplication.cpp')
-rw-r--r-- | lib/CodeGen/TailDuplication.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/TailDuplication.cpp b/lib/CodeGen/TailDuplication.cpp index 76619dbc156..0924ce2588b 100644 --- a/lib/CodeGen/TailDuplication.cpp +++ b/lib/CodeGen/TailDuplication.cpp @@ -583,24 +583,24 @@ TailDuplicatePass::shouldTailDuplicate(const MachineFunction &MF, // Check the instructions in the block to determine whether tail-duplication // is invalid or unlikely to be profitable. unsigned InstrCount = 0; - for (MachineBasicBlock::iterator I = TailBB.begin(); I != TailBB.end(); ++I) { + for (MachineInstr &MI : TailBB) { // Non-duplicable things shouldn't be tail-duplicated. - if (I->isNotDuplicable()) + if (MI.isNotDuplicable()) return false; // Do not duplicate 'return' instructions if this is a pre-regalloc run. // A return may expand into a lot more instructions (e.g. reload of callee // saved registers) after PEI. - if (PreRegAlloc && I->isReturn()) + if (PreRegAlloc && MI.isReturn()) return false; // Avoid duplicating calls before register allocation. Calls presents a // barrier to register allocation so duplicating them may end up increasing // spills. - if (PreRegAlloc && I->isCall()) + if (PreRegAlloc && MI.isCall()) return false; - if (!I->isPHI() && !I->isDebugValue()) + if (!MI.isPHI() && !MI.isDebugValue()) InstrCount += 1; if (InstrCount > MaxDuplicateCount) |