summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineCombiner.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/MachineCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineCombiner.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineCombiner.cpp b/llvm/lib/CodeGen/MachineCombiner.cpp
index d563370dd4f..3ffef682334 100644
--- a/llvm/lib/CodeGen/MachineCombiner.cpp
+++ b/llvm/lib/CodeGen/MachineCombiner.cpp
@@ -415,7 +415,7 @@ bool MachineCombiner::combineInstructions(MachineBasicBlock *MBB) {
bool IncrementalUpdate = false;
auto BlockIter = MBB->begin();
- auto LastUpdate = BlockIter;
+ decltype(BlockIter) LastUpdate;
// Check if the block is in a loop.
const MachineLoop *ML = MLI->getLoopFor(MBB);
if (!MinInstr)
@@ -503,9 +503,11 @@ bool MachineCombiner::combineInstructions(MachineBasicBlock *MBB) {
InstrIdxForVirtReg, P,
!IncrementalUpdate) &&
preservesResourceLen(MBB, BlockTrace, InsInstrs, DelInstrs)) {
- if (MBB->size() > inc_threshold)
+ if (MBB->size() > inc_threshold) {
// Use incremental depth updates for basic blocks above treshold
IncrementalUpdate = true;
+ LastUpdate = BlockIter;
+ }
insertDeleteInstructions(MBB, MI, InsInstrs, DelInstrs, MinInstr,
RegUnits, IncrementalUpdate);
OpenPOWER on IntegriCloud