• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -passes=partial-inliner -S 2>&1| FileCheck %s
2
3define i32 @callee1(i32 %arg) {
4bb:
5  %tmp = icmp slt i32 %arg, 0
6  br i1 %tmp, label %bb1, label %bb2
7
8bb1:
9  br i1 undef, label %bb4, label %bb2
10
11bb2:
12  br i1 undef, label %bb4, label %bb5
13
14bb4:
15  %xx1 = phi i32 [ 1, %bb1 ], [ 9, %bb2 ]
16  %xx2 = phi i32 [ 1, %bb1 ], [ 9, %bb2 ]
17  %xx3 = phi i32 [ 1, %bb1 ], [ 9, %bb2 ]
18  tail call void (...) @extern() #2
19  br label %bb5
20
21bb5:
22  %tmp6 = phi i32 [ 1, %bb2 ], [ 9, %bb4 ]
23  ret i32 %tmp6
24}
25
26declare void @extern(...)
27
28define i32 @caller1(i32 %arg) {
29bb:
30;; partial inliner inlines callee to caller.
31; CHECK-LABEL: @caller1
32; CHECK: br i1
33; CHECK: br i1
34; CHECK-NOT: call i32 @callee1(
35  %tmp = tail call i32 @callee1(i32 %arg)
36  ret i32 %tmp
37}
38
39define i32 @caller2(i32 %arg) #0 {
40bb:
41;; partial inliner won't inline callee to caller because they have
42;; incompatible attributes.
43; CHECK-LABEL: @caller2
44; CHECK: call i32 @callee1(
45  %tmp = tail call i32 @callee1(i32 %arg)
46  ret i32 %tmp
47}
48
49attributes #0 = { "use-sample-profile" }
50