1; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s
2;
3;    float f(float *A, int N) {
4;      float tmp = 0;
5;      for (int i = 0; i < N; i++)
6;        tmp += A[i];
7;    }
8
9; CHECK:      Statements {
10; CHECK-NEXT:     Stmt_bb1
11; CHECK-NEXT:         Domain :=
12; CHECK-NEXT:             [N] -> { Stmt_bb1[i0] : 0 <= i0 <= N; Stmt_bb1[0] : N < 0 };
13; CHECK-NEXT:         Schedule :=
14; CHECK-NEXT:             [N] -> { Stmt_bb1[i0] -> [i0, 0] : i0 <= N; Stmt_bb1[0] -> [0, 0] : N < 0 };
15; CHECK-NEXT:         ReadAccess :=    [Reduction Type: NONE] [Scalar: 1]
16; CHECK-NEXT:             [N] -> { Stmt_bb1[i0] -> MemRef_tmp_0__phi[] };
17; CHECK-NEXT:         MustWriteAccess :=    [Reduction Type: NONE] [Scalar: 1]
18; CHECK-NEXT:             [N] -> { Stmt_bb1[i0] -> MemRef_tmp_0[] };
19; CHECK-NEXT:     Stmt_bb4
20; CHECK-NEXT:         Domain :=
21; CHECK-NEXT:             [N] -> { Stmt_bb4[i0] : 0 <= i0 < N };
22; CHECK-NEXT:         Schedule :=
23; CHECK-NEXT:             [N] -> { Stmt_bb4[i0] -> [i0, 1] };
24; CHECK-NEXT:         MustWriteAccess :=    [Reduction Type: NONE] [Scalar: 1]
25; CHECK-NEXT:             [N] -> { Stmt_bb4[i0] -> MemRef_tmp_0__phi[] };
26; CHECK-NEXT:         ReadAccess :=    [Reduction Type: NONE] [Scalar: 0]
27; CHECK-NEXT:             [N] -> { Stmt_bb4[i0] -> MemRef_A[i0] };
28; CHECK-NEXT:         ReadAccess :=    [Reduction Type: NONE] [Scalar: 1]
29; CHECK-NEXT:             [N] -> { Stmt_bb4[i0] -> MemRef_tmp_0[] };
30; CHECK-NEXT: }
31
32target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
33
34define void @f(float* %A, i32 %N) {
35bb:
36  %tmp = sext i32 %N to i64
37  br label %bb1
38
39bb1:                                              ; preds = %bb4, %bb
40  %indvars.iv = phi i64 [ %indvars.iv.next, %bb4 ], [ 0, %bb ]
41  %tmp.0 = phi float [ 0.000000e+00, %bb ], [ %tmp7, %bb4 ]
42  %tmp2 = icmp slt i64 %indvars.iv, %tmp
43  br i1 %tmp2, label %bb3, label %bb8
44
45bb3:                                              ; preds = %bb1
46  br label %bb4
47
48bb4:                                              ; preds = %bb3
49  %tmp5 = getelementptr inbounds float, float* %A, i64 %indvars.iv
50  %tmp6 = load float, float* %tmp5, align 4
51  %tmp7 = fadd float %tmp.0, %tmp6
52  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
53  br label %bb1
54
55bb8:                                              ; preds = %bb1
56  br label %exit
57
58exit:
59  ret void
60}
61