[llvm] 8b6f69a - [BasicAA] Add test for call incorrectly treated as escape source (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 23 07:30:38 PDT 2022
Author: Nikita Popov
Date: 2022-06-23T16:30:30+02:00
New Revision: 8b6f69a4da5baaf3748798a84dd16a2481b7ca7f
URL: https://github.com/llvm/llvm-project/commit/8b6f69a4da5baaf3748798a84dd16a2481b7ca7f
DIFF: https://github.com/llvm/llvm-project/commit/8b6f69a4da5baaf3748798a84dd16a2481b7ca7f.diff
LOG: [BasicAA] Add test for call incorrectly treated as escape source (NFC)
Added:
llvm/test/Analysis/BasicAA/call-escape-source.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/Analysis/BasicAA/call-escape-source.ll b/llvm/test/Analysis/BasicAA/call-escape-source.ll
new file mode 100644
index 0000000000000..f2068e4d6a349
--- /dev/null
+++ b/llvm/test/Analysis/BasicAA/call-escape-source.ll
@@ -0,0 +1,22 @@
+; 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
+; 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
+ %a = alloca i32
+ %p1 = call ptr @llvm.strip.invariant.group.p0(ptr %a)
+ %p2 = getelementptr i8, ptr %p1, i64 1
+ %p3 = getelementptr i8, ptr %p2, i64 -1
+ %p4 = getelementptr i8, ptr %p3, i64 1
+ %p5 = getelementptr i8, ptr %p4, i64 -1
+ %p6 = getelementptr i8, ptr %p5, i64 1
+ %p7 = getelementptr i8, ptr %p6, i64 -1
+ %v = load i32, ptr %a
+ store i32 -1, ptr %p7
+ ret i32 %v
+}
+
+declare ptr @llvm.strip.invariant.group.p0(ptr)
More information about the llvm-commits
mailing list