aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/AliasSetTracker.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2022-10-18 16:51:47 +0200
committerNikita Popov <npopov@redhat.com>2022-10-18 16:54:55 +0200
commitd06131fda21ebbd9caadac79215e0e12b20b390c (patch)
treec20698375536a7909fa365bbc539f54247a5e16c /llvm/lib/Analysis/AliasSetTracker.cpp
parent9fde8e907b5386e4738f873090be8def35d508e5 (diff)
downloadllvm-d06131fda21ebbd9caadac79215e0e12b20b390c.zip
llvm-d06131fda21ebbd9caadac79215e0e12b20b390c.tar.gz
llvm-d06131fda21ebbd9caadac79215e0e12b20b390c.tar.bz2
[AST] Pass BatchAA to mergeSetIn() (NFCI)
Diffstat (limited to 'llvm/lib/Analysis/AliasSetTracker.cpp')
-rw-r--r--llvm/lib/Analysis/AliasSetTracker.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Analysis/AliasSetTracker.cpp b/llvm/lib/Analysis/AliasSetTracker.cpp
index b8b64d3..a7939e9 100644
--- a/llvm/lib/Analysis/AliasSetTracker.cpp
+++ b/llvm/lib/Analysis/AliasSetTracker.cpp
@@ -40,8 +40,8 @@ static cl::opt<unsigned>
"sets may contain before degradation"));
/// mergeSetIn - Merge the specified alias set into this alias set.
-///
-void AliasSet::mergeSetIn(AliasSet &AS, AliasSetTracker &AST) {
+void AliasSet::mergeSetIn(AliasSet &AS, AliasSetTracker &AST,
+ BatchAAResults &BatchAA) {
assert(!AS.Forward && "Alias set is already forwarding!");
assert(!Forward && "This set is a forwarding set!!");
@@ -54,12 +54,11 @@ void AliasSet::mergeSetIn(AliasSet &AS, AliasSetTracker &AST) {
// Check that these two merged sets really are must aliases. Since both
// used to be must-alias sets, we can just check any pointer from each set
// for aliasing.
- AliasAnalysis &AA = AST.getAliasAnalysis();
PointerRec *L = getSomePointer();
PointerRec *R = AS.getSomePointer();
// If the pointers are not a must-alias pair, this set becomes a may alias.
- if (!AA.isMustAlias(
+ if (!BatchAA.isMustAlias(
MemoryLocation(L->getValue(), L->getSize(), L->getAAInfo()),
MemoryLocation(R->getValue(), R->getSize(), R->getAAInfo())))
Alias = SetMayAlias;
@@ -292,7 +291,7 @@ AliasSet *AliasSetTracker::mergeAliasSetsForPointer(const Value *Ptr,
FoundSet = &AS;
} else {
// Otherwise, we must merge the sets.
- FoundSet->mergeSetIn(AS, *this);
+ FoundSet->mergeSetIn(AS, *this, BatchAA);
}
}
@@ -310,7 +309,7 @@ AliasSet *AliasSetTracker::findAliasSetForUnknownInst(Instruction *Inst) {
FoundSet = &AS;
} else {
// Otherwise, we must merge the sets.
- FoundSet->mergeSetIn(AS, *this);
+ FoundSet->mergeSetIn(AS, *this, BatchAA);
}
}
return FoundSet;
@@ -581,6 +580,7 @@ AliasSet &AliasSetTracker::mergeAllAliasSets() {
AliasAnyAS->Access = AliasSet::ModRefAccess;
AliasAnyAS->AliasAny = true;
+ BatchAAResults BatchAA(AA);
for (auto *Cur : ASVector) {
// If Cur was already forwarding, just forward to the new AS instead.
AliasSet *FwdTo = Cur->Forward;
@@ -592,7 +592,7 @@ AliasSet &AliasSetTracker::mergeAllAliasSets() {
}
// Otherwise, perform the actual merge.
- AliasAnyAS->mergeSetIn(*Cur, *this);
+ AliasAnyAS->mergeSetIn(*Cur, *this, BatchAA);
}
return *AliasAnyAS;