Skip to content

Commit

Permalink
[AST] Use BatchAA in aliasesPointer() (NFC)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Sep 30, 2022
1 parent a314a36 commit 57f7f0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion llvm/include/llvm/Analysis/AliasSetTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ class AliasSet : public ilist_node<AliasSet> {
/// If the specified pointer "may" (or must) alias one of the members in the
/// set return the appropriate AliasResult. Otherwise return NoAlias.
AliasResult aliasesPointer(const Value *Ptr, LocationSize Size,
const AAMDNodes &AAInfo, AAResults &AA) const;
const AAMDNodes &AAInfo, BatchAAResults &AA) const;
bool aliasesUnknownInst(const Instruction *Inst, BatchAAResults &AA) const;
};

Expand Down
5 changes: 3 additions & 2 deletions llvm/lib/Analysis/AliasSetTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ void AliasSet::addUnknownInst(Instruction *I, AliasAnalysis &AA) {
///
AliasResult AliasSet::aliasesPointer(const Value *Ptr, LocationSize Size,
const AAMDNodes &AAInfo,
AliasAnalysis &AA) const {
BatchAAResults &AA) const {
if (AliasAny)
return AliasResult::MayAlias;

Expand Down Expand Up @@ -275,11 +275,12 @@ AliasSet *AliasSetTracker::mergeAliasSetsForPointer(const Value *Ptr,
bool &MustAliasAll) {
AliasSet *FoundSet = nullptr;
MustAliasAll = true;
BatchAAResults BatchAA(AA);
for (AliasSet &AS : llvm::make_early_inc_range(*this)) {
if (AS.Forward)
continue;

AliasResult AR = AS.aliasesPointer(Ptr, Size, AAInfo, AA);
AliasResult AR = AS.aliasesPointer(Ptr, Size, AAInfo, BatchAA);
if (AR == AliasResult::NoAlias)
continue;

Expand Down

0 comments on commit 57f7f0d

Please sign in to comment.