diff options
Diffstat (limited to 'llvm/lib/Analysis/AliasSetTracker.cpp')
| -rw-r--r-- | llvm/lib/Analysis/AliasSetTracker.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/AliasSetTracker.cpp b/llvm/lib/Analysis/AliasSetTracker.cpp index 91b889116dfa..debdd328ce53 100644 --- a/llvm/lib/Analysis/AliasSetTracker.cpp +++ b/llvm/lib/Analysis/AliasSetTracker.cpp @@ -348,8 +348,16 @@ AliasSet &AliasSetTracker::getAliasSetFor(const MemoryLocation &MemLoc) { // due to a quirk of alias analysis behavior. Since alias(undef, undef) // is NoAlias, mergeAliasSetsForPointer(undef, ...) will not find the // the right set for undef, even if it exists. - if (Entry.updateSizeAndAAInfo(Size, AAInfo)) + if (Entry.updateSizeAndAAInfo(Size, AAInfo)) { mergeAliasSetsForPointer(Pointer, Size, AAInfo, MustAliasAll); + + // For MustAlias sets, also update Size/AAInfo of the representative + // pointer. + AliasSet &AS = *Entry.getAliasSet(*this); + if (AS.isMustAlias()) + if (AliasSet::PointerRec *P = AS.getSomePointer()) + P->updateSizeAndAAInfo(Size, AAInfo); + } // Return the set! return *Entry.getAliasSet(*this)->getForwardedTarget(*this); } |
