Evan Cheng | 86050dc | 2010-06-18 23:09:54 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -march=arm | FileCheck %s |
Evan Cheng | 60c916b | 2007-06-20 18:26:15 +0000 | [diff] [blame] | 2 | |
| 3 | define i32 @t1(i32 %a, i32 %b, i32 %c, i32 %d) { |
Evan Cheng | 86050dc | 2010-06-18 23:09:54 +0000 | [diff] [blame] | 4 | ; CHECK: t1: |
| 5 | ; CHECK: bxlt lr |
Evan Cheng | 60c916b | 2007-06-20 18:26:15 +0000 | [diff] [blame] | 6 | %tmp2 = icmp sgt i32 %c, 10 |
| 7 | %tmp5 = icmp slt i32 %d, 4 |
| 8 | %tmp8 = or i1 %tmp5, %tmp2 |
| 9 | %tmp13 = add i32 %b, %a |
| 10 | br i1 %tmp8, label %cond_true, label %UnifiedReturnBlock |
| 11 | |
| 12 | cond_true: |
| 13 | %tmp15 = add i32 %tmp13, %c |
| 14 | %tmp1821 = sub i32 %tmp15, %d |
| 15 | ret i32 %tmp1821 |
| 16 | |
| 17 | UnifiedReturnBlock: |
| 18 | ret i32 %tmp13 |
| 19 | } |
| 20 | |
| 21 | define i32 @t2(i32 %a, i32 %b, i32 %c, i32 %d) { |
Evan Cheng | 86050dc | 2010-06-18 23:09:54 +0000 | [diff] [blame] | 22 | ; CHECK: t2: |
| 23 | ; CHECK: bxgt lr |
| 24 | ; CHECK: cmp |
| 25 | ; CHECK: addge |
| 26 | ; CHECK: subge |
| 27 | ; CHECK-NOT: bxge lr |
| 28 | ; CHECK: bx lr |
Evan Cheng | 60c916b | 2007-06-20 18:26:15 +0000 | [diff] [blame] | 29 | %tmp2 = icmp sgt i32 %c, 10 |
| 30 | %tmp5 = icmp slt i32 %d, 4 |
| 31 | %tmp8 = and i1 %tmp5, %tmp2 |
| 32 | %tmp13 = add i32 %b, %a |
| 33 | br i1 %tmp8, label %cond_true, label %UnifiedReturnBlock |
| 34 | |
| 35 | cond_true: |
| 36 | %tmp15 = add i32 %tmp13, %c |
| 37 | %tmp1821 = sub i32 %tmp15, %d |
| 38 | ret i32 %tmp1821 |
| 39 | |
| 40 | UnifiedReturnBlock: |
| 41 | ret i32 %tmp13 |
| 42 | } |