Fix PR491 and testcase Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll

llvm-svn: 19180
This commit is contained in:
Chris Lattner 2004-12-29 04:36:02 +00:00
parent f2a5963737
commit 13516fe2e7
1 changed files with 2 additions and 1 deletions

View File

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