• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 | FileCheck %s
2
3target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"
4target triple = "nvptx64-unknown-unknown"
5
6; Compiled from the following CUDA code:
7;
8;   #pragma nounroll
9;   for (int i = 0; i < 2; ++i)
10;     output[i] = input[i];
11define void @nounroll(float* %input, float* %output) {
12; CHECK-LABEL: .visible .func nounroll(
13entry:
14  br label %for.body
15
16for.body:
17; CHECK: .pragma "nounroll"
18  %i.06 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
19  %idxprom = sext i32 %i.06 to i64
20  %arrayidx = getelementptr inbounds float, float* %input, i64 %idxprom
21  %0 = load float, float* %arrayidx, align 4
22; CHECK: ld.f32
23  %arrayidx2 = getelementptr inbounds float, float* %output, i64 %idxprom
24  store float %0, float* %arrayidx2, align 4
25; CHECK: st.f32
26  %inc = add nuw nsw i32 %i.06, 1
27  %exitcond = icmp eq i32 %inc, 2
28  br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !0
29; CHECK-NOT: ld.f32
30; CHECK-NOT: st.f32
31
32for.end:
33  ret void
34}
35
36!0 = distinct !{!0, !1}
37!1 = !{!"llvm.loop.unroll.disable"}
38