aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/InstructionCombining.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-05-08 17:20:30 +0000
committerChris Lattner <sabre@nondot.org>2008-05-08 17:20:30 +0000
commit0ef546e639d45207b4776c80408c84170ad1cac6 (patch)
tree3abf3f2ff98b2ab223f4464caced8eba2c461d7c /lib/Transforms/Scalar/InstructionCombining.cpp
parentd96288a2ff188bb1fb1b86fb89b1ac82f6310a5c (diff)
Make instcombine's DSE respect loads as well as stores. It is not safe to
delete the first store in: store x -> p load p store y -> p This is for PR2297. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50859 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/InstructionCombining.cpp')
-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 a3340a0d82..b0ea9f5c43 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -10426,7 +10426,7 @@ Instruction *InstCombiner::visitStoreInst(StoreInst &SI) {
}
// Don't skip over loads or things that can modify memory.
- if (BBI->mayWriteToMemory())
+ if (BBI->mayWriteToMemory() || BBI->mayReadFromMemory())
break;
}