commit | 845042893d68533202874a00872ede4c410ecbed | [log] [tgz] |
---|---|---|
author | Chris Lattner <sabre@nondot.org> | Thu May 08 17:20:30 2008 +0000 |
committer | Chris Lattner <sabre@nondot.org> | Thu May 08 17:20:30 2008 +0000 |
tree | 3abf3f2ff98b2ab223f4464caced8eba2c461d7c | |
parent | 18731aa2490d5442d9085e8de0761fbc4d81c83e [diff] [blame] |
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
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index a3340a0..b0ea9f5 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -10426,7 +10426,7 @@ } // Don't skip over loads or things that can modify memory. - if (BBI->mayWriteToMemory()) + if (BBI->mayWriteToMemory() || BBI->mayReadFromMemory()) break; }