diff --git a/llvm/include/llvm/Analysis/AliasAnalysis.h b/llvm/include/llvm/Analysis/AliasAnalysis.h --- a/llvm/include/llvm/Analysis/AliasAnalysis.h +++ b/llvm/include/llvm/Analysis/AliasAnalysis.h @@ -548,8 +548,11 @@ return canInstructionRangeModRef(I1, I2, MemoryLocation(Ptr, Size), Mode); } + // CtxI can be nullptr, in which case the query is whether or not the aliasing + // relationship holds through the entire function. AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, - AAQueryInfo &AAQI); + AAQueryInfo &AAQI, const Instruction *CtxI = nullptr); + bool pointsToConstantMemory(const MemoryLocation &Loc, AAQueryInfo &AAQI, bool OrLocal = false); ModRefInfo getModRefInfoMask(const MemoryLocation &Loc, AAQueryInfo &AAQI, @@ -684,7 +687,8 @@ /// each other. This is the interface that must be implemented by specific /// alias analysis implementations. virtual AliasResult alias(const MemoryLocation &LocA, - const MemoryLocation &LocB, AAQueryInfo &AAQI) = 0; + const MemoryLocation &LocB, AAQueryInfo &AAQI, + const Instruction *CtxI) = 0; /// @} //===--------------------------------------------------------------------===// @@ -743,8 +747,8 @@ ~Model() override = default; AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, - AAQueryInfo &AAQI) override { - return Result.alias(LocA, LocB, AAQI); + AAQueryInfo &AAQI, const Instruction *CtxI) override { + return Result.alias(LocA, LocB, AAQI, CtxI); } ModRefInfo getModRefInfoMask(const MemoryLocation &Loc, AAQueryInfo &AAQI, @@ -798,7 +802,7 @@ public: AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, - AAQueryInfo &AAQI) { + AAQueryInfo &AAQI, const Instruction *I) { return AliasResult::MayAlias; } diff --git a/llvm/include/llvm/Analysis/BasicAliasAnalysis.h b/llvm/include/llvm/Analysis/BasicAliasAnalysis.h --- a/llvm/include/llvm/Analysis/BasicAliasAnalysis.h +++ b/llvm/include/llvm/Analysis/BasicAliasAnalysis.h @@ -66,7 +66,7 @@ FunctionAnalysisManager::Invalidator &Inv); AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, - AAQueryInfo &AAQI); + AAQueryInfo &AAQI, const Instruction *CtxI); ModRefInfo getModRefInfo(const CallBase *Call, const MemoryLocation &Loc, AAQueryInfo &AAQI); diff --git a/llvm/include/llvm/Analysis/CFLAndersAliasAnalysis.h b/llvm/include/llvm/Analysis/CFLAndersAliasAnalysis.h --- a/llvm/include/llvm/Analysis/CFLAndersAliasAnalysis.h +++ b/llvm/include/llvm/Analysis/CFLAndersAliasAnalysis.h @@ -60,7 +60,7 @@ AliasResult query(const MemoryLocation &, const MemoryLocation &); AliasResult alias(const MemoryLocation &, const MemoryLocation &, - AAQueryInfo &); + AAQueryInfo &, const Instruction *CtxI); private: /// Ensures that the given function is available in the cache. diff --git a/llvm/include/llvm/Analysis/CFLSteensAliasAnalysis.h b/llvm/include/llvm/Analysis/CFLSteensAliasAnalysis.h --- a/llvm/include/llvm/Analysis/CFLSteensAliasAnalysis.h +++ b/llvm/include/llvm/Analysis/CFLSteensAliasAnalysis.h @@ -67,7 +67,7 @@ AliasResult query(const MemoryLocation &LocA, const MemoryLocation &LocB); AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, - AAQueryInfo &AAQI) { + AAQueryInfo &AAQI, const Instruction *) { if (LocA.Ptr == LocB.Ptr) return AliasResult::MustAlias; @@ -77,11 +77,11 @@ // ConstantExpr, but every query needs to have at least one Value tied to a // Function, and neither GlobalValues nor ConstantExprs are. if (isa(LocA.Ptr) && isa(LocB.Ptr)) - return AAResultBase::alias(LocA, LocB, AAQI); + return AAResultBase::alias(LocA, LocB, AAQI, nullptr); AliasResult QueryResult = query(LocA, LocB); if (QueryResult == AliasResult::MayAlias) - return AAResultBase::alias(LocA, LocB, AAQI); + return AAResultBase::alias(LocA, LocB, AAQI, nullptr); return QueryResult; } diff --git a/llvm/include/llvm/Analysis/GlobalsModRef.h b/llvm/include/llvm/Analysis/GlobalsModRef.h --- a/llvm/include/llvm/Analysis/GlobalsModRef.h +++ b/llvm/include/llvm/Analysis/GlobalsModRef.h @@ -94,7 +94,7 @@ // Implement the AliasAnalysis API // AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, - AAQueryInfo &AAQI); + AAQueryInfo &AAQI, const Instruction *CtxI); using AAResultBase::getModRefInfo; ModRefInfo getModRefInfo(const CallBase *Call, const MemoryLocation &Loc, diff --git a/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h b/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h --- a/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h +++ b/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h @@ -51,7 +51,7 @@ } AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, - AAQueryInfo &AAQI); + AAQueryInfo &AAQI, const Instruction *CtxI); ModRefInfo getModRefInfoMask(const MemoryLocation &Loc, AAQueryInfo &AAQI, bool IgnoreLocals); diff --git a/llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h b/llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h --- a/llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h +++ b/llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h @@ -32,7 +32,7 @@ SCEVAAResult(SCEVAAResult &&Arg) : AAResultBase(std::move(Arg)), SE(Arg.SE) {} AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, - AAQueryInfo &AAQI); + AAQueryInfo &AAQI, const Instruction *CtxI); bool invalidate(Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &Inv); diff --git a/llvm/include/llvm/Analysis/ScopedNoAliasAA.h b/llvm/include/llvm/Analysis/ScopedNoAliasAA.h --- a/llvm/include/llvm/Analysis/ScopedNoAliasAA.h +++ b/llvm/include/llvm/Analysis/ScopedNoAliasAA.h @@ -37,7 +37,7 @@ } AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, - AAQueryInfo &AAQI); + AAQueryInfo &AAQI, const Instruction *CtxI); ModRefInfo getModRefInfo(const CallBase *Call, const MemoryLocation &Loc, AAQueryInfo &AAQI); ModRefInfo getModRefInfo(const CallBase *Call1, const CallBase *Call2, diff --git a/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h b/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h --- a/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h +++ b/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h @@ -39,9 +39,10 @@ } AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, - AAQueryInfo &AAQI); + AAQueryInfo &AAQI, const Instruction *CtxI); ModRefInfo getModRefInfoMask(const MemoryLocation &Loc, AAQueryInfo &AAQI, bool IgnoreLocals); + MemoryEffects getMemoryEffects(const CallBase *Call, AAQueryInfo &AAQI); MemoryEffects getMemoryEffects(const Function *F); ModRefInfo getModRefInfo(const CallBase *Call, const MemoryLocation &Loc, diff --git a/llvm/lib/Analysis/AliasAnalysis.cpp b/llvm/lib/Analysis/AliasAnalysis.cpp --- a/llvm/lib/Analysis/AliasAnalysis.cpp +++ b/llvm/lib/Analysis/AliasAnalysis.cpp @@ -107,11 +107,12 @@ AliasResult AAResults::alias(const MemoryLocation &LocA, const MemoryLocation &LocB) { SimpleAAQueryInfo AAQIP(*this); - return alias(LocA, LocB, AAQIP); + return alias(LocA, LocB, AAQIP, nullptr); } AliasResult AAResults::alias(const MemoryLocation &LocA, - const MemoryLocation &LocB, AAQueryInfo &AAQI) { + const MemoryLocation &LocB, AAQueryInfo &AAQI, + const Instruction *CtxI) { AliasResult Result = AliasResult::MayAlias; if (EnableAATrace) { @@ -123,7 +124,7 @@ AAQI.Depth++; for (const auto &AA : AAs) { - Result = AA->alias(LocA, LocB, AAQI); + Result = AA->alias(LocA, LocB, AAQI, CtxI); if (Result != AliasResult::MayAlias) break; } @@ -245,7 +246,7 @@ continue; unsigned ArgIdx = I.index(); MemoryLocation ArgLoc = MemoryLocation::getForArgument(Call, ArgIdx, TLI); - AliasResult ArgAlias = alias(ArgLoc, Loc, AAQI); + AliasResult ArgAlias = alias(ArgLoc, Loc, AAQI, Call); if (ArgAlias != AliasResult::NoAlias) AllArgsMask |= getArgModRefInfo(Call, ArgIdx); } @@ -474,7 +475,7 @@ // If the load address doesn't alias the given address, it doesn't read // or write the specified memory. if (Loc.Ptr) { - AliasResult AR = alias(MemoryLocation::get(L), Loc, AAQI); + AliasResult AR = alias(MemoryLocation::get(L), Loc, AAQI, L); if (AR == AliasResult::NoAlias) return ModRefInfo::NoModRef; } @@ -490,7 +491,7 @@ return ModRefInfo::ModRef; if (Loc.Ptr) { - AliasResult AR = alias(MemoryLocation::get(S), Loc, AAQI); + AliasResult AR = alias(MemoryLocation::get(S), Loc, AAQI, S); // If the store address cannot alias the pointer in question, then the // specified memory cannot be modified by the store. if (AR == AliasResult::NoAlias) @@ -523,7 +524,7 @@ const MemoryLocation &Loc, AAQueryInfo &AAQI) { if (Loc.Ptr) { - AliasResult AR = alias(MemoryLocation::get(V), Loc, AAQI); + AliasResult AR = alias(MemoryLocation::get(V), Loc, AAQI, V); // If the va_arg address cannot alias the pointer in question, then the // specified memory cannot be accessed by the va_arg. if (AR == AliasResult::NoAlias) @@ -572,7 +573,7 @@ return ModRefInfo::ModRef; if (Loc.Ptr) { - AliasResult AR = alias(MemoryLocation::get(CX), Loc, AAQI); + AliasResult AR = alias(MemoryLocation::get(CX), Loc, AAQI, CX); // If the cmpxchg address does not alias the location, it does not access // it. if (AR == AliasResult::NoAlias) @@ -590,7 +591,7 @@ return ModRefInfo::ModRef; if (Loc.Ptr) { - AliasResult AR = alias(MemoryLocation::get(RMW), Loc, AAQI); + AliasResult AR = alias(MemoryLocation::get(RMW), Loc, AAQI, RMW); // If the atomicrmw address does not alias the location, it does not access // it. if (AR == AliasResult::NoAlias) @@ -678,9 +679,9 @@ !Call->isByValArgument(ArgNo))) continue; - AliasResult AR = alias( - MemoryLocation::getBeforeOrAfter(*CI), - MemoryLocation::getBeforeOrAfter(Object), AAQI); + AliasResult AR = + alias(MemoryLocation::getBeforeOrAfter(*CI), + MemoryLocation::getBeforeOrAfter(Object), AAQI, Call); // If this is a no-capture pointer argument, see if we can tell that it // is impossible to alias the pointer we're checking. If not, we have to // assume that the call could touch the pointer, even though it doesn't diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp --- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp +++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp @@ -825,8 +825,8 @@ #endif AliasResult BasicAAResult::alias(const MemoryLocation &LocA, - const MemoryLocation &LocB, - AAQueryInfo &AAQI) { + const MemoryLocation &LocB, AAQueryInfo &AAQI, + const Instruction *) { assert(notDifferentParent(LocA.Ptr, LocB.Ptr) && "BasicAliasAnalysis doesn't support interprocedural queries."); return aliasCheck(LocA.Ptr, LocA.Size, LocB.Ptr, LocB.Size, AAQI); diff --git a/llvm/lib/Analysis/CFLAndersAliasAnalysis.cpp b/llvm/lib/Analysis/CFLAndersAliasAnalysis.cpp --- a/llvm/lib/Analysis/CFLAndersAliasAnalysis.cpp +++ b/llvm/lib/Analysis/CFLAndersAliasAnalysis.cpp @@ -879,7 +879,8 @@ AliasResult CFLAndersAAResult::alias(const MemoryLocation &LocA, const MemoryLocation &LocB, - AAQueryInfo &AAQI) { + AAQueryInfo &AAQI, + const Instruction *CtxI) { if (LocA.Ptr == LocB.Ptr) return AliasResult::MustAlias; @@ -889,11 +890,11 @@ // ConstantExpr, but every query needs to have at least one Value tied to a // Function, and neither GlobalValues nor ConstantExprs are. if (isa(LocA.Ptr) && isa(LocB.Ptr)) - return AAResultBase::alias(LocA, LocB, AAQI); + return AAResultBase::alias(LocA, LocB, AAQI, CtxI); AliasResult QueryResult = query(LocA, LocB); if (QueryResult == AliasResult::MayAlias) - return AAResultBase::alias(LocA, LocB, AAQI); + return AAResultBase::alias(LocA, LocB, AAQI, CtxI); return QueryResult; } diff --git a/llvm/lib/Analysis/GlobalsModRef.cpp b/llvm/lib/Analysis/GlobalsModRef.cpp --- a/llvm/lib/Analysis/GlobalsModRef.cpp +++ b/llvm/lib/Analysis/GlobalsModRef.cpp @@ -828,7 +828,7 @@ /// address of the global isn't taken. AliasResult GlobalsAAResult::alias(const MemoryLocation &LocA, const MemoryLocation &LocB, - AAQueryInfo &AAQI) { + AAQueryInfo &AAQI, const Instruction *) { // Get the base object these pointers point to. const Value *UV1 = getUnderlyingObject(LocA.Ptr->stripPointerCastsForAliasAnalysis()); @@ -905,7 +905,7 @@ if ((GV1 || GV2) && GV1 != GV2) return AliasResult::NoAlias; - return AAResultBase::alias(LocA, LocB, AAQI); + return AAResultBase::alias(LocA, LocB, AAQI, nullptr); } ModRefInfo GlobalsAAResult::getModRefInfoForArgument(const CallBase *Call, @@ -927,8 +927,8 @@ // Try ::alias to see if all objects are known not to alias GV. !all_of(Objects, [&](const Value *V) { return this->alias(MemoryLocation::getBeforeOrAfter(V), - MemoryLocation::getBeforeOrAfter(GV), - AAQI) == AliasResult::NoAlias; + MemoryLocation::getBeforeOrAfter(GV), AAQI, + nullptr) == AliasResult::NoAlias; })) return ConservativeResult; diff --git a/llvm/lib/Analysis/ObjCARCAliasAnalysis.cpp b/llvm/lib/Analysis/ObjCARCAliasAnalysis.cpp --- a/llvm/lib/Analysis/ObjCARCAliasAnalysis.cpp +++ b/llvm/lib/Analysis/ObjCARCAliasAnalysis.cpp @@ -36,17 +36,17 @@ AliasResult ObjCARCAAResult::alias(const MemoryLocation &LocA, const MemoryLocation &LocB, - AAQueryInfo &AAQI) { + AAQueryInfo &AAQI, const Instruction *CtxI) { if (!EnableARCOpts) - return AAResultBase::alias(LocA, LocB, AAQI); + return AAResultBase::alias(LocA, LocB, AAQI, CtxI); // First, strip off no-ops, including ObjC-specific no-ops, and try making a // precise alias query. const Value *SA = GetRCIdentityRoot(LocA.Ptr); const Value *SB = GetRCIdentityRoot(LocB.Ptr); - AliasResult Result = - AAResultBase::alias(MemoryLocation(SA, LocA.Size, LocA.AATags), - MemoryLocation(SB, LocB.Size, LocB.AATags), AAQI); + AliasResult Result = AAResultBase::alias( + MemoryLocation(SA, LocA.Size, LocA.AATags), + MemoryLocation(SB, LocB.Size, LocB.AATags), AAQI, CtxI); if (Result != AliasResult::MayAlias) return Result; @@ -55,8 +55,9 @@ const Value *UA = GetUnderlyingObjCPtr(SA); const Value *UB = GetUnderlyingObjCPtr(SB); if (UA != SA || UB != SB) { - Result = AAResultBase::alias(MemoryLocation::getBeforeOrAfter(UA), - MemoryLocation::getBeforeOrAfter(UB), AAQI); + Result = + AAResultBase::alias(MemoryLocation::getBeforeOrAfter(UA), + MemoryLocation::getBeforeOrAfter(UB), AAQI, CtxI); // We can't use MustAlias or PartialAlias results here because // GetUnderlyingObjCPtr may return an offsetted pointer value. if (Result == AliasResult::NoAlias) diff --git a/llvm/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp b/llvm/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp --- a/llvm/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp +++ b/llvm/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp @@ -34,7 +34,8 @@ } AliasResult SCEVAAResult::alias(const MemoryLocation &LocA, - const MemoryLocation &LocB, AAQueryInfo &AAQI) { + const MemoryLocation &LocB, AAQueryInfo &AAQI, + const Instruction *) { // If either of the memory references is empty, it doesn't matter what the // pointer values are. This allows the code below to ignore this special // case. @@ -101,11 +102,11 @@ BO ? LocationSize::beforeOrAfterPointer() : LocB.Size, BO ? AAMDNodes() : LocB.AATags), - AAQI) == AliasResult::NoAlias) + AAQI, nullptr) == AliasResult::NoAlias) return AliasResult::NoAlias; // Forward the query to the next analysis. - return AAResultBase::alias(LocA, LocB, AAQI); + return AAResultBase::alias(LocA, LocB, AAQI, nullptr); } /// Given an expression, try to find a base value. diff --git a/llvm/lib/Analysis/ScopedNoAliasAA.cpp b/llvm/lib/Analysis/ScopedNoAliasAA.cpp --- a/llvm/lib/Analysis/ScopedNoAliasAA.cpp +++ b/llvm/lib/Analysis/ScopedNoAliasAA.cpp @@ -53,9 +53,10 @@ AliasResult ScopedNoAliasAAResult::alias(const MemoryLocation &LocA, const MemoryLocation &LocB, - AAQueryInfo &AAQI) { + AAQueryInfo &AAQI, + const Instruction *CtxI) { if (!EnableScopedNoAlias) - return AAResultBase::alias(LocA, LocB, AAQI); + return AAResultBase::alias(LocA, LocB, AAQI, CtxI); // Get the attached MDNodes. const MDNode *AScopes = LocA.AATags.Scope, *BScopes = LocB.AATags.Scope; @@ -69,7 +70,7 @@ return AliasResult::NoAlias; // If they may alias, chain to the next AliasAnalysis. - return AAResultBase::alias(LocA, LocB, AAQI); + return AAResultBase::alias(LocA, LocB, AAQI, CtxI); } ModRefInfo ScopedNoAliasAAResult::getModRefInfo(const CallBase *Call, diff --git a/llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp b/llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp --- a/llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp +++ b/llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp @@ -373,13 +373,14 @@ AliasResult TypeBasedAAResult::alias(const MemoryLocation &LocA, const MemoryLocation &LocB, - AAQueryInfo &AAQI) { + AAQueryInfo &AAQI, + const Instruction *CtxI) { if (!EnableTBAA) - return AAResultBase::alias(LocA, LocB, AAQI); + return AAResultBase::alias(LocA, LocB, AAQI, CtxI); // If accesses may alias, chain to the next AliasAnalysis. if (Aliases(LocA.AATags.TBAA, LocB.AATags.TBAA)) - return AAResultBase::alias(LocA, LocB, AAQI); + return AAResultBase::alias(LocA, LocB, AAQI, CtxI); // Otherwise return a definitive result. return AliasResult::NoAlias; diff --git a/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.h b/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.h --- a/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.h +++ b/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.h @@ -37,7 +37,7 @@ } AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, - AAQueryInfo &AAQI); + AAQueryInfo &AAQI, const Instruction *CtxI); ModRefInfo getModRefInfoMask(const MemoryLocation &Loc, AAQueryInfo &AAQI, bool IgnoreLocals); }; diff --git a/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp b/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp --- a/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp @@ -73,8 +73,8 @@ } AliasResult AMDGPUAAResult::alias(const MemoryLocation &LocA, - const MemoryLocation &LocB, - AAQueryInfo &AAQI) { + const MemoryLocation &LocB, AAQueryInfo &AAQI, + const Instruction *CtxI) { unsigned asA = LocA.Ptr->getType()->getPointerAddressSpace(); unsigned asB = LocB.Ptr->getType()->getPointerAddressSpace(); @@ -121,7 +121,7 @@ } // Forward the query to the next alias analysis. - return AAResultBase::alias(LocA, LocB, AAQI); + return AAResultBase::alias(LocA, LocB, AAQI, CtxI); } ModRefInfo AMDGPUAAResult::getModRefInfoMask(const MemoryLocation &Loc, diff --git a/llvm/unittests/Analysis/AliasAnalysisTest.cpp b/llvm/unittests/Analysis/AliasAnalysisTest.cpp --- a/llvm/unittests/Analysis/AliasAnalysisTest.cpp +++ b/llvm/unittests/Analysis/AliasAnalysisTest.cpp @@ -85,7 +85,7 @@ bool invalidate(Function &, const PreservedAnalyses &) { return false; } AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, - AAQueryInfo &AAQI) { + AAQueryInfo &AAQI, const Instruction *) { CB(); return AliasResult::MayAlias; } diff --git a/llvm/unittests/Analysis/BasicAliasAnalysisTest.cpp b/llvm/unittests/Analysis/BasicAliasAnalysisTest.cpp --- a/llvm/unittests/Analysis/BasicAliasAnalysisTest.cpp +++ b/llvm/unittests/Analysis/BasicAliasAnalysisTest.cpp @@ -96,12 +96,14 @@ AAQueryInfo &AAQI = AllAnalyses.AAQI; ASSERT_EQ( BasicAA.alias(MemoryLocation(IncomingI32Ptr, LocationSize::precise(4)), - MemoryLocation(GlobalPtr, LocationSize::precise(1)), AAQI), + MemoryLocation(GlobalPtr, LocationSize::precise(1)), AAQI, + nullptr), AliasResult::NoAlias); ASSERT_EQ( BasicAA.alias(MemoryLocation(IncomingI32Ptr, LocationSize::upperBound(4)), - MemoryLocation(GlobalPtr, LocationSize::precise(1)), AAQI), + MemoryLocation(GlobalPtr, LocationSize::precise(1)), AAQI, + nullptr), AliasResult::MayAlias); } @@ -126,13 +128,13 @@ ASSERT_EQ(BasicAA.alias( MemoryLocation(I8, LocationSize::precise(2)), MemoryLocation(I8AtUncertainOffset, LocationSize::precise(1)), - AAQI), + AAQI, nullptr), AliasResult::PartialAlias); ASSERT_EQ(BasicAA.alias( MemoryLocation(I8, LocationSize::upperBound(2)), MemoryLocation(I8AtUncertainOffset, LocationSize::precise(1)), - AAQI), + AAQI, nullptr), AliasResult::MayAlias); } @@ -171,9 +173,9 @@ auto &AllAnalyses = setupAnalyses(); BasicAAResult &BasicAA = AllAnalyses.BAA; AAQueryInfo &AAQI = AllAnalyses.AAQI; - AliasResult AR = - BasicAA.alias(MemoryLocation(Ptr, LocationSize::precise(2)), - MemoryLocation(Phi, LocationSize::precise(1)), AAQI); + AliasResult AR = BasicAA.alias(MemoryLocation(Ptr, LocationSize::precise(2)), + MemoryLocation(Phi, LocationSize::precise(1)), + AAQI, nullptr); ASSERT_EQ(AR.getOffset(), 1); } @@ -198,8 +200,8 @@ auto &AllAnalyses = setupAnalyses(); BasicAAResult &BasicAA = AllAnalyses.BAA; AAQueryInfo &AAQI = AllAnalyses.AAQI; - AliasResult AR = - BasicAA.alias(MemoryLocation(Ptr, LocationSize::precise(2)), - MemoryLocation(Select, LocationSize::precise(1)), AAQI); + AliasResult AR = BasicAA.alias( + MemoryLocation(Ptr, LocationSize::precise(2)), + MemoryLocation(Select, LocationSize::precise(1)), AAQI, nullptr); ASSERT_EQ(AR.getOffset(), 1); }