[PATCH] D128444: [BasicAA] Handle passthru calls in isEscapeSource()
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 24 02:01:12 PDT 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGbcadfc2595ba: [BasicAA] Handle passthru calls in isEscapeSource() (authored by nikic).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D128444/new/
https://reviews.llvm.org/D128444
Files:
llvm/lib/Analysis/BasicAliasAnalysis.cpp
llvm/test/Analysis/BasicAA/call-escape-source.ll
Index: llvm/test/Analysis/BasicAA/call-escape-source.ll
===================================================================
--- llvm/test/Analysis/BasicAA/call-escape-source.ll
+++ llvm/test/Analysis/BasicAA/call-escape-source.ll
@@ -1,11 +1,11 @@
; RUN: opt -aa-eval -print-all-alias-modref-info -disable-output < %s 2>&1 | FileCheck %s
-; FIXME: A call return value is not always an escape source, because
+; A call return value is not always an escape source, because
; CaptureTracking can look through some calls. The test is constructed to
; hit the getUnderlyingObject() recursion limit.
define i32 @test() {
; CHECK-LABEL: Function: test
-; CHECK-NEXT: NoAlias: i32* %a, i32* %p7
+; CHECK-NEXT: MustAlias: i32* %a, i32* %p7
%a = alloca i32
%p1 = call ptr @llvm.strip.invariant.group.p0(ptr %a)
%p2 = getelementptr i8, ptr %p1, i64 1
Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp
===================================================================
--- llvm/lib/Analysis/BasicAliasAnalysis.cpp
+++ llvm/lib/Analysis/BasicAliasAnalysis.cpp
@@ -106,8 +106,9 @@
/// 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128444.439674.patch
Type: text/x-patch
Size: 1635 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220624/c0c726a5/attachment.bin>
More information about the llvm-commits
mailing list