diff options
| author | Chris Lattner <sabre@nondot.org> | 2004-12-29 04:36:02 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2004-12-29 04:36:02 +0000 |
| commit | 13516fe2e7cc828bbeec6282413bb08bcd7fce2b (patch) | |
| tree | 2d6557aad1eed796115fea097a475157fa81b81e /llvm/lib | |
| parent | f2a596373735313d17a92b0c4bfe39a6629a91da (diff) | |
| download | bcm5719-llvm-13516fe2e7cc828bbeec6282413bb08bcd7fce2b.tar.gz bcm5719-llvm-13516fe2e7cc828bbeec6282413bb08bcd7fce2b.zip | |
Fix PR491 and testcase Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll
llvm-svn: 19180
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp index 27a0b0a881f..e29bad53c19 100644 --- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -111,7 +111,8 @@ bool DSE::runOnBasicBlock(BasicBlock &BB) { if (AliasSet *AS = KillLocs.getAliasSetForPointerIfExists(Ptr, ValSize)) for (AliasSet::iterator ASI = AS->begin(), E = AS->end(); ASI != E; ++ASI) - if (AA.alias(ASI.getPointer(), ASI.getSize(), Ptr, ValSize) + if (ASI.getSize() >= ValSize && // Overwriting all of this store. + AA.alias(ASI.getPointer(), ASI.getSize(), Ptr, ValSize) == AliasAnalysis::MustAlias) { // If we found a must alias in the killed set, then this store really // is dead. Remember that the various operands of the store now have |

