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