From 4f7d107d1d2b2392ce8eb1647e2daa04a81f6c99 Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Tue, 14 Sep 2010 20:46:08 +0000 Subject: [PATCH] must not peephole away side effects git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113848 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/PeepholeOptimizer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/PeepholeOptimizer.cpp b/lib/CodeGen/PeepholeOptimizer.cpp index 15ede91a38e..28a4a9e301e 100644 --- a/lib/CodeGen/PeepholeOptimizer.cpp +++ b/lib/CodeGen/PeepholeOptimizer.cpp @@ -269,7 +269,8 @@ bool PeepholeOptimizer::runOnMachineFunction(MachineFunction &MF) { MII = I->begin(), MIE = I->end(); MII != MIE; ) { MachineInstr *MI = &*MII; - if (MI->getDesc().isCompare()) { + if (MI->getDesc().isCompare() && + !MI->getDesc().hasUnmodeledSideEffects()) { if (OptimizeCmpInstr(MI, MBB, MII)) Changed = true; else