forked from OSchip/llvm-project
[AliasSetTracker] Update signature to aliasesPointer [NFCI].
llvm-svn: 352399
This commit is contained in:
parent
208ba96c64
commit
3d1d95ca55
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue