1 ; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s
3 ; CHECK: Assumed Context:
4 ; CHECK-NEXT: [N] -> { : }
5 ; CHECK-NEXT: Invalid Context:
6 ; CHECK-NEXT: [N] -> { : 1 = 0 }
9 ; CHECK-NEXT: Stmt_for_body
10 ; CHECK-NEXT: Domain :=
11 ; CHECK-NEXT: [N] -> { Stmt_for_body[i0] : 0 <= i0 < N };
12 ; CHECK-NEXT: Schedule :=
13 ; CHECK-NEXT: [N] -> { Stmt_for_body[i0] -> [i0] };
14 ; CHECK-NEXT: ReadAccess := [Reduction Type: +] [Scalar: 0]
15 ; CHECK-NEXT: [N] -> { Stmt_for_body[i0] -> MemRef_A[1] : 2*floor((1 + i0)/2) = 1 + i0; Stmt_for_body[i0] -> MemRef_A[0] : 2*floor((i0)/2) = i0 };
16 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: +] [Scalar: 0]
17 ; CHECK-NEXT: [N] -> { Stmt_for_body[i0] -> MemRef_A[1] : 2*floor((1 + i0)/2) = 1 + i0; Stmt_for_body[i0] -> MemRef_A[0] : 2*floor((i0)/2) = i0 };
20 ; void f(int *A, int N) {
21 ; for (int i = 0; i < N; i++) {
26 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
28 define void @f(i32* %A, i32 %N) {
32 for.cond: ; preds = %for.inc, %entry
33 %i.0 = phi i32 [ 0, %entry ], [ %inc1, %for.inc ]
34 %cmp = icmp slt i32 %i.0, %N
35 br i1 %cmp, label %for.body, label %for.end
37 for.body: ; preds = %for.cond
38 %i.t = trunc i32 %i.0 to i1
39 %rem = zext i1 %i.t to i32
40 %idxprom = sext i32 %rem to i64
41 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %idxprom
42 %tmp = load i32, i32* %arrayidx, align 4
43 %inc = add nsw i32 %tmp, 1
44 store i32 %inc, i32* %arrayidx, align 4
47 for.inc: ; preds = %for.body
48 %inc1 = add nuw nsw i32 %i.0, 1
51 for.end: ; preds = %for.cond