mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-19 02:25:01 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user