1; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s 2; 3; CHECK: Assumed Context: 4; CHECK-NEXT: [N] -> { : } 5; CHECK-NEXT: Invalid Context: 6; CHECK-NEXT: [N] -> { : false } 7; CHECK-NEXT: p0: %N 8; CHECK: Statements { 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] : (1 + i0) mod 2 = 0; Stmt_for_body[i0] -> MemRef_A[0] : (i0) mod 2 = 0 } 16; CHECK-NEXT: MustWriteAccess := [Reduction Type: +] [Scalar: 0] 17; CHECK-NEXT: [N] -> { Stmt_for_body[i0] -> MemRef_A[1] : (1 + i0) mod 2 = 0; Stmt_for_body[i0] -> MemRef_A[0] : (i0) mod 2 = 0 }; 18; CHECK-NEXT: } 19; 20; void f(int *A, int N) { 21; for (int i = 0; i < N; i++) { 22; A[i % 2]++; 23; } 24; } 25; 26target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 27 28define void @f(i32* %A, i32 %N) { 29entry: 30 br label %for.cond 31 32for.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 36 37for.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 45 br label %for.inc 46 47for.inc: ; preds = %for.body 48 %inc1 = add nuw nsw i32 %i.0, 1 49 br label %for.cond 50 51for.end: ; preds = %for.cond 52 ret void 53} 54