1; RUN: llc -march=amdgcn -O0 -o - %s | FileCheck %s 2 3; CHECK-LABEL: non_uniform_loop 4; CHECK: s_endpgm 5define amdgpu_kernel void @non_uniform_loop(float addrspace(1)* %array) { 6entry: 7 %w = tail call i32 @llvm.amdgcn.workitem.id.x() 8 br label %for.cond 9 10for.cond: 11 %i = phi i32 [0, %entry], [%i.next, %for.inc] 12 %cmp = icmp ult i32 %i, %w 13 br i1 %cmp, label %for.body, label %for.end 14 15for.body: 16 br label %for.inc 17 18for.inc: 19 %i.next = add i32 %i, 1 20 br label %for.cond 21 22for.end: 23 ret void 24} 25 26declare i32 @llvm.amdgcn.workitem.id.x() 27