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_if_then 10; CHECK-NEXT: Domain := 11; CHECK-NEXT: [N] -> { Stmt_if_then[i0] : (1 + i0) mod 2 = 0 and 0 < i0 < N } 12; CHECK-NEXT: Schedule := 13; CHECK-NEXT: [N] -> { Stmt_if_then[i0] -> [i0] }; 14; CHECK-NEXT: ReadAccess := [Reduction Type: +] [Scalar: 0] 15; CHECK-NEXT: [N] -> { Stmt_if_then[i0] -> MemRef_A[i0] }; 16; CHECK-NEXT: MustWriteAccess := [Reduction Type: +] [Scalar: 0] 17; CHECK-NEXT: [N] -> { Stmt_if_then[i0] -> MemRef_A[i0] }; 18; CHECK-NEXT: } 19; 20; void f(int *A, int N) { 21; for (int i = 0; i < N; i++) { 22; if (i & 1) 23; A[i]++; 24; } 25; } 26; 27target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 28 29define void @f(i32* %A, i32 %N) { 30entry: 31 %tmp = sext i32 %N to i64 32 br label %for.cond 33 34for.cond: ; preds = %for.inc, %entry 35 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] 36 %cmp = icmp slt i64 %indvars.iv, %tmp 37 br i1 %cmp, label %for.body, label %for.end 38 39for.body: ; preds = %for.cond 40 %tmp1 = trunc i64 %indvars.iv to i32 41 %and = and i32 %tmp1, 1 42 %tobool = icmp eq i32 %and, 0 43 br i1 %tobool, label %if.end, label %if.then 44 45if.then: ; preds = %for.body 46 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv 47 %tmp2 = load i32, i32* %arrayidx, align 4 48 %inc = add nsw i32 %tmp2, 1 49 store i32 %inc, i32* %arrayidx, align 4 50 br label %if.end 51 52if.end: ; preds = %for.body, %if.then 53 br label %for.inc 54 55for.inc: ; preds = %if.end 56 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 57 br label %for.cond 58 59for.end: ; preds = %for.cond 60 ret void 61} 62