• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -S -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx900 -loop-vectorize -simplifycfg < %s | FileCheck -check-prefixes=GCN %s
2; RUN: opt -S -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx900 -loop-vectorize -pass-remarks-analysis='loop-vectorize' < %s 2>&1 | FileCheck -check-prefixes=REMARK %s
3
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 target
9define amdgpu_kernel void @runtime_check_divergent_target(half addrspace(1)* nocapture %a, half addrspace(1)* nocapture %b) #0 {
10entry:
11  br label %for.body
12
13for.body:                                         ; preds = %entry, %for.body
14  %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
15  %arrayidx = getelementptr inbounds half, half addrspace(1)* %b, i64 %indvars.iv
16  %load = load half, half addrspace(1)* %arrayidx, align 4
17  %mul = fmul half %load, 3.0
18  %arrayidx2 = getelementptr inbounds half, half addrspace(1)* %a, i64 %indvars.iv
19  store half %mul, half addrspace(1)* %arrayidx2, align 4
20  %indvars.iv.next = add i64 %indvars.iv, 1
21  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
22  %exitcond = icmp eq i32 %lftr.wideiv, 1024
23  br i1 %exitcond, label %for.end, label %for.body
24
25for.end:                                          ; preds = %for.body, %entry
26  ret void
27}
28
29attributes #0 = { nounwind }
30