Eric Christopher | dc3d8b8 | 2010-08-25 07:47:00 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -O0 -arm-fast-isel -fast-isel-abort -mtriple=armv7-apple-darwin |
Eric Christopher | e8d274c | 2010-08-25 07:53:15 +0000 | [diff] [blame] | 2 | ; RUN: llc < %s -O0 -arm-fast-isel -fast-isel-abort -mtriple=thumbv7-apple-darwin |
Eric Christopher | ab69588 | 2010-07-21 22:26:11 +0000 | [diff] [blame] | 3 | |
| 4 | ; Very basic fast-isel functionality. |
| 5 | |
| 6 | define i32 @add(i32 %a, i32 %b) nounwind ssp { |
| 7 | entry: |
| 8 | %a.addr = alloca i32, align 4 |
| 9 | %b.addr = alloca i32, align 4 |
| 10 | store i32 %a, i32* %a.addr |
| 11 | store i32 %b, i32* %b.addr |
| 12 | %tmp = load i32* %a.addr |
| 13 | %tmp1 = load i32* %b.addr |
| 14 | %add = add nsw i32 %tmp, %tmp1 |
| 15 | ret i32 %add |
| 16 | } |
Eric Christopher | c430223 | 2010-08-25 07:57:29 +0000 | [diff] [blame^] | 17 | |
| 18 | define i32* @foo(i32* %p, i32* %q, i32** %z) nounwind { |
| 19 | entry: |
| 20 | %r = load i32* %p |
| 21 | %s = load i32* %q |
| 22 | %y = load i32** %z |
| 23 | br label %fast |
| 24 | |
| 25 | fast: |
| 26 | %t0 = add i32 %r, %s |
| 27 | %t1 = mul i32 %t0, %s |
| 28 | %t2 = sub i32 %t1, %s |
| 29 | %t3 = and i32 %t2, %s |
| 30 | %t4 = xor i32 %t3, 3 |
| 31 | %t5 = xor i32 %t4, %s |
| 32 | %t6 = add i32 %t5, 2 |
| 33 | %t7 = getelementptr i32* %y, i32 1 |
| 34 | %t8 = getelementptr i32* %t7, i32 %t6 |
| 35 | br label %exit |
| 36 | |
| 37 | exit: |
| 38 | ret i32* %t8 |
| 39 | } |