aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-04-29 04:58:38 +0000
committerChris Lattner <sabre@nondot.org>2008-04-29 04:58:38 +0000
commita02bacc48b699540c73e1d60579d90087e83b7c3 (patch)
tree68a0f1888b2e0fffa856906ef57254e4291645c0 /lib
parent626164a792c07c1ab6559db74ba73059324cbf8c (diff)
downloadexternal_llvm-a02bacc48b699540c73e1d60579d90087e83b7c3.zip
external_llvm-a02bacc48b699540c73e1d60579d90087e83b7c3.tar.gz
external_llvm-a02bacc48b699540c73e1d60579d90087e83b7c3.tar.bz2
don't delete the last store to an alloca if the store is volatile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50390 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 655ab10..c707e6e 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/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<AllocaInst>(Ptr)) {
EraseInstFromFunction(SI);
++NumCombined;