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