Eric Christopher | cee313d | 2019-04-17 04:52:47 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -callsite-splitting -S | FileCheck %s |
| 2 | ; RUN: opt < %s -passes='function(callsite-splitting)' -S | FileCheck %s |
| 3 | |
| 4 | define i32 @callee(i32*, i32, i32) { |
| 5 | ret i32 10 |
| 6 | } |
| 7 | |
| 8 | ; CHECK-LABEL: @test_preds_equal |
| 9 | ; CHECK-NOT: split |
| 10 | ; CHECK: br i1 %cmp, label %Tail, label %Tail |
| 11 | define i32 @test_preds_equal(i32* %a, i32 %v, i32 %p) { |
| 12 | TBB: |
| 13 | %cmp = icmp eq i32* %a, null |
| 14 | br i1 %cmp, label %Tail, label %Tail |
| 15 | Tail: |
| 16 | %r = call i32 @callee(i32* %a, i32 %v, i32 %p) |
| 17 | ret i32 %r |
| 18 | } |
| 19 | |
| 20 | define void @fn1(i16 %p1) { |
| 21 | entry: |
| 22 | ret void |
| 23 | } |
| 24 | |
| 25 | define void @fn2() { |
| 26 | ret void |
| 27 | |
| 28 | ; Unreachable code below |
| 29 | |
| 30 | for.inc: ; preds = %for.inc |
| 31 | br i1 undef, label %for.end6, label %for.inc |
| 32 | |
| 33 | for.end6: ; preds = %for.inc |
| 34 | br i1 undef, label %lor.rhs, label %lor.end |
| 35 | |
| 36 | lor.rhs: ; preds = %for.end6 |
| 37 | br label %lor.end |
| 38 | |
| 39 | lor.end: ; preds = %for.end6, %lor.rhs |
| 40 | call void @fn1(i16 0) |
| 41 | ret void |
| 42 | } |