Jan Vesely | 4b1243f | 2017-02-18 04:24:10 +0000 | [diff] [blame^] | 1 | ; RUN: opt -loop-unroll -unroll-threshold=2000 -S < %s | llc -march=r600 -mcpu=cypress | FileCheck %s |
| 2 | ; XFAIL: * |
| 3 | |
| 4 | ; CHECK: {{^}}@alu_limits: |
| 5 | |
| 6 | %struct.foo = type {i32, i32, i32} |
| 7 | |
| 8 | define void @alu_limits(i32 addrspace(1)* %out, %struct.foo* %in, i32 %offset) { |
| 9 | entry: |
| 10 | %ptr = getelementptr inbounds %struct.foo, %struct.foo* %in, i32 1, i32 2 |
| 11 | %x = load i32, i32 *%ptr, align 4 |
| 12 | br label %loop |
| 13 | loop: |
| 14 | %i = phi i32 [ 100, %entry ], [ %nexti, %loop ] |
| 15 | %val = phi i32 [ 1, %entry ], [ %nextval, %loop ] |
| 16 | |
| 17 | %nexti = sub i32 %i, 1 |
| 18 | |
| 19 | %y = xor i32 %x, %i |
| 20 | %nextval = mul i32 %val, %y |
| 21 | |
| 22 | %cond = icmp ne i32 %nexti, 0 |
| 23 | br i1 %cond, label %loop, label %end |
| 24 | end: |
| 25 | %out_val = add i32 %nextval, 4 |
| 26 | store i32 %out_val, i32 addrspace(1)* %out, align 4 |
| 27 | ret void |
| 28 | } |