• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt %loadPolly -polly-codegen-ppcg -polly-acc-dump-kernel-ir \
2; RUN: -disable-output < %s | \
3; RUN: FileCheck %s
4
5; REQUIRES: pollyacc,nvptx
6;
7;    void foo(float A[], int n) {
8;      for (long j = 0; j < n; j++)
9;        A[j + n] += 42;
10;    }
11
12target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
13
14; CHECK: define ptx_kernel void @kernel_0(i8* %MemRef_A, i32 %n)
15
16define void @foo(float* %A, i32 %n) {
17bb:
18  br label %bb1
19
20bb1:                                              ; preds = %bb9, %bb
21  %j.0 = phi i64 [ 0, %bb ], [ %tmp10, %bb9 ]
22  %tmp = sext i32 %n to i64
23  %tmp2 = icmp slt i64 %j.0, %tmp
24  br i1 %tmp2, label %bb3, label %bb11
25
26bb3:                                              ; preds = %bb1
27  %tmp4 = sext i32 %n to i64
28  %tmp5 = add nsw i64 %j.0, %tmp4
29  %tmp6 = getelementptr inbounds float, float* %A, i64 %tmp5
30  %tmp7 = load float, float* %tmp6, align 4
31  %tmp8 = fadd float %tmp7, 4.200000e+01
32  store float %tmp8, float* %tmp6, align 4
33  br label %bb9
34
35bb9:                                              ; preds = %bb3
36  %tmp10 = add nuw nsw i64 %j.0, 1
37  br label %bb1
38
39bb11:                                             ; preds = %bb1
40  ret void
41}
42