diff --git a/llvm/lib/Analysis/AliasSetTracker.cpp b/llvm/lib/Analysis/AliasSetTracker.cpp --- a/llvm/lib/Analysis/AliasSetTracker.cpp +++ b/llvm/lib/Analysis/AliasSetTracker.cpp @@ -301,7 +301,7 @@ const AAMDNodes &AAInfo, bool &MustAliasAll) { AliasSet *FoundSet = nullptr; - AliasResult AllAR = MustAlias; + MustAliasAll = true; for (AliasSet &AS : llvm::make_early_inc_range(*this)) { if (AS.Forward) continue; @@ -310,8 +310,8 @@ if (AR == NoAlias) continue; - AllAR = - AliasResult(AllAR & AR); // Possible downgrade to May/Partial, even No + if (AR != MustAlias) + MustAliasAll = false; if (!FoundSet) { // If this is the first alias set ptr can go into, remember it. @@ -322,7 +322,6 @@ } } - MustAliasAll = (AllAR == MustAlias); return FoundSet; }