1; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-scops -analyze -polly-print-instructions < %s | FileCheck %s
2;
3; CHECK:    Statements {
4; CHECK-NEXT:  	Stmt_Stmt
5; CHECK-NEXT:       Domain :=
6; CHECK-NEXT:           { Stmt_Stmt[i0] : 0 <= i0 <= 1023 };
7; CHECK-NEXT:       Schedule :=
8; CHECK-NEXT:           { Stmt_Stmt[i0] -> [i0, 0] };
9; CHECK-NEXT:       MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 0]
10; CHECK-NEXT:           { Stmt_Stmt[i0] -> MemRef_A[i0] };
11; CHECK-NEXT:       Instructions {
12; CHECK-NEXT:             store i32 %i.0, i32* %arrayidx, align 4, !polly_split_after !0
13; CHECK-NEXT:       }
14; CHECK-NEXT:  	Stmt_Stmt_b
15; CHECK-NEXT:       Domain :=
16; CHECK-NEXT:           { Stmt_Stmt_b[i0] : 0 <= i0 <= 1023 };
17; CHECK-NEXT:       Schedule :=
18; CHECK-NEXT:           { Stmt_Stmt_b[i0] -> [i0, 1] };
19; CHECK-NEXT:       MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 0]
20; CHECK-NEXT:           { Stmt_Stmt_b[i0] -> MemRef_B[i0] };
21; CHECK-NEXT:       MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 1]
22; CHECK-NEXT:           { Stmt_Stmt_b[i0] -> MemRef_phi__phi[] };
23; CHECK-NEXT:       Instructions {
24; CHECK-NEXT:             %d = fadd double 2.100000e+01, 2.100000e+01
25; CHECK-NEXT:             store i32 %i.0, i32* %arrayidx2, align 4
26; CHECK-NEXT:       }
27; CHECK-NEXT:   Stmt_for_inc
28; CHECK-NEXT:       Domain :=
29; CHECK-NEXT:           { Stmt_for_inc[i0] : 0 <= i0 <= 1023 };
30; CHECK-NEXT:       Schedule :=
31; CHECK-NEXT:           { Stmt_for_inc[i0] -> [i0, 2] };
32; CHECK-NEXT:       ReadAccess :=  [Reduction Type: NONE] [Scalar: 1]
33; CHECK-NEXT:           { Stmt_for_inc[i0] -> MemRef_phi__phi[] };
34; CHECK-NEXT:       MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 0]
35; CHECK-NEXT:           { Stmt_for_inc[i0] -> MemRef_C[0] };
36; CHECK-NEXT:       Instructions {
37; CHECK-NEXT:             %phi = phi double [ %d, %Stmt ]
38; CHECK-NEXT:             store double %phi, double* %C
39; CHECK-NEXT:       }
40; CHECK-NEXT:   }
41;
42; Function Attrs: noinline nounwind uwtable
43define void @func(i32* %A, i32* %B, double* %C) #0 {
44entry:
45  br label %for.cond
46
47for.cond:                                         ; preds = %for.inc, %entry
48  %i.0 = phi i32 [ 0, %entry ], [ %add, %for.inc ]
49  %cmp = icmp slt i32 %i.0, 1024
50  br i1 %cmp, label %for.body, label %for.end
51
52for.body:                                         ; preds = %for.cond
53  br label %Stmt
54
55Stmt:
56  %idxprom = sext i32 %i.0 to i64
57  %arrayidx = getelementptr inbounds i32, i32* %A, i64 %idxprom
58  store i32 %i.0, i32* %arrayidx, align 4, !polly_split_after !0
59  %idxprom1 = sext i32 %i.0 to i64
60  %d = fadd double 21.0, 21.0
61  %arrayidx2 = getelementptr inbounds i32, i32* %B, i64 %idxprom1
62  store i32 %i.0, i32* %arrayidx2, align 4
63  br label %for.inc
64
65for.inc:                                          ; preds = %Stmt
66  %phi = phi double [%d, %Stmt]
67  store double %phi, double* %C
68  %add = add nsw i32 %i.0, 1
69  br label %for.cond
70
71for.end:                                          ; preds = %for.cond
72  ret void
73}
74
75!0 = !{!"polly_split_after"}
76