1
- ; RUN: opt < %s -inline-threshold=0 -always-inline -enable-new-pm=0 -S | FileCheck %s --check-prefix=CHECK
1
+ ; RUN: opt < %s -inline-threshold=0 -always-inline -enable-new-pm=0 -S | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-CALL
2
2
;
3
3
; Ensure the threshold has no impact on these decisions.
4
- ; RUN: opt < %s -inline-threshold=20000000 -always-inline -enable-new-pm=0 -S | FileCheck %s --check-prefix=CHECK
5
- ; RUN: opt < %s -inline-threshold=-20000000 -always-inline -enable-new-pm=0 -S | FileCheck %s --check-prefix=CHECK
4
+ ; RUN: opt < %s -inline-threshold=20000000 -always-inline -enable-new-pm=0 -S | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-CALL
5
+ ; RUN: opt < %s -inline-threshold=-20000000 -always-inline -enable-new-pm=0 -S | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-CALL
6
6
;
7
7
; The new pass manager doesn't re-use any threshold based infrastructure for
8
- ; the always inliner, but test that we get the correct result.
8
+ ; the always inliner, but test that we get the correct result. The new PM
9
+ ; always inliner also doesn't support inlining call-site alwaysinline
10
+ ; annotations. It isn't clear that this is a reasonable use case for
11
+ ; 'alwaysinline'.
9
12
; RUN: opt < %s -inline-threshold=0 -passes=always-inline -S | FileCheck %s --check-prefix=CHECK
10
13
; RUN: opt < %s -inline-threshold=20000000 -passes=always-inline -S | FileCheck %s --check-prefix=CHECK
11
14
; RUN: opt < %s -inline-threshold=-20000000 -passes=always-inline -S | FileCheck %s --check-prefix=CHECK
@@ -23,6 +26,12 @@ define i32 @outer1() {
23
26
ret i32 %r
24
27
}
25
28
29
+ ; The always inliner can't DCE arbitrary internal functions. PR2945
30
+ define internal i32 @pr2945 () nounwind {
31
+ ; CHECK-LABEL: @pr2945(
32
+ ret i32 0
33
+ }
34
+
26
35
define internal void @inner2 (i32 %N ) alwaysinline {
27
36
; CHECK-NOT: @inner2(
28
37
%P = alloca i32 , i32 %N
@@ -137,9 +146,10 @@ define i32 @inner7() {
137
146
ret i32 1
138
147
}
139
148
define i32 @outer7 () {
140
- ; CHECK-LABEL: @outer7(
141
- ; CHECK-NOT: call
142
- ; CHECK: ret
149
+ ; CHECK-CALL-LABEL: @outer7(
150
+ ; CHECK-CALL-NOT: call
151
+ ; CHECK-CALL: ret
152
+
143
153
%r = call i32 @inner7 () alwaysinline
144
154
ret i32 %r
145
155
}
0 commit comments