Jim Grosbach | 25e6d48 | 2011-07-08 21:50:04 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -ifcvt-limit=0 -march=thumb -mattr=+thumb2 | FileCheck %s |
| 2 | ; RUN: llc < %s -ifcvt-limit=0 -march=thumb -mattr=+thumb2 | not grep it |
| 3 | ; If-conversion defeats the purpose of this test, which is to check CBZ |
| 4 | ; generation, so turn it off. |
Evan Cheng | ed338e8 | 2009-07-11 07:26:20 +0000 | [diff] [blame] | 5 | |
| 6 | define i32 @t1(i32 %a, i32 %b, i32 %c) { |
Evan Cheng | 1107f03 | 2009-11-01 18:13:29 +0000 | [diff] [blame] | 7 | ; CHECK: t1: |
| 8 | ; CHECK: cbz |
Evan Cheng | ed338e8 | 2009-07-11 07:26:20 +0000 | [diff] [blame] | 9 | %tmp2 = icmp eq i32 %a, 0 |
| 10 | br i1 %tmp2, label %cond_false, label %cond_true |
| 11 | |
| 12 | cond_true: |
| 13 | %tmp5 = add i32 %b, 1 |
| 14 | %tmp6 = and i32 %tmp5, %c |
| 15 | ret i32 %tmp6 |
| 16 | |
| 17 | cond_false: |
| 18 | %tmp7 = add i32 %b, -1 |
| 19 | %tmp8 = xor i32 %tmp7, %c |
| 20 | ret i32 %tmp8 |
| 21 | } |