Xinliang David Li | d21601a | 2017-04-27 16:34:00 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -partial-inliner -S | FileCheck %s |
| 2 | ; RUN: opt < %s -passes=partial-inliner -S | FileCheck %s |
Xinliang David Li | 66bdfca | 2017-05-12 23:41:43 +0000 | [diff] [blame^] | 3 | ; RUN: opt < %s -partial-inliner -skip-partial-inlining-cost-analysis -max-num-inline-blocks=2 -S | FileCheck --check-prefix=LIMIT %s |
| 4 | ; RUN: opt < %s -passes=partial-inliner -skip-partial-inlining-cost-analysis -max-num-inline-blocks=2 -S | FileCheck --check-prefix=LIMIT %s |
Xinliang David Li | d21601a | 2017-04-27 16:34:00 +0000 | [diff] [blame] | 5 | |
| 6 | ; Function Attrs: nounwind uwtable |
| 7 | define i32 @bar(i32 %arg) local_unnamed_addr #0 { |
| 8 | bb: |
| 9 | %tmp = icmp slt i32 %arg, 0 |
| 10 | br i1 %tmp, label %bb1, label %bb5 |
| 11 | |
| 12 | bb1: ; preds = %bb |
| 13 | %tmp2 = tail call i32 (...) @channels() #2 |
| 14 | %tmp3 = icmp slt i32 %tmp2, %arg |
| 15 | br i1 %tmp3, label %bb4, label %bb5 |
| 16 | |
| 17 | bb4: ; preds = %bb1 |
| 18 | tail call void (...) @foo() #2 |
| 19 | tail call void (...) @foo() #2 |
| 20 | tail call void (...) @foo() #2 |
| 21 | tail call void (...) @foo() #2 |
| 22 | tail call void (...) @foo() #2 |
| 23 | tail call void (...) @foo() #2 |
| 24 | tail call void (...) @foo() #2 |
| 25 | tail call void (...) @foo() #2 |
| 26 | tail call void (...) @foo() #2 |
| 27 | br label %bb5 |
| 28 | |
| 29 | bb5: ; preds = %bb4, %bb1, %bb |
| 30 | %tmp6 = phi i32 [ 0, %bb4 ], [ 1, %bb1 ], [ 1, %bb ] |
| 31 | ret i32 %tmp6 |
| 32 | } |
| 33 | |
| 34 | declare i32 @channels(...) local_unnamed_addr #1 |
| 35 | |
| 36 | declare void @foo(...) local_unnamed_addr #1 |
| 37 | |
| 38 | ; Function Attrs: nounwind uwtable |
| 39 | define i32 @dummy_caller(i32 %arg) local_unnamed_addr #0 { |
| 40 | bb: |
| 41 | ; CHECK-LABEL: @dummy_caller |
| 42 | ; CHECK: br i1 |
| 43 | ; CHECK: br i1 |
| 44 | ; CHECK: call void @bar.1_ |
| 45 | ; LIMIT-LABEL: @dummy_caller |
| 46 | ; LIMIT: br i1 |
| 47 | ; LIMIT-NOT: br |
| 48 | ; LIMIT: call void @bar.1_ |
| 49 | %tmp = tail call i32 @bar(i32 %arg) |
| 50 | ret i32 %tmp |
| 51 | } |
| 52 | |
| 53 | attributes #0 = { nounwind } |
| 54 | attributes #1 = { nounwind } |
| 55 | attributes #2 = { nounwind } |
| 56 | |