diff options
author | Nikita Popov <npopov@redhat.com> | 2022-06-24 11:58:16 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2022-06-24 11:59:15 +0200 |
commit | 54eff7da3c6147451b0fd4defb1421db167dc9c6 (patch) | |
tree | 58fc562f2705e7bbf73ae316aeb150985b1e3588 /llvm/lib/Analysis/BasicAliasAnalysis.cpp | |
parent | a129a371610dc342402dcdd122330369b25ff247 (diff) | |
download | llvm-54eff7da3c6147451b0fd4defb1421db167dc9c6.zip llvm-54eff7da3c6147451b0fd4defb1421db167dc9c6.tar.gz llvm-54eff7da3c6147451b0fd4defb1421db167dc9c6.tar.bz2 |
[AA] Export isEscapeSource() API (NFC)
Export API that was previously private to BasicAliasAnalysis and
will be used in D127202.
Diffstat (limited to 'llvm/lib/Analysis/BasicAliasAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/BasicAliasAnalysis.cpp | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp index 5356d62..c78f822 100644 --- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp +++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp @@ -103,30 +103,6 @@ bool BasicAAResult::invalidate(Function &Fn, const PreservedAnalyses &PA, // Useful predicates //===----------------------------------------------------------------------===// -/// Returns true if the pointer is one which would have been considered an -/// escape by isNonEscapingLocalObject. -static bool isEscapeSource(const Value *V) { - if (auto *CB = dyn_cast<CallBase>(V)) - return !isIntrinsicReturningPointerAliasingArgumentWithoutCapturing(CB, - true); - - // The load case works because isNonEscapingLocalObject considers all - // stores to be escapes (it passes true for the StoreCaptures argument - // to PointerMayBeCaptured). - if (isa<LoadInst>(V)) - return true; - - // The inttoptr case works because isNonEscapingLocalObject considers all - // means of converting or equating a pointer to an int (ptrtoint, ptr store - // which could be followed by an integer load, ptr<->int compare) as - // escaping, and objects located at well-known addresses via platform-specific - // means cannot be considered non-escaping local objects. - if (isa<IntToPtrInst>(V)) - return true; - - return false; -} - /// Returns the size of the object specified by V or UnknownSize if unknown. static uint64_t getObjectSize(const Value *V, const DataLayout &DL, const TargetLibraryInfo &TLI, |