1; RUN: opt %loadPolly -polly-scops -analyze \
2; RUN: < %s | FileCheck %s
3
4; CHECK:      Statements {
5; CHECK-NEXT:     Stmt_loop_1
6; CHECK-NEXT:         Domain :=
7; CHECK-NEXT:             [N] -> { Stmt_loop_1[i0] : N <= 100 and 0 <= i0 <= 101 };
8; CHECK-NEXT:         Schedule :=
9; CHECK-NEXT:             [N] -> { Stmt_loop_1[i0] -> [0, i0] };
10; CHECK-NEXT:         ReadAccess :=    [Reduction Type: NONE] [Scalar: 0]
11; CHECK-NEXT:             [N] -> { Stmt_loop_1[i0] -> MemRef_A[0] };
12; CHECK-NEXT:         MustWriteAccess :=    [Reduction Type: NONE] [Scalar: 0]
13; CHECK-NEXT:             [N] -> { Stmt_loop_1[i0] -> MemRef_A[0] };
14; CHECK-NEXT:     Stmt_loop_2
15; CHECK-NEXT:         Domain :=
16; CHECK-NEXT:             [N] -> { Stmt_loop_2[i0] : N <= 100 and 0 <= i0 <= 301 };
17; CHECK-NEXT:         Schedule :=
18; CHECK-NEXT:             [N] -> { Stmt_loop_2[i0] -> [1, i0] };
19; CHECK-NEXT:         ReadAccess :=    [Reduction Type: NONE] [Scalar: 0]
20; CHECK-NEXT:             [N] -> { Stmt_loop_2[i0] -> MemRef_A[0] };
21; CHECK-NEXT:         MustWriteAccess :=    [Reduction Type: NONE] [Scalar: 0]
22; CHECK-NEXT:             [N] -> { Stmt_loop_2[i0] -> MemRef_A[0] };
23; CHECK-NEXT: }
24
25define void @foo(float* %A, i64 %N) {
26entry:
27  br label %branch
28
29branch:
30  %cond = icmp sle i64 %N, 100
31  br i1 %cond, label %loop.1, label %merge
32
33loop.1:
34  %indvar.1 = phi i64 [0, %branch], [%indvar.next.1, %loop.1]
35  %indvar.next.1 = add i64 %indvar.1, 1
36  %val.1 = load float, float* %A
37  %sum.1 = fadd float %val.1, 1.0
38  store float %sum.1, float* %A
39  %cond.1 = icmp sle i64 %indvar.1, 100
40  br i1 %cond.1, label %loop.1, label %loop.2
41
42loop.2:
43  %indvar.2 = phi i64 [0, %loop.1], [%indvar.next.2, %loop.2]
44  %indvar.next.2 = add i64 %indvar.2, 1
45  %val.2 = load float, float* %A
46  %sum.2 = fadd float %val.2, 1.0
47  store float %sum.2, float* %A
48  %cond.2 = icmp sle i64 %indvar.2, 300
49  br i1 %cond.2, label %loop.2, label %merge
50
51merge:
52  br label %exit
53
54exit:
55  ret void
56}
57