diff options
author | David Goldblatt <davidgoldblatt@fb.com> | 2022-12-15 19:33:10 -0800 |
---|---|---|
committer | Wenlei He <aktoon@gmail.com> | 2022-12-15 21:04:38 -0800 |
commit | 02988fce76d8a95e2bc33e80b581c3b0b2c92755 (patch) | |
tree | 8e49de3c5b99f557ae3f6e27ecc8421f053c2673 /llvm/lib/Analysis/GlobalsModRef.cpp | |
parent | b6772e6e2045ab491b41d3767f788250800f97ea (diff) | |
download | llvm-02988fce76d8a95e2bc33e80b581c3b0b2c92755.zip llvm-02988fce76d8a95e2bc33e80b581c3b0b2c92755.tar.gz llvm-02988fce76d8a95e2bc33e80b581c3b0b2c92755.tar.bz2 |
[AA] Allow for flow-sensitive analyses.
All current analyses ignore the context. We make the argument mandatory
for analyses, but optional for the query interface.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D136512
Diffstat (limited to 'llvm/lib/Analysis/GlobalsModRef.cpp')
-rw-r--r-- | llvm/lib/Analysis/GlobalsModRef.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/GlobalsModRef.cpp b/llvm/lib/Analysis/GlobalsModRef.cpp index 96f41c3..9947ef6 100644 --- a/llvm/lib/Analysis/GlobalsModRef.cpp +++ b/llvm/lib/Analysis/GlobalsModRef.cpp @@ -828,7 +828,7 @@ bool GlobalsAAResult::invalidate(Module &, const PreservedAnalyses &PA, /// 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 @@ AliasResult GlobalsAAResult::alias(const MemoryLocation &LocA, 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 @@ ModRefInfo GlobalsAAResult::getModRefInfoForArgument(const CallBase *Call, // 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; |