diff options
author | Nikita Popov <npopov@redhat.com> | 2022-06-23 16:36:16 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2022-06-24 11:00:57 +0200 |
commit | bcadfc2595ba25e77145fc8d9f57981ac52b9348 (patch) | |
tree | 4ade6a44f07a1ce5c58d26b183be980a81376b4a /llvm/lib/Analysis/BasicAliasAnalysis.cpp | |
parent | 703b1054e93b7fb1ce88a797f3f63feab6b5a4f7 (diff) | |
download | llvm-bcadfc2595ba25e77145fc8d9f57981ac52b9348.zip llvm-bcadfc2595ba25e77145fc8d9f57981ac52b9348.tar.gz llvm-bcadfc2595ba25e77145fc8d9f57981ac52b9348.tar.bz2 |
[BasicAA] Handle passthru calls in isEscapeSource()
isEscapeSource() currently considers all call return values as
escape sources. However, CaptureTracking can look through certain
calls, so we shouldn't consider these as escape sources either.
The corresponding CaptureTracking code is:
https://github.com/llvm/llvm-project/blob/7c9a3825b8420f5d37c5bb8919a9e46684a87089/llvm/lib/Analysis/CaptureTracking.cpp#L332-L333
Differential Revision: https://reviews.llvm.org/D128444
Diffstat (limited to 'llvm/lib/Analysis/BasicAliasAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/BasicAliasAnalysis.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp index 11b71fe..5356d62 100644 --- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp +++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp @@ -106,8 +106,9 @@ bool BasicAAResult::invalidate(Function &Fn, const PreservedAnalyses &PA, /// Returns true if the pointer is one which would have been considered an /// escape by isNonEscapingLocalObject. static bool isEscapeSource(const Value *V) { - if (isa<CallBase>(V)) - return true; + 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 |