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
This commit is contained in:
Chris Lattner
2008-05-08 17:20:30 +00:00
parent d96288a2ff
commit 0ef546e639
2 changed files with 26 additions and 1 deletions

View File

@@ -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;
}