summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit4fa09669d8dfc09660a1364c36ac1d4250d142c8 (patch)
treeb52b6abe62098942472acf6f83e953c00c3a3936 /llvm/lib/Transforms/Scalar/InstructionCombining.cpp
parent8462711ce88fb6c946989fde7f5e8a55d695e45b (diff)
downloadbcm5719-llvm-4fa09669d8dfc09660a1364c36ac1d4250d142c8.tar.gz
bcm5719-llvm-4fa09669d8dfc09660a1364c36ac1d4250d142c8.zip
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. llvm-svn: 50859
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 a3340a0d82a..b0ea9f5c43f 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud