summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/DeadMachineInstructionElim.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/DeadMachineInstructionElim.cpp')
-rw-r--r--llvm/lib/CodeGen/DeadMachineInstructionElim.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/DeadMachineInstructionElim.cpp b/llvm/lib/CodeGen/DeadMachineInstructionElim.cpp
index 0b8dc7a86ad..17c229a216a 100644
--- a/llvm/lib/CodeGen/DeadMachineInstructionElim.cpp
+++ b/llvm/lib/CodeGen/DeadMachineInstructionElim.cpp
@@ -122,7 +122,7 @@ bool DeadMachineInstructionElim::runOnMachineFunction(MachineFunction &MF) {
// liveness as we go.
for (MachineBasicBlock::reverse_iterator MII = MBB.rbegin(),
MIE = MBB.rend(); MII != MIE; ) {
- MachineInstr *MI = &*MII;
+ MachineInstr *MI = &*MII++;
// If the instruction is dead, delete it!
if (isDead(MI)) {
@@ -133,9 +133,6 @@ bool DeadMachineInstructionElim::runOnMachineFunction(MachineFunction &MF) {
MI->eraseFromParentAndMarkDBGValuesForRemoval();
AnyChanges = true;
++NumDeletes;
- MIE = MBB.rend();
- // MII is now pointing to the next instruction to process,
- // so don't increment it.
continue;
}
@@ -169,10 +166,6 @@ bool DeadMachineInstructionElim::runOnMachineFunction(MachineFunction &MF) {
}
}
}
-
- // We didn't delete the current instruction, so increment MII to
- // the next one.
- ++MII;
}
}
OpenPOWER on IntegriCloud