[llvm] 747f27d - [AA] Rename getModRefBehavior() to getMemoryEffects() (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 19 02:05:08 PDT 2022
Author: Nikita Popov
Date: 2022-10-19T11:03:54+02:00
New Revision: 747f27d97d230b0b3e318dd9d3815d27d1bb0652
URL: https://github.com/llvm/llvm-project/commit/747f27d97d230b0b3e318dd9d3815d27d1bb0652
DIFF: https://github.com/llvm/llvm-project/commit/747f27d97d230b0b3e318dd9d3815d27d1bb0652.diff
LOG: [AA] Rename getModRefBehavior() to getMemoryEffects() (NFC)
Follow up on D135962, renaming the method name to match the new
type name.
Added:
Modified:
llvm/include/llvm/Analysis/AliasAnalysis.h
llvm/include/llvm/Analysis/BasicAliasAnalysis.h
llvm/include/llvm/Analysis/GlobalsModRef.h
llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h
llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h
llvm/lib/Analysis/AliasAnalysis.cpp
llvm/lib/Analysis/AliasSetTracker.cpp
llvm/lib/Analysis/BasicAliasAnalysis.cpp
llvm/lib/Analysis/GlobalsModRef.cpp
llvm/lib/Analysis/ObjCARCAliasAnalysis.cpp
llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp
llvm/lib/Transforms/IPO/FunctionAttrs.cpp
llvm/lib/Transforms/ObjCARC/DependencyAnalysis.cpp
llvm/lib/Transforms/Scalar/LICM.cpp
llvm/lib/Transforms/Utils/InlineFunction.cpp
llvm/unittests/Analysis/GlobalsModRefTest.cpp
polly/lib/Analysis/ScopBuilder.cpp
polly/lib/Analysis/ScopDetection.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Analysis/AliasAnalysis.h b/llvm/include/llvm/Analysis/AliasAnalysis.h
index 7e6aba3d1682..2814fd479e57 100644
--- a/llvm/include/llvm/Analysis/AliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/AliasAnalysis.h
@@ -383,10 +383,10 @@ class AAResults {
ModRefInfo getArgModRefInfo(const CallBase *Call, unsigned ArgIdx);
/// Return the behavior of the given call site.
- MemoryEffects getModRefBehavior(const CallBase *Call);
+ MemoryEffects getMemoryEffects(const CallBase *Call);
/// Return the behavior when calling the given function.
- MemoryEffects getModRefBehavior(const Function *F);
+ MemoryEffects getMemoryEffects(const Function *F);
/// Checks if the specified call is known to never read or write memory.
///
@@ -400,7 +400,7 @@ class AAResults {
///
/// This property corresponds to the GCC 'const' attribute.
bool doesNotAccessMemory(const CallBase *Call) {
- return getModRefBehavior(Call).doesNotAccessMemory();
+ return getMemoryEffects(Call).doesNotAccessMemory();
}
/// Checks if the specified function is known to never read or write memory.
@@ -415,7 +415,7 @@ class AAResults {
///
/// This property corresponds to the GCC 'const' attribute.
bool doesNotAccessMemory(const Function *F) {
- return getModRefBehavior(F).doesNotAccessMemory();
+ return getMemoryEffects(F).doesNotAccessMemory();
}
/// Checks if the specified call is known to only read from non-volatile
@@ -428,7 +428,7 @@ class AAResults {
///
/// This property corresponds to the GCC 'pure' attribute.
bool onlyReadsMemory(const CallBase *Call) {
- return getModRefBehavior(Call).onlyReadsMemory();
+ return getMemoryEffects(Call).onlyReadsMemory();
}
/// Checks if the specified function is known to only read from non-volatile
@@ -441,7 +441,7 @@ class AAResults {
///
/// This property corresponds to the GCC 'pure' attribute.
bool onlyReadsMemory(const Function *F) {
- return getModRefBehavior(F).onlyReadsMemory();
+ return getMemoryEffects(F).onlyReadsMemory();
}
/// getModRefInfo (for call sites) - Return information about whether
@@ -645,7 +645,7 @@ class AAResults {
ModRefInfo callCapturesBefore(const Instruction *I,
const MemoryLocation &MemLoc, DominatorTree *DT,
AAQueryInfo &AAQIP);
- MemoryEffects getModRefBehavior(const CallBase *Call, AAQueryInfo &AAQI);
+ MemoryEffects getMemoryEffects(const CallBase *Call, AAQueryInfo &AAQI);
private:
class Concept;
@@ -700,8 +700,8 @@ class BatchAAResults {
ModRefInfo getArgModRefInfo(const CallBase *Call, unsigned ArgIdx) {
return AA.getArgModRefInfo(Call, ArgIdx);
}
- MemoryEffects getModRefBehavior(const CallBase *Call) {
- return AA.getModRefBehavior(Call, AAQI);
+ MemoryEffects getMemoryEffects(const CallBase *Call) {
+ return AA.getMemoryEffects(Call, AAQI);
}
bool isMustAlias(const MemoryLocation &LocA, const MemoryLocation &LocB) {
return alias(LocA, LocB) == AliasResult::MustAlias;
@@ -765,11 +765,11 @@ class AAResults::Concept {
unsigned ArgIdx) = 0;
/// Return the behavior of the given call site.
- virtual MemoryEffects getModRefBehavior(const CallBase *Call,
- AAQueryInfo &AAQI) = 0;
+ virtual MemoryEffects getMemoryEffects(const CallBase *Call,
+ AAQueryInfo &AAQI) = 0;
/// Return the behavior when calling the given function.
- virtual MemoryEffects getModRefBehavior(const Function *F) = 0;
+ virtual MemoryEffects getMemoryEffects(const Function *F) = 0;
/// getModRefInfo (for call sites) - Return information about whether
/// a particular call site modifies or reads the specified memory location.
@@ -813,13 +813,13 @@ template <typename AAResultT> class AAResults::Model final : public Concept {
return Result.getArgModRefInfo(Call, ArgIdx);
}
- MemoryEffects getModRefBehavior(const CallBase *Call,
- AAQueryInfo &AAQI) override {
- return Result.getModRefBehavior(Call, AAQI);
+ MemoryEffects getMemoryEffects(const CallBase *Call,
+ AAQueryInfo &AAQI) override {
+ return Result.getMemoryEffects(Call, AAQI);
}
- MemoryEffects getModRefBehavior(const Function *F) override {
- return Result.getModRefBehavior(F);
+ MemoryEffects getMemoryEffects(const Function *F) override {
+ return Result.getMemoryEffects(F);
}
ModRefInfo getModRefInfo(const CallBase *Call, const MemoryLocation &Loc,
@@ -868,11 +868,11 @@ class AAResultBase {
return ModRefInfo::ModRef;
}
- MemoryEffects getModRefBehavior(const CallBase *Call, AAQueryInfo &AAQI) {
+ MemoryEffects getMemoryEffects(const CallBase *Call, AAQueryInfo &AAQI) {
return MemoryEffects::unknown();
}
- MemoryEffects getModRefBehavior(const Function *F) {
+ MemoryEffects getMemoryEffects(const Function *F) {
return MemoryEffects::unknown();
}
diff --git a/llvm/include/llvm/Analysis/BasicAliasAnalysis.h b/llvm/include/llvm/Analysis/BasicAliasAnalysis.h
index 21f46dc268df..d775366ab899 100644
--- a/llvm/include/llvm/Analysis/BasicAliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/BasicAliasAnalysis.h
@@ -83,11 +83,11 @@ class BasicAAResult : public AAResultBase {
ModRefInfo getArgModRefInfo(const CallBase *Call, unsigned ArgIdx);
/// Returns the behavior when calling the given call site.
- MemoryEffects getModRefBehavior(const CallBase *Call, AAQueryInfo &AAQI);
+ MemoryEffects getMemoryEffects(const CallBase *Call, AAQueryInfo &AAQI);
/// Returns the behavior when calling the given function. For use when the
/// call site is not known.
- MemoryEffects getModRefBehavior(const Function *Fn);
+ MemoryEffects getMemoryEffects(const Function *Fn);
private:
struct DecomposedGEP;
diff --git a/llvm/include/llvm/Analysis/GlobalsModRef.h b/llvm/include/llvm/Analysis/GlobalsModRef.h
index 479b8041fc46..1aabcf07dbd0 100644
--- a/llvm/include/llvm/Analysis/GlobalsModRef.h
+++ b/llvm/include/llvm/Analysis/GlobalsModRef.h
@@ -100,11 +100,11 @@ class GlobalsAAResult : public AAResultBase {
ModRefInfo getModRefInfo(const CallBase *Call, const MemoryLocation &Loc,
AAQueryInfo &AAQI);
- using AAResultBase::getModRefBehavior;
- /// getModRefBehavior - Return the behavior of the specified function if
+ using AAResultBase::getMemoryEffects;
+ /// getMemoryEffects - Return the behavior of the specified function if
/// called from the specified call site. The call site may be null in which
/// case the most generic behavior of this function should be returned.
- MemoryEffects getModRefBehavior(const Function *F);
+ MemoryEffects getMemoryEffects(const Function *F);
private:
FunctionInfo *getFunctionInfo(const Function *F);
diff --git a/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h b/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h
index 8bc7fccff92f..f99fce707b93 100644
--- a/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h
@@ -55,8 +55,8 @@ class ObjCARCAAResult : public AAResultBase {
bool pointsToConstantMemory(const MemoryLocation &Loc, AAQueryInfo &AAQI,
bool OrLocal);
- using AAResultBase::getModRefBehavior;
- MemoryEffects getModRefBehavior(const Function *F);
+ using AAResultBase::getMemoryEffects;
+ MemoryEffects getMemoryEffects(const Function *F);
using AAResultBase::getModRefInfo;
ModRefInfo getModRefInfo(const CallBase *Call, const MemoryLocation &Loc,
diff --git a/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h b/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h
index 7d74b9a02b55..2e7af99ed495 100644
--- a/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h
@@ -42,8 +42,8 @@ class TypeBasedAAResult : public AAResultBase {
AAQueryInfo &AAQI);
bool pointsToConstantMemory(const MemoryLocation &Loc, AAQueryInfo &AAQI,
bool OrLocal);
- MemoryEffects getModRefBehavior(const CallBase *Call, AAQueryInfo &AAQI);
- MemoryEffects getModRefBehavior(const Function *F);
+ MemoryEffects getMemoryEffects(const CallBase *Call, AAQueryInfo &AAQI);
+ MemoryEffects getMemoryEffects(const Function *F);
ModRefInfo getModRefInfo(const CallBase *Call, const MemoryLocation &Loc,
AAQueryInfo &AAQI);
ModRefInfo getModRefInfo(const CallBase *Call1, const CallBase *Call2,
diff --git a/llvm/lib/Analysis/AliasAnalysis.cpp b/llvm/lib/Analysis/AliasAnalysis.cpp
index bf724b318d62..09d33cfe1475 100644
--- a/llvm/lib/Analysis/AliasAnalysis.cpp
+++ b/llvm/lib/Analysis/AliasAnalysis.cpp
@@ -226,7 +226,7 @@ ModRefInfo AAResults::getModRefInfo(const CallBase *Call,
// We can completely ignore inaccessible memory here, because MemoryLocations
// can only reference accessible memory.
- auto ME = getModRefBehavior(Call, AAQI)
+ auto ME = getMemoryEffects(Call, AAQI)
.getWithoutLoc(MemoryEffects::InaccessibleMem);
if (ME.doesNotAccessMemory())
return ModRefInfo::NoModRef;
@@ -283,11 +283,11 @@ ModRefInfo AAResults::getModRefInfo(const CallBase *Call1,
// aggregate set of AA results.
// If Call1 or Call2 are readnone, they don't interact.
- auto Call1B = getModRefBehavior(Call1, AAQI);
+ auto Call1B = getMemoryEffects(Call1, AAQI);
if (Call1B.doesNotAccessMemory())
return ModRefInfo::NoModRef;
- auto Call2B = getModRefBehavior(Call2, AAQI);
+ auto Call2B = getMemoryEffects(Call2, AAQI);
if (Call2B.doesNotAccessMemory())
return ModRefInfo::NoModRef;
@@ -374,12 +374,12 @@ ModRefInfo AAResults::getModRefInfo(const CallBase *Call1,
return Result;
}
-MemoryEffects AAResults::getModRefBehavior(const CallBase *Call,
- AAQueryInfo &AAQI) {
+MemoryEffects AAResults::getMemoryEffects(const CallBase *Call,
+ AAQueryInfo &AAQI) {
MemoryEffects Result = MemoryEffects::unknown();
for (const auto &AA : AAs) {
- Result &= AA->getModRefBehavior(Call, AAQI);
+ Result &= AA->getMemoryEffects(Call, AAQI);
// Early-exit the moment we reach the bottom of the lattice.
if (Result.doesNotAccessMemory())
@@ -389,16 +389,16 @@ MemoryEffects AAResults::getModRefBehavior(const CallBase *Call,
return Result;
}
-MemoryEffects AAResults::getModRefBehavior(const CallBase *Call) {
+MemoryEffects AAResults::getMemoryEffects(const CallBase *Call) {
SimpleAAQueryInfo AAQI(*this);
- return getModRefBehavior(Call, AAQI);
+ return getMemoryEffects(Call, AAQI);
}
-MemoryEffects AAResults::getModRefBehavior(const Function *F) {
+MemoryEffects AAResults::getMemoryEffects(const Function *F) {
MemoryEffects Result = MemoryEffects::unknown();
for (const auto &AA : AAs) {
- Result &= AA->getModRefBehavior(F);
+ Result &= AA->getMemoryEffects(F);
// Early-exit the moment we reach the bottom of the lattice.
if (Result.doesNotAccessMemory())
@@ -655,7 +655,7 @@ ModRefInfo AAResults::getModRefInfo(const Instruction *I,
AAQueryInfo &AAQIP) {
if (OptLoc == None) {
if (const auto *Call = dyn_cast<CallBase>(I))
- return getModRefBehavior(Call, AAQIP).getModRef();
+ return getMemoryEffects(Call, AAQIP).getModRef();
}
const MemoryLocation &Loc = OptLoc.value_or(MemoryLocation());
diff --git a/llvm/lib/Analysis/AliasSetTracker.cpp b/llvm/lib/Analysis/AliasSetTracker.cpp
index a7939e9607dd..f092713a9b3c 100644
--- a/llvm/lib/Analysis/AliasSetTracker.cpp
+++ b/llvm/lib/Analysis/AliasSetTracker.cpp
@@ -452,7 +452,7 @@ void AliasSetTracker::add(Instruction *I) {
return AliasSet::NoAccess;
};
- ModRefInfo CallMask = AA.getModRefBehavior(Call).getModRef();
+ ModRefInfo CallMask = AA.getMemoryEffects(Call).getModRef();
// Some intrinsics are marked as modifying memory for control flow
// modelling purposes, but don't actually modify any specific memory
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
index dc64a0d9bf6b..cca539499c06 100644
--- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
@@ -740,7 +740,7 @@ static bool isIntrinsicCall(const CallBase *Call, Intrinsic::ID IID) {
return II && II->getIntrinsicID() == IID;
}
-static MemoryEffects getModRefBehaviorFromAttrs(AttributeSet Attrs) {
+static MemoryEffects getMemoryEffectsFromAttrs(AttributeSet Attrs) {
if (Attrs.hasAttribute(Attribute::ReadNone))
return MemoryEffects::none();
@@ -760,13 +760,13 @@ static MemoryEffects getModRefBehaviorFromAttrs(AttributeSet Attrs) {
}
/// Returns the behavior when calling the given call site.
-MemoryEffects BasicAAResult::getModRefBehavior(const CallBase *Call,
- AAQueryInfo &AAQI) {
+MemoryEffects BasicAAResult::getMemoryEffects(const CallBase *Call,
+ AAQueryInfo &AAQI) {
MemoryEffects Min =
- getModRefBehaviorFromAttrs(Call->getAttributes().getFnAttrs());
+ getMemoryEffectsFromAttrs(Call->getAttributes().getFnAttrs());
if (const Function *F = dyn_cast<Function>(Call->getCalledOperand())) {
- MemoryEffects FuncME = AAQI.AAR.getModRefBehavior(F);
+ MemoryEffects FuncME = AAQI.AAR.getMemoryEffects(F);
// Operand bundles on the call may also read or write memory, in addition
// to the behavior of the called function.
if (Call->hasReadingOperandBundles())
@@ -781,7 +781,7 @@ MemoryEffects BasicAAResult::getModRefBehavior(const CallBase *Call,
/// Returns the behavior when calling the given function. For use when the call
/// site is not known.
-MemoryEffects BasicAAResult::getModRefBehavior(const Function *F) {
+MemoryEffects BasicAAResult::getMemoryEffects(const Function *F) {
switch (F->getIntrinsicID()) {
case Intrinsic::experimental_guard:
case Intrinsic::experimental_deoptimize:
@@ -791,7 +791,7 @@ MemoryEffects BasicAAResult::getModRefBehavior(const Function *F) {
MemoryEffects::inaccessibleMemOnly(ModRefInfo::ModRef);
}
- return getModRefBehaviorFromAttrs(F->getAttributes().getFnAttrs());
+ return getMemoryEffectsFromAttrs(F->getAttributes().getFnAttrs());
}
/// Returns true if this is a writeonly (i.e Mod only) parameter.
@@ -1013,12 +1013,12 @@ ModRefInfo BasicAAResult::getModRefInfo(const CallBase *Call1,
// possibilities for guard intrinsics.
if (isIntrinsicCall(Call1, Intrinsic::experimental_guard))
- return isModSet(getModRefBehavior(Call2, AAQI).getModRef())
+ return isModSet(getMemoryEffects(Call2, AAQI).getModRef())
? ModRefInfo::Ref
: ModRefInfo::NoModRef;
if (isIntrinsicCall(Call2, Intrinsic::experimental_guard))
- return isModSet(getModRefBehavior(Call1, AAQI).getModRef())
+ return isModSet(getMemoryEffects(Call1, AAQI).getModRef())
? ModRefInfo::Mod
: ModRefInfo::NoModRef;
diff --git a/llvm/lib/Analysis/GlobalsModRef.cpp b/llvm/lib/Analysis/GlobalsModRef.cpp
index bfa8e55e5457..1fe4aa9d414c 100644
--- a/llvm/lib/Analysis/GlobalsModRef.cpp
+++ b/llvm/lib/Analysis/GlobalsModRef.cpp
@@ -238,11 +238,11 @@ void GlobalsAAResult::DeletionCallbackHandle::deleted() {
// This object is now destroyed!
}
-MemoryEffects GlobalsAAResult::getModRefBehavior(const Function *F) {
+MemoryEffects GlobalsAAResult::getMemoryEffects(const Function *F) {
if (FunctionInfo *FI = getFunctionInfo(F))
return MemoryEffects(FI->getModRefInfo());
- return AAResultBase::getModRefBehavior(F);
+ return AAResultBase::getMemoryEffects(F);
}
/// Returns the function info for the function, or null if we don't have
@@ -577,7 +577,7 @@ void GlobalsAAResult::AnalyzeCallGraph(CallGraph &CG, Module &M) {
// Don't let dbg intrinsics affect alias info.
continue;
- MemoryEffects Behaviour = AAResultBase::getModRefBehavior(Callee);
+ MemoryEffects Behaviour = AAResultBase::getMemoryEffects(Callee);
FI.addModRefInfo(Behaviour.getModRef());
}
}
diff --git a/llvm/lib/Analysis/ObjCARCAliasAnalysis.cpp b/llvm/lib/Analysis/ObjCARCAliasAnalysis.cpp
index 3c742af4b375..b839dbbb0348 100644
--- a/llvm/lib/Analysis/ObjCARCAliasAnalysis.cpp
+++ b/llvm/lib/Analysis/ObjCARCAliasAnalysis.cpp
@@ -92,9 +92,9 @@ bool ObjCARCAAResult::pointsToConstantMemory(const MemoryLocation &Loc,
return false;
}
-MemoryEffects ObjCARCAAResult::getModRefBehavior(const Function *F) {
+MemoryEffects ObjCARCAAResult::getMemoryEffects(const Function *F) {
if (!EnableARCOpts)
- return AAResultBase::getModRefBehavior(F);
+ return AAResultBase::getMemoryEffects(F);
switch (GetFunctionClass(F)) {
case ARCInstKind::NoopCast:
@@ -103,7 +103,7 @@ MemoryEffects ObjCARCAAResult::getModRefBehavior(const Function *F) {
break;
}
- return AAResultBase::getModRefBehavior(F);
+ return AAResultBase::getMemoryEffects(F);
}
ModRefInfo ObjCARCAAResult::getModRefInfo(const CallBase *Call,
diff --git a/llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp b/llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp
index abc8a6f1fbea..8360246915e4 100644
--- a/llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp
+++ b/llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp
@@ -404,10 +404,10 @@ bool TypeBasedAAResult::pointsToConstantMemory(const MemoryLocation &Loc,
return AAResultBase::pointsToConstantMemory(Loc, AAQI, OrLocal);
}
-MemoryEffects TypeBasedAAResult::getModRefBehavior(const CallBase *Call,
- AAQueryInfo &AAQI) {
+MemoryEffects TypeBasedAAResult::getMemoryEffects(const CallBase *Call,
+ AAQueryInfo &AAQI) {
if (!EnableTBAA)
- return AAResultBase::getModRefBehavior(Call, AAQI);
+ return AAResultBase::getMemoryEffects(Call, AAQI);
// If this is an "immutable" type, the access is not observable.
if (const MDNode *M = Call->getMetadata(LLVMContext::MD_tbaa))
@@ -415,12 +415,12 @@ MemoryEffects TypeBasedAAResult::getModRefBehavior(const CallBase *Call,
(isStructPathTBAA(M) && TBAAStructTagNode(M).isTypeImmutable()))
return MemoryEffects::none();
- return AAResultBase::getModRefBehavior(Call, AAQI);
+ return AAResultBase::getMemoryEffects(Call, AAQI);
}
-MemoryEffects TypeBasedAAResult::getModRefBehavior(const Function *F) {
+MemoryEffects TypeBasedAAResult::getMemoryEffects(const Function *F) {
// Functions don't have metadata. Just chain to the next implementation.
- return AAResultBase::getModRefBehavior(F);
+ return AAResultBase::getMemoryEffects(F);
}
ModRefInfo TypeBasedAAResult::getModRefInfo(const CallBase *Call,
diff --git a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
index ca277d39ba89..d0c1350664f9 100644
--- a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
+++ b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
@@ -125,7 +125,7 @@ using SCCNodeSet = SmallSetVector<Function *, 8>;
static MemoryEffects checkFunctionMemoryAccess(Function &F, bool ThisBody,
AAResults &AAR,
const SCCNodeSet &SCCNodes) {
- MemoryEffects OrigME = AAR.getModRefBehavior(&F);
+ MemoryEffects OrigME = AAR.getMemoryEffects(&F);
if (OrigME.doesNotAccessMemory())
// Already perfect!
return OrigME;
@@ -156,7 +156,7 @@ static MemoryEffects checkFunctionMemoryAccess(Function &F, bool ThisBody,
if (!Call->hasOperandBundles() && Call->getCalledFunction() &&
SCCNodes.count(Call->getCalledFunction()))
continue;
- MemoryEffects CallME = AAR.getModRefBehavior(Call);
+ MemoryEffects CallME = AAR.getMemoryEffects(Call);
// If the call doesn't access memory, we're done.
if (CallME.doesNotAccessMemory())
diff --git a/llvm/lib/Transforms/ObjCARC/DependencyAnalysis.cpp b/llvm/lib/Transforms/ObjCARC/DependencyAnalysis.cpp
index 12c4bf38a4fe..0fea6bcc4882 100644
--- a/llvm/lib/Transforms/ObjCARC/DependencyAnalysis.cpp
+++ b/llvm/lib/Transforms/ObjCARC/DependencyAnalysis.cpp
@@ -48,7 +48,7 @@ bool llvm::objcarc::CanAlterRefCount(const Instruction *Inst, const Value *Ptr,
const auto *Call = cast<CallBase>(Inst);
// See if AliasAnalysis can help us with the call.
- MemoryEffects ME = PA.getAA()->getModRefBehavior(Call);
+ MemoryEffects ME = PA.getAA()->getMemoryEffects(Call);
if (ME.onlyReadsMemory())
return false;
if (ME.onlyAccessesArgPointees()) {
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
index 208d6a1b56a5..cddee7d3eb07 100644
--- a/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LICM.cpp
@@ -1212,7 +1212,7 @@ bool llvm::canSinkOrHoistInst(Instruction &I, AAResults *AA, DominatorTree *DT,
return true;
// Handle simple cases by querying alias analysis.
- MemoryEffects Behavior = AA->getModRefBehavior(CI);
+ MemoryEffects Behavior = AA->getMemoryEffects(CI);
if (Behavior.doesNotAccessMemory())
return true;
if (Behavior.onlyReadsMemory()) {
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp
index ad1a001eb7fc..dfb7da9b8a78 100644
--- a/llvm/lib/Transforms/Utils/InlineFunction.cpp
+++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp
@@ -1233,7 +1233,7 @@ static void AddAliasScopeMetadata(CallBase &CB, ValueToValueMapTy &VMap,
IsFuncCall = true;
if (CalleeAAR) {
- MemoryEffects ME = CalleeAAR->getModRefBehavior(Call);
+ MemoryEffects ME = CalleeAAR->getMemoryEffects(Call);
// We'll retain this knowledge without additional metadata.
if (ME.onlyAccessesInaccessibleMem())
diff --git a/llvm/unittests/Analysis/GlobalsModRefTest.cpp b/llvm/unittests/Analysis/GlobalsModRefTest.cpp
index 457b31729d82..665a9dc311eb 100644
--- a/llvm/unittests/Analysis/GlobalsModRefTest.cpp
+++ b/llvm/unittests/Analysis/GlobalsModRefTest.cpp
@@ -52,7 +52,7 @@ TEST(GlobalsModRef, OptNone) {
auto AAR = GlobalsAAResult::analyzeModule(*M, GetTLI, CG);
- EXPECT_EQ(MemoryEffects::unknown(), AAR.getModRefBehavior(&F1));
- EXPECT_EQ(MemoryEffects::none(), AAR.getModRefBehavior(&F2));
- EXPECT_EQ(MemoryEffects::readOnly(), AAR.getModRefBehavior(&F3));
+ EXPECT_EQ(MemoryEffects::unknown(), AAR.getMemoryEffects(&F1));
+ EXPECT_EQ(MemoryEffects::none(), AAR.getMemoryEffects(&F2));
+ EXPECT_EQ(MemoryEffects::readOnly(), AAR.getMemoryEffects(&F3));
}
diff --git a/polly/lib/Analysis/ScopBuilder.cpp b/polly/lib/Analysis/ScopBuilder.cpp
index 9f6f9200bd8a..09c52eb97663 100644
--- a/polly/lib/Analysis/ScopBuilder.cpp
+++ b/polly/lib/Analysis/ScopBuilder.cpp
@@ -1636,7 +1636,7 @@ bool ScopBuilder::buildAccessCallInst(MemAccInst Inst, ScopStmt *Stmt) {
auto *AF = SE.getConstant(IntegerType::getInt64Ty(CI->getContext()), 0);
auto *CalledFunction = CI->getCalledFunction();
- MemoryEffects ME = AA.getModRefBehavior(CalledFunction);
+ MemoryEffects ME = AA.getMemoryEffects(CalledFunction);
if (ME.doesNotAccessMemory())
return true;
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp
index dbdde2986ac8..c95341f8e3db 100644
--- a/polly/lib/Analysis/ScopDetection.cpp
+++ b/polly/lib/Analysis/ScopDetection.cpp
@@ -708,7 +708,7 @@ bool ScopDetection::isValidCallInst(CallInst &CI,
}
if (AllowModrefCall) {
- MemoryEffects ME = AA.getModRefBehavior(CalledFunction);
+ MemoryEffects ME = AA.getMemoryEffects(CalledFunction);
if (ME.onlyAccessesArgPointees()) {
for (const auto &Arg : CI.args()) {
if (!Arg->getType()->isPointerTy())
More information about the llvm-commits
mailing list