Eric Christopher | cee313d | 2019-04-17 04:52:47 +0000 | [diff] [blame] | 1 | ; RUN: opt -S -partial-inliner -max-num-inline-blocks=2 -skip-partial-inlining-cost-analysis < %s | FileCheck %s |
| 2 | ; RUN: opt -S -passes=partial-inliner -max-num-inline-blocks=2 -skip-partial-inlining-cost-analysis < %s | FileCheck %s |
| 3 | |
| 4 | define i32 @test(i32 %arg) local_unnamed_addr #0 { |
| 5 | bb: |
| 6 | %tmp = tail call i32 (...) @bar() #1 |
| 7 | %tmp1 = icmp slt i32 %arg, 0 |
| 8 | br i1 %tmp1, label %bb6, label %bb2 |
| 9 | |
| 10 | bb2: ; preds = %bb |
| 11 | tail call void (...) @foo() #1 |
| 12 | tail call void (...) @foo() #1 |
| 13 | tail call void (...) @foo() #1 |
| 14 | tail call void (...) @foo() #1 |
| 15 | tail call void (...) @foo() #1 |
| 16 | %tmp3 = tail call i32 (...) @bar() #1 |
| 17 | %tmp4 = icmp eq i32 %tmp3, 10 |
| 18 | br i1 %tmp4, label %bb6, label %bb5 |
| 19 | |
| 20 | bb5: ; preds = %bb2 |
| 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 | br label %bb6 |
| 26 | |
| 27 | bb6: ; preds = %bb5, %bb2, %bb |
| 28 | %tmp7 = phi i32 [ 1, %bb5 ], [ 0, %bb ], [ 1, %bb2 ] |
| 29 | ret i32 %tmp7 |
| 30 | } |
| 31 | |
| 32 | ; Function Attrs: nounwind uwtable |
| 33 | declare i32 @bar(...) local_unnamed_addr #0 |
| 34 | |
| 35 | ; Function Attrs: nounwind uwtable |
| 36 | declare void @foo(...) local_unnamed_addr #0 |
| 37 | |
| 38 | ; Function Attrs: nounwind uwtable |
| 39 | define i32 @dummy_caller(i32 %arg) local_unnamed_addr #0 { |
| 40 | ; CHECK-LABEL: @dummy_caller |
| 41 | ; CHECK: codeRepl.i: |
| 42 | ; CHECK: call void @test.1.bb2() |
| 43 | ; CHECK-NOT: load |
| 44 | ; CHECK br |
| 45 | bb: |
| 46 | %tmp = tail call i32 @test(i32 %arg) |
| 47 | ret i32 %tmp |
| 48 | } |
| 49 | |
| 50 | ; CHECK-LABEL: define internal void @test.1.bb2() |
| 51 | ; CHECK: .exitStub: |
| 52 | ; CHECK-NOT: store i32 %tmp7, i32* %tmp7.out |
| 53 | ; CHECK: ret |
| 54 | |
| 55 | attributes #0 = { nounwind uwtable } |
| 56 | attributes #1 = { nounwind } |
| 57 | |
| 58 | !llvm.module.flags = !{!0} |
| 59 | !llvm.ident = !{!1} |
| 60 | |
| 61 | !0 = !{i32 1, !"wchar_size", i32 4} |
| 62 | !1 = !{!"clang version 5.0.0 (trunk 303574)"} |