aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-09-07 05:33:03 +0000
committerChris Lattner <sabre@nondot.org>2007-09-07 05:33:03 +0000
commita54c7eb15708bf5654a99c66cb7d633f52831555 (patch)
tree3e1293daa2e5389cf2326bf0f0d47cc983d40cd8 /lib
parent718cb665ca6ce2bc4d8e8479f46a45db91b49f86 (diff)
Don't zap back to back volatile load/stores
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41759 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 26df55531a..f9abafa34c 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -9066,7 +9066,7 @@ Instruction *InstCombiner::visitStoreInst(StoreInst &SI) {
// the pointer we're loading and is producing the pointer we're storing,
// then *this* store is dead (X = load P; store X -> P).
if (LoadInst *LI = dyn_cast<LoadInst>(BBI)) {
- if (LI == Val && LI->getOperand(0) == Ptr) {
+ if (LI == Val && LI->getOperand(0) == Ptr && !SI.isVolatile()) {
EraseInstFromFunction(SI);
++NumCombined;
return 0;