"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!!");
// 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;
FoundSet = &AS;
} else {
// Otherwise, we must merge the sets.
- FoundSet->mergeSetIn(AS, *this);
+ FoundSet->mergeSetIn(AS, *this, BatchAA);
}
}
FoundSet = &AS;
} else {
// Otherwise, we must merge the sets.
- FoundSet->mergeSetIn(AS, *this);
+ FoundSet->mergeSetIn(AS, *this, BatchAA);
}
}
return FoundSet;
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;
}
// Otherwise, perform the actual merge.
- AliasAnyAS->mergeSetIn(*Cur, *this);
+ AliasAnyAS->mergeSetIn(*Cur, *this, BatchAA);
}
return *AliasAnyAS;