59 lines · plain
1; RUN: llc < %s -mtriple=amdgcn | FileCheck -check-prefix=GCN %s2 3; GCN-LABEL: {{^}}checkTwoBlocksWithUniformBranch4; GCN: BB0_25; GCN: v_add6define amdgpu_kernel void @checkTwoBlocksWithUniformBranch(ptr addrspace(1) nocapture %out, i32 %width, float %xPos, float %yPos, float %xStep, float %yStep, i32 %maxIter) {7entry:8 %conv = call i32 @llvm.amdgcn.workitem.id.x() #19 %rem = urem i32 %conv, %width10 %div = udiv i32 %conv, %width11 %conv1 = sitofp i32 %rem to float12 %x = tail call float @llvm.fmuladd.f32(float %xStep, float %conv1, float %xPos)13 %conv2 = sitofp i32 %div to float14 %y = tail call float @llvm.fmuladd.f32(float %yStep, float %conv2, float %yPos)15 %yy = fmul float %y, %y16 %xy = tail call float @llvm.fmuladd.f32(float %x, float %x, float %yy)17 %cmp01 = fcmp ole float %xy, 4.000000e+0018 %cmp02 = icmp ne i32 %maxIter, 019 %cond01 = and i1 %cmp02, %cmp0120 br i1 %cond01, label %for.body.preheader, label %for.end21 22for.body.preheader: ; preds = %entry23 br label %for.body24 25for.body: ; preds = %for.body.preheader, %for.body26 %x_val = phi float [ %call8, %for.body ], [ %x, %for.body.preheader ]27 %iter_val = phi i32 [ %inc, %for.body ], [ 0, %for.body.preheader ]28 %y_val = phi float [ %call9, %for.body ], [ %y, %for.body.preheader ]29 %sub = fsub float -0.000000e+00, %y_val30 %call7 = tail call float @llvm.fmuladd.f32(float %x_val, float %x_val, float %x) #131 %call8 = tail call float @llvm.fmuladd.f32(float %sub, float %y_val, float %call7) #132 %mul = fmul float %x_val, 2.000000e+0033 %call9 = tail call float @llvm.fmuladd.f32(float %mul, float %y_val, float %y) #134 %inc = add nuw i32 %iter_val, 135 %mul3 = fmul float %call9, %call936 %0 = tail call float @llvm.fmuladd.f32(float %call8, float %call8, float %mul3)37 %cmp = fcmp ole float %0, 4.000000e+0038 %cmp5 = icmp ult i32 %inc, %maxIter39 %or.cond = and i1 %cmp5, %cmp40 br i1 %or.cond, label %for.body, label %for.end.loopexit41 42for.end.loopexit: ; preds = %for.body43 br label %for.end44 45for.end: ; preds = %for.end.loopexit, %entry46 %iter.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %for.end.loopexit ]47 %idxprom = ashr exact i32 %conv, 3248 %arrayidx = getelementptr inbounds i32, ptr addrspace(1) %out, i32 %idxprom49 store i32 %iter.0.lcssa, ptr addrspace(1) %arrayidx, align 450 ret void51}52 53; Function Attrs: nounwind readnone54declare i32 @llvm.amdgcn.workitem.id.x() #055declare float @llvm.fmuladd.f32(float, float, float) #156 57attributes #0 = { nounwind readnone }58attributes #1 = { readnone }59