Home | History | Annotate | Download | only in AMDGPU
      1 ; RUN: opt -loop-unroll -unroll-threshold=2000 -S < %s | llc -march=r600 -mcpu=cypress | FileCheck %s
      2 ; REQUIRES: asserts
      3 
      4 ; CHECK: {{^}}alu_limits:
      5 ; CHECK: CF_END
      6 
      7 %struct.foo = type {i32, i32, i32}
      8 
      9 define amdgpu_kernel void @alu_limits(i32 addrspace(1)* %out, %struct.foo addrspace(5)* %in, i32 %offset) {
     10 entry:
     11   %ptr = getelementptr inbounds %struct.foo, %struct.foo addrspace(5)* %in, i32 1, i32 2
     12   %x = load i32, i32  addrspace(5)*%ptr, align 4
     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
     27   store i32 %out_val, i32 addrspace(1)* %out, align 4
     28   ret void
     29 }
     30