From e331a65c794c93b7c7792b7ba08ab6069b9c086d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 29 Apr 2008 04:58:38 +0000 Subject: don't delete the last store to an alloca if the store is volatile. llvm-svn: 50390 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Transforms/Scalar/InstructionCombining.cpp') diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 655ab102599..c707e6ee670 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -10311,7 +10311,7 @@ Instruction *InstCombiner::visitStoreInst(StoreInst &SI) { // If the RHS is an alloca with a single use, zapify the store, making the // alloca dead. - if (Ptr->hasOneUse()) { + if (Ptr->hasOneUse() && !SI.isVolatile()) { if (isa(Ptr)) { EraseInstFromFunction(SI); ++NumCombined; -- cgit v1.2.3