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 @@ -300,7 +300,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; @@ -309,8 +309,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. @@ -321,7 +321,6 @@ } } - MustAliasAll = (AllAR == MustAlias); return FoundSet; }