diff options
author | David Goldblatt <davidgoldblatt@fb.com> | 2023-04-24 14:12:00 -0700 |
---|---|---|
committer | David Goldblatt <davidgoldblatt@meta.com> | 2023-07-28 12:13:35 -0700 |
commit | d020fa2b29d84b877d1e43dbfb3418275857bf87 (patch) | |
tree | 81bd7032efe78f5a005f2c0abfdf1a9e914e201a /llvm/lib/Analysis/GlobalsModRef.cpp | |
parent | c75b331fc23192a8249dc5e95e053258f5fb5194 (diff) | |
download | llvm-d020fa2b29d84b877d1e43dbfb3418275857bf87.zip llvm-d020fa2b29d84b877d1e43dbfb3418275857bf87.tar.gz llvm-d020fa2b29d84b877d1e43dbfb3418275857bf87.tar.bz2 |
[AA] Skip the layer of indirection in returning conservative results.
Historically, AA implementations chained to a following implementation
to answer recursive queries. This is no longer the case, but the legacy
lives on in a confusing phrasing of the return-a-conservative-value
paths. Let's just return "don't know" directly, where appropriate; the
current two-step way is confusing.
Differential Revision: https://reviews.llvm.org/D149100
Diffstat (limited to 'llvm/lib/Analysis/GlobalsModRef.cpp')
-rw-r--r-- | llvm/lib/Analysis/GlobalsModRef.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/GlobalsModRef.cpp b/llvm/lib/Analysis/GlobalsModRef.cpp index c218b3d..527f19b 100644 --- a/llvm/lib/Analysis/GlobalsModRef.cpp +++ b/llvm/lib/Analysis/GlobalsModRef.cpp @@ -241,7 +241,7 @@ MemoryEffects GlobalsAAResult::getMemoryEffects(const Function *F) { if (FunctionInfo *FI = getFunctionInfo(F)) return MemoryEffects(FI->getModRefInfo()); - return AAResultBase::getMemoryEffects(F); + return MemoryEffects::unknown(); } /// Returns the function info for the function, or null if we don't have @@ -791,10 +791,7 @@ bool GlobalsAAResult::isNonEscapingGlobalNoAlias(const GlobalValue *GV, // FIXME: It would be good to handle other obvious no-alias cases here, but // it isn't clear how to do so reasonably without building a small version - // of BasicAA into this code. We could recurse into AAResultBase::alias - // here but that seems likely to go poorly as we're inside the - // implementation of such a query. Until then, just conservatively return - // false. + // of BasicAA into this code. return false; } while (!Inputs.empty()); @@ -892,7 +889,7 @@ AliasResult GlobalsAAResult::alias(const MemoryLocation &LocA, if ((GV1 || GV2) && GV1 != GV2) return AliasResult::NoAlias; - return AAResultBase::alias(LocA, LocB, AAQI, nullptr); + return AliasResult::MayAlias; } ModRefInfo GlobalsAAResult::getModRefInfoForArgument(const CallBase *Call, |