30 lines · plain
1; RUN: opt -S -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx900 -passes=loop-vectorize,simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck -check-prefixes=GCN %s2; RUN: opt -S -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx900 -passes=loop-vectorize -pass-remarks-analysis='loop-vectorize' < %s 2>&1 | FileCheck -check-prefixes=REMARK %s3 4; GCN-LABEL: @runtime_check_divergent_target(5; GCN-NOT: load <2 x half>6; GCN-NOT: store <2 x half>7 8; REMARK: remark: <unknown>:0:0: loop not vectorized: runtime pointer checks needed. Not enabled for divergent target9define amdgpu_kernel void @runtime_check_divergent_target(ptr addrspace(1) nocapture %a, ptr addrspace(1) nocapture %b) #0 {10entry:11 br label %for.body12 13for.body: ; preds = %entry, %for.body14 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]15 %arrayidx = getelementptr inbounds half, ptr addrspace(1) %b, i64 %indvars.iv16 %load = load half, ptr addrspace(1) %arrayidx, align 417 %mul = fmul half %load, 3.018 %arrayidx2 = getelementptr inbounds half, ptr addrspace(1) %a, i64 %indvars.iv19 store half %mul, ptr addrspace(1) %arrayidx2, align 420 %indvars.iv.next = add i64 %indvars.iv, 121 %lftr.wideiv = trunc i64 %indvars.iv.next to i3222 %exitcond = icmp eq i32 %lftr.wideiv, 102423 br i1 %exitcond, label %for.end, label %for.body24 25for.end: ; preds = %for.body, %entry26 ret void27}28 29attributes #0 = { nounwind }30