[AliasSetTracker] Update signature to aliasesPointer [NFCI].

llvm-svn: 352399
This commit is contained in:
Alina Sbirlea 2019-01-28 18:30:05 +00:00
parent 208ba96c64
commit 3d1d95ca55
2 changed files with 17 additions and 15 deletions

View File

@ -309,10 +309,10 @@ private:
}
public:
/// Return true if the specified pointer "may" (or must) alias one of the
/// members in the set.
bool aliasesPointer(const Value *Ptr, LocationSize Size,
const AAMDNodes &AAInfo, AliasAnalysis &AA) const;
/// 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, AliasAnalysis &AA) const;
bool aliasesUnknownInst(const Instruction *Inst, AliasAnalysis &AA) const;
};

View File

@ -183,14 +183,15 @@ void AliasSet::addUnknownInst(Instruction *I, AliasAnalysis &AA) {
Access = ModRefAccess;
}
/// aliasesPointer - Return true if the specified pointer "may" (or must)
/// alias one of the members in the set.
/// aliasesPointer - If the specified pointer "may" (or must) alias one of the
/// members in the set return the appropriate AliasResult. Otherwise return
/// NoAlias.
///
bool AliasSet::aliasesPointer(const Value *Ptr, LocationSize Size,
const AAMDNodes &AAInfo,
AliasAnalysis &AA) const {
AliasResult AliasSet::aliasesPointer(const Value *Ptr, LocationSize Size,
const AAMDNodes &AAInfo,
AliasAnalysis &AA) const {
if (AliasAny)
return true;
return MayAlias;
if (Alias == SetMustAlias) {
assert(UnknownInsts.empty() && "Illegal must alias set!");
@ -207,9 +208,10 @@ bool AliasSet::aliasesPointer(const Value *Ptr, LocationSize Size,
// If this is a may-alias set, we have to check all of the pointers in the set
// to be sure it doesn't alias the set...
for (iterator I = begin(), E = end(); I != E; ++I)
if (AA.alias(MemoryLocation(Ptr, Size, AAInfo),
MemoryLocation(I.getPointer(), I.getSize(), I.getAAInfo())))
return true;
if (AliasResult AR = AA.alias(
MemoryLocation(Ptr, Size, AAInfo),
MemoryLocation(I.getPointer(), I.getSize(), I.getAAInfo())))
return AR;
// Check the unknown instructions...
if (!UnknownInsts.empty()) {
@ -217,10 +219,10 @@ bool AliasSet::aliasesPointer(const Value *Ptr, LocationSize Size,
if (auto *Inst = getUnknownInst(i))
if (isModOrRefSet(
AA.getModRefInfo(Inst, MemoryLocation(Ptr, Size, AAInfo))))
return true;
return MayAlias;
}
return false;
return NoAlias;
}
bool AliasSet::aliasesUnknownInst(const Instruction *Inst,