40 lines · plain
1; RUN: llc < %s -mtriple=amdgcn | FileCheck %s2 3; This tests that the llvm.SI.end.cf intrinsic is not inserted into the4; loop block. This intrinsic will be lowered to s_or_b64 by the code5; generator.6 7; CHECK-LABEL: {{^}}test:8 9; This is was lowered from the llvm.SI.end.cf intrinsic:10; CHECK: s_or_b64 exec, exec11 12; CHECK: [[LOOP_LABEL:.L[0-9A-Za-z_]+]]: ; %loop{{$}}13; CHECK-NOT: s_or_b64 exec, exec14; CHECK: s_cbranch_execnz [[LOOP_LABEL]]15define amdgpu_kernel void @test(ptr addrspace(1) %out) {16entry:17 %cond = call i32 @llvm.amdgcn.workitem.id.x() #018 %tmp0 = icmp eq i32 %cond, 019 br i1 %tmp0, label %if, label %loop20 21if:22 store i32 0, ptr addrspace(1) %out23 br label %loop24 25loop:26 %tmp1 = phi i32 [0, %entry], [0, %if], [%inc, %loop]27 %inc = add i32 %tmp1, %cond28 %tmp2 = icmp ugt i32 %inc, 1029 br i1 %tmp2, label %done, label %loop30 31done:32 %tmp3 = getelementptr i32, ptr addrspace(1) %out, i64 133 store i32 %inc, ptr addrspace(1) %tmp334 ret void35}36 37declare i32 @llvm.amdgcn.workitem.id.x() #038 39attributes #0 = { nounwind readnone }40