brintos

brintos / llvm-project-archived public Read only

0
0
Text · 825 B · eb1ec97 Raw
30 lines · plain
1; RUN: opt -passes=loop-unroll -unroll-threshold=2000 -S < %s | llc -mtriple=r600 -mcpu=cypress | FileCheck %s2; REQUIRES: asserts3 4; CHECK: {{^}}alu_limits:5; CHECK: CF_END6 7%struct.foo = type {i32, i32, i32}8 9define amdgpu_kernel void @alu_limits(ptr addrspace(1) %out, ptr addrspace(5) %in, i32 %offset) {10entry:11  %ptr = getelementptr inbounds %struct.foo, ptr addrspace(5) %in, i32 1, i32 212  %x = load i32, ptr  addrspace(5) %ptr, align 413  br label %loop14loop:15  %i = phi i32 [ 100, %entry ], [ %nexti, %loop ]16  %val = phi i32 [ 1, %entry ], [ %nextval, %loop ]17 18  %nexti = sub i32 %i, 119 20  %y = xor i32 %x, %i21  %nextval = mul i32 %val, %y22 23  %cond = icmp ne i32 %nexti, 024  br i1 %cond, label %loop, label %end25end:26  %out_val = add i32 %nextval, 427  store i32 %out_val, ptr addrspace(1) %out, align 428  ret void29}30