[AA] Rename getModRefBehavior() to getMemoryEffects() (NFC)
Follow up on D135962, renaming the method name to match the new type name.
This commit is contained in:
parent
1a9d9823c5
commit
747f27d97d
|
@ -383,10 +383,10 @@ public:
|
|||
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 @@ public:
|
|||
///
|
||||
/// 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 @@ public:
|
|||
///
|
||||
/// 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 @@ public:
|
|||
///
|
||||
/// 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 @@ public:
|
|||
///
|
||||
/// 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 @@ public:
|
|||
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 @@ public:
|
|||
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 @@ public:
|
|||
unsigned ArgIdx) = 0;
|
||||
|
||||
/// Return the behavior of the given call site.
|
||||
virtual MemoryEffects getModRefBehavior(const CallBase *Call,
|
||||
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 @@ public:
|
|||
return Result.getArgModRefInfo(Call, ArgIdx);
|
||||
}
|
||||
|
||||
MemoryEffects getModRefBehavior(const CallBase *Call,
|
||||
MemoryEffects getMemoryEffects(const CallBase *Call,
|
||||
AAQueryInfo &AAQI) override {
|
||||
return Result.getModRefBehavior(Call, AAQI);
|
||||
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 @@ public:
|
|||
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();
|
||||
}
|
||||
|
||||
|
|
|
@ -83,11 +83,11 @@ public:
|
|||
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;
|
||||
|
|
|
@ -100,11 +100,11 @@ public:
|
|||
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);
|
||||
|
|
|
@ -55,8 +55,8 @@ public:
|
|||
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,
|
||||
|
|
|
@ -42,8 +42,8 @@ public:
|
|||
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,
|
||||
|
|
|
@ -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,
|
||||
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());
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
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;
|
||||
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -404,10 +404,10 @@ bool TypeBasedAAResult::pointsToConstantMemory(const MemoryLocation &Loc,
|
|||
return AAResultBase::pointsToConstantMemory(Loc, AAQI, OrLocal);
|
||||
}
|
||||
|
||||
MemoryEffects TypeBasedAAResult::getModRefBehavior(const CallBase *Call,
|
||||
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,
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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())
|
||||
|
|
Loading…
Reference in New Issue