1 ; RUN: opt < %s -partial-inliner -skip-partial-inlining-cost-analysis -S | FileCheck %s
2 ; RUN: opt < %s -passes=partial-inliner -skip-partial-inlining-cost-analysis -S | FileCheck %s
3 ; RUN: opt < %s -partial-inliner -max-num-inline-blocks=2 -S | FileCheck --check-prefix=LIMIT %s
4 ; RUN: opt < %s -passes=partial-inliner -max-num-inline-blocks=2 -S | FileCheck --check-prefix=LIMIT %s
6 ; Function Attrs: nounwind uwtable
7 define i32 @bar(i32 %arg) local_unnamed_addr #0 {
9 %tmp = icmp slt i32 %arg, 0
10 br i1 %tmp, label %bb4, label %bb1
13 %tmp2 = tail call i32 (...) @channels() #1
14 %tmp3 = icmp slt i32 %tmp2, %arg
15 br i1 %tmp3, label %bb4, label %bb5
17 bb4: ; preds = %bb1, %bb
18 tail call void (...) @foo() #1
19 tail call void (...) @foo() #1
20 tail call void (...) @foo() #1
21 tail call void (...) @foo() #1
22 tail call void (...) @foo() #1
23 tail call void (...) @foo() #1
24 tail call void (...) @foo() #1
25 tail call void (...) @foo() #1
26 tail call void (...) @foo() #1
29 bb5: ; preds = %bb4, %bb1
30 %.0 = phi i32 [ 0, %bb4 ], [ 1, %bb1 ]
34 declare i32 @channels(...) local_unnamed_addr
36 declare void @foo(...) local_unnamed_addr
38 ; Function Attrs: nounwind uwtable
39 define i32 @dummy_caller(i32 %arg) local_unnamed_addr #0 {
41 ; CHECK-LABEL: @dummy_caller
44 ; CHECK: call void @bar.2.
45 ; LIMIT-LABEL: @dummy_caller
47 ; LIMIT: call i32 @bar(
48 %tmp = tail call i32 @bar(i32 %arg)
52 define i32 @bar_multi_ret(i32 %arg) local_unnamed_addr #0 {
54 %tmp = icmp slt i32 %arg, 0
55 br i1 %tmp, label %bb4, label %bb1
58 %tmp2 = tail call i32 (...) @channels() #1
59 %tmp3 = icmp slt i32 %tmp2, %arg
60 br i1 %tmp3, label %bb4, label %bb5
62 bb4: ; preds = %bb1, %bb
63 tail call void (...) @foo() #1
64 tail call void (...) @foo() #1
65 tail call void (...) @foo() #1
66 tail call void (...) @foo() #1
67 %tmp4 = icmp slt i32 %arg, 10
68 br i1 %tmp4, label %bb6, label %bb5
70 tail call void (...) @foo() #1
71 %tmp5 = icmp slt i32 %arg, 3
72 br i1 %tmp5, label %bb7, label %bb5
74 tail call void (...) @foo() #1
79 bb5: ; preds = %bb4, %bb1
80 %.0 = phi i32 [ 0, %bb4 ], [ 1, %bb1 ], [0, %bb6]
84 define i32 @dummy_caller2(i32 %arg) local_unnamed_addr #0 {
87 ; CHECK: call {{.*}} @bar_multi_ret.1.
88 %tmp = tail call i32 @bar_multi_ret(i32 %arg)
92 attributes #0 = { nounwind uwtable }
93 attributes #1 = { nounwind }
97 !0 = !{!"clang version 5.0.0 (trunk 300576)"}