Skip to content

Commit 42e23e9

Browse files
committed
--- Merging r113848 into '.': U lib/CodeGen/PeepholeOptimizer.cpp must not peephole away side effects llvm-svn: 113913
1 parent 68cf62a commit 42e23e9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/CodeGen/PeepholeOptimizer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ bool PeepholeOptimizer::runOnMachineFunction(MachineFunction &MF) {
272272
MII = I->begin(), ME = I->end(); MII != ME; ) {
273273
MachineInstr *MI = &*MII;
274274

275-
if (MI->getDesc().isCompare()) {
275+
if (MI->getDesc().isCompare() &&
276+
!MI->getDesc().hasUnmodeledSideEffects()) {
276277
++MII; // The iterator may become invalid if the compare is deleted.
277278
Changed |= OptimizeCmpInstr(MI, MBB);
278279
} else {

0 commit comments

Comments
 (0)