summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
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
commite331a65c794c93b7c7792b7ba08ab6069b9c086d (patch)
treeae29efd1cd453671883a405cbb102eec7d55d515 /llvm/lib/Transforms/Scalar/InstructionCombining.cpp
parent5c88f7b1ad861a797f50b9e1f8842ada6c9e966e (diff)
downloadbcm5719-llvm-e331a65c794c93b7c7792b7ba08ab6069b9c086d.tar.gz
bcm5719-llvm-e331a65c794c93b7c7792b7ba08ab6069b9c086d.zip
don't delete the last store to an alloca if the store is volatile.
llvm-svn: 50390
Diffstat (limited to 'llvm/lib/Transforms/Scalar/InstructionCombining.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp2
1 files changed, 1 insertions, 1 deletions
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<AllocaInst>(Ptr)) {
EraseInstFromFunction(SI);
++NumCombined;
OpenPOWER on IntegriCloud