Krzysztof Parzyszek | 5b8fae5 | 2017-03-06 19:12:42 +0000 | [diff] [blame] | 1 | ; RUN: llc -march=hexagon < %s |
| 2 | |
| 3 | ; Check that branch probabilities are set correctly after performing the |
| 4 | ; simple variant of if-conversion. The converted block has a branch that |
| 5 | ; is not analyzable. |
| 6 | |
| 7 | target triple = "hexagon" |
| 8 | |
| 9 | declare void @foo() |
| 10 | |
| 11 | ; CHECK-LABEL: danny |
| 12 | ; CHECK: if (p0.new) jump:nt foo |
| 13 | define void @danny(i32 %x) { |
| 14 | %t0 = icmp sgt i32 %x, 0 |
| 15 | br i1 %t0, label %tail, label %exit, !prof !0 |
| 16 | tail: |
| 17 | tail call void @foo(); |
| 18 | ret void |
| 19 | exit: |
| 20 | ret void |
| 21 | } |
| 22 | |
| 23 | ; CHECK-LABEL: sammy |
| 24 | ; CHECK: if (!p0.new) jump:t foo |
| 25 | define void @sammy(i32 %x) { |
| 26 | %t0 = icmp sgt i32 %x, 0 |
| 27 | br i1 %t0, label %exit, label %tail, !prof !0 |
| 28 | tail: |
| 29 | tail call void @foo(); |
| 30 | ret void |
| 31 | exit: |
| 32 | ret void |
| 33 | } |
| 34 | |
| 35 | !0 = !{!"branch_weights", i32 1, i32 2000} |
| 36 | |