--- Merging r113848 into '.':
U    lib/CodeGen/PeepholeOptimizer.cpp

must not peephole away side effects



git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_28@113913 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling
2010-09-15 00:32:40 +00:00
parent 7e789a2e81
commit ed70cc3e1b
+2 -1
View File
@@ -272,7 +272,8 @@ bool PeepholeOptimizer::runOnMachineFunction(MachineFunction &MF) {
MII = I->begin(), ME = I->end(); MII != ME; ) {
MachineInstr *MI = &*MII;
if (MI->getDesc().isCompare()) {
if (MI->getDesc().isCompare() &&
!MI->getDesc().hasUnmodeledSideEffects()) {
++MII; // The iterator may become invalid if the compare is deleted.
Changed |= OptimizeCmpInstr(MI, MBB);
} else {