diff options
author | Chris Lattner <sabre@nondot.org> | 2008-05-08 17:20:30 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-05-08 17:20:30 +0000 |
commit | 4fa09669d8dfc09660a1364c36ac1d4250d142c8 (patch) | |
tree | b52b6abe62098942472acf6f83e953c00c3a3936 /llvm/lib/Transforms | |
parent | 8462711ce88fb6c946989fde7f5e8a55d695e45b (diff) | |
download | bcm5719-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')
-rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 2 |
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; } |