[llvm] 2538a41 - [test][RPOFuncAttrs] Update norecurse.ll
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 17 15:58:05 PDT 2022
Author: Arthur Eubanks
Date: 2022-06-17T15:55:45-07:00
New Revision: 2538a411ff2a217b10f1036fbd4312e7ccc07276
URL: https://github.com/llvm/llvm-project/commit/2538a411ff2a217b10f1036fbd4312e7ccc07276
DIFF: https://github.com/llvm/llvm-project/commit/2538a411ff2a217b10f1036fbd4312e7ccc07276.diff
LOG: [test][RPOFuncAttrs] Update norecurse.ll
Use opaque pointers, remove obsolete FIXMEs, precommit test.
Add extra `CHECK-NOT: norecurse`s because it can appear before the checked attributes.
Added:
Modified:
llvm/test/Transforms/FunctionAttrs/norecurse.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/FunctionAttrs/norecurse.ll b/llvm/test/Transforms/FunctionAttrs/norecurse.ll
index af63da176d5cf..b1130b93d23d7 100644
--- a/llvm/test/Transforms/FunctionAttrs/norecurse.ll
+++ b/llvm/test/Transforms/FunctionAttrs/norecurse.ll
@@ -1,4 +1,3 @@
-; RUN: opt < %s -basic-aa -function-attrs -rpo-function-attrs -S | FileCheck %s
; RUN: opt < %s -aa-pipeline=basic-aa -passes='cgscc(function-attrs),rpo-function-attrs' -S | FileCheck %s
; CHECK: Function Attrs
@@ -9,6 +8,7 @@ define i32 @leaf() {
}
; CHECK: Function Attrs
+; CHECK-NOT: norecurse
; CHECK-SAME: readnone
; CHECK-NOT: norecurse
; CHECK-NEXT: define i32 @self_rec()
@@ -18,6 +18,7 @@ define i32 @self_rec() {
}
; CHECK: Function Attrs
+; CHECK-NOT: norecurse
; CHECK-SAME: readnone
; CHECK-NOT: norecurse
; CHECK-NEXT: define i32 @indirect_rec()
@@ -26,6 +27,7 @@ define i32 @indirect_rec() {
ret i32 %a
}
; CHECK: Function Attrs
+; CHECK-NOT: norecurse
; CHECK-SAME: readnone
; CHECK-NOT: norecurse
; CHECK-NEXT: define i32 @indirect_rec2()
@@ -35,6 +37,7 @@ define i32 @indirect_rec2() {
}
; CHECK: Function Attrs
+; CHECK-NOT: norecurse
; CHECK-SAME: readnone
; CHECK-NOT: norecurse
; CHECK-NEXT: define i32 @extern()
@@ -48,21 +51,21 @@ define i32 @extern() {
declare i32 @k() readnone
; CHECK: Function Attrs
+; CHECK-NOT: norecurse
; CHECK-SAME: nounwind
; CHECK-NOT: norecurse
-; CHECK-NEXT: define void @intrinsic(i8* nocapture writeonly %dest, i8* nocapture readonly %src, i32 %len)
-define void @intrinsic(i8* %dest, i8* %src, i32 %len) {
- call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 %len, i1 false)
+; CHECK-NEXT: define void @intrinsic(ptr nocapture writeonly %dest, ptr nocapture readonly %src, i32 %len)
+define void @intrinsic(ptr %dest, ptr %src, i32 %len) {
+ call void @llvm.memcpy.p0.p0.i32(ptr %dest, ptr %src, i32 %len, i1 false)
ret void
}
; CHECK: Function Attrs
-; CHECK-NEXT: declare void @llvm.memcpy.p0i8.p0i8.i32
-declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i1)
+; CHECK-NEXT: declare void @llvm.memcpy.p0.p0.i32
+declare void @llvm.memcpy.p0.p0.i32(ptr, ptr, i32, i1)
; CHECK: Function Attrs
; CHECK-SAME: norecurse nosync readnone
-; FIXME: missing "norecurse"
; CHECK-NEXT: define internal i32 @called_by_norecurse()
define internal i32 @called_by_norecurse() {
%a = call i32 @k()
@@ -77,17 +80,40 @@ define void @m() norecurse {
; CHECK: Function Attrs
; CHECK-SAME: norecurse nosync readnone
-; FIXME: missing "norecurse"
; CHECK-NEXT: define internal i32 @called_by_norecurse_indirectly()
define internal i32 @called_by_norecurse_indirectly() {
%a = call i32 @k()
ret i32 %a
}
+; CHECK: Function Attrs
+; CHECK-NEXT: define internal void @o
define internal void @o() {
%a = call i32 @called_by_norecurse_indirectly()
ret void
}
+; CHECK: Function Attrs
+; CHECK-NEXT: define void @p
define void @p() norecurse {
call void @o()
ret void
}
+
+; CHECK: Function Attrs
+; CHECK-SAME: norecurse nosync readnone
+; CHECK-NEXT: define internal i32 @escapes_as_parameter
+define internal i32 @escapes_as_parameter(ptr %p) {
+ %a = call i32 @k()
+ ret i32 %a
+}
+; CHECK: Function Attrs
+; CHECK-NEXT: define internal void @q
+define internal void @q() {
+ %a = call i32 @escapes_as_parameter(ptr @escapes_as_parameter)
+ ret void
+}
+; CHECK: Function Attrs
+; CHECK-NEXT: define void @r
+define void @r() norecurse {
+ call void @q()
+ ret void
+}
\ No newline at end of file
More information about the llvm-commits
mailing list