1 ; RUN: opt < %s -partial-inliner -S | FileCheck %s
2 ; RUN: opt < %s -passes=partial-inliner -S | FileCheck %s
3 ; RUN: opt < %s -partial-inliner -max-num-inline-blocks=3 -skip-partial-inlining-cost-analysis -S | FileCheck --check-prefix=LIMIT3 %s
4 ; RUN: opt < %s -passes=partial-inliner -max-num-inline-blocks=3 -skip-partial-inlining-cost-analysis -S | FileCheck --check-prefix=LIMIT3 %s
5 ; RUN: opt < %s -partial-inliner -max-num-inline-blocks=2 -S | FileCheck --check-prefix=LIMIT2 %s
6 ; RUN: opt < %s -passes=partial-inliner -max-num-inline-blocks=2 -S | FileCheck --check-prefix=LIMIT2 %s
9 ; Function Attrs: nounwind uwtable
10 define i32 @bar(i32 %arg) local_unnamed_addr #0 {
12 %tmp = icmp slt i32 %arg, 0
13 br i1 %tmp, label %bb4, label %bb1
16 %tmp2 = tail call i32 (...) @n() #2
17 %tmp3 = icmp slt i32 %tmp2, %arg
18 br i1 %tmp3, label %bb4, label %bb8
20 bb4: ; preds = %bb1, %bb
21 %tmp5 = tail call i32 (...) @m() #2
22 %tmp6 = icmp sgt i32 %tmp5, %arg
23 br i1 %tmp6, label %bb7, label %bb8
26 tail call void (...) @foo() #2
27 tail call void (...) @foo() #2
28 tail call void (...) @foo() #2
29 tail call void (...) @foo() #2
30 tail call void (...) @foo() #2
31 tail call void (...) @foo() #2
32 tail call void (...) @foo() #2
33 tail call void (...) @foo() #2
34 tail call void (...) @foo() #2
37 bb8: ; preds = %bb7, %bb4, %bb1
38 %tmp9 = phi i32 [ 0, %bb7 ], [ 1, %bb4 ], [ 1, %bb1 ]
42 declare i32 @n(...) local_unnamed_addr #1
44 declare i32 @m(...) local_unnamed_addr #1
46 declare void @foo(...) local_unnamed_addr #1
48 ; Function Attrs: nounwind uwtable
49 define i32 @dummy_caller(i32 %arg) local_unnamed_addr #0 {
51 ; CHECK-LABEL: @dummy_caller
55 ; CHECK: call void @bar.1.
56 ; LIMIT3-LABEL: @dummy_caller
60 ; LIMIT3: call void @bar.1.
61 ; LIMIT2-LABEL: @dummy_caller
63 ; LIMIT2: call i32 @bar(
64 %tmp = tail call i32 @bar(i32 %arg)
68 attributes #0 = { nounwind }
69 attributes #1 = { nounwind }
70 attributes #2 = { nounwind }