1; RUN: opt %loadPolly -analyze -polly-scops < %s | FileCheck %s 2; 3; void jd(int *A, int c) { 4; for (int i = 0; i < 1024; i++) { 5; if (c) 6; A[i] = 1; 7; else 8; A[i] = 2; 9; } 10; } 11; 12; CHECK: Statements { 13; CHECK-LABEL: Stmt_if_else 14; CHECK-NOT: Access 15; CHECK: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1] 16; CHECK: [c] -> { Stmt_if_else[i0] -> MemRef_phi__phi[] }; 17; CHECK-NOT: Access 18; CHECK-LABEL: Stmt_if_then 19; CHECK-NOT: Access 20; CHECK: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1] 21; CHECK: [c] -> { Stmt_if_then[i0] -> MemRef_phi__phi[] }; 22; CHECK-NOT: Access 23; CHECK-LABEL: Stmt_if_end 24; CHECK-NOT: Access 25; CHECK: ReadAccess := [Reduction Type: NONE] [Scalar: 1] 26; CHECK: [c] -> { Stmt_if_end[i0] -> MemRef_phi__phi[] }; 27; CHECK-NOT: Access 28; CHECK: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0] 29; CHECK: [c] -> { Stmt_if_end[i0] -> MemRef_A[i0] }; 30; CHECK-NOT: Access 31; CHECK: } 32 33target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 34 35define void @jd(i32* %A, i32 %c) { 36entry: 37 br label %for.cond 38 39for.cond: ; preds = %for.inc, %entry 40 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] 41 %exitcond = icmp ne i64 %indvars.iv, 1024 42 br i1 %exitcond, label %for.body, label %for.end 43 44for.body: ; preds = %for.cond 45 %tobool = icmp eq i32 %c, 0 46 br i1 %tobool, label %if.else, label %if.then 47 48if.then: ; preds = %for.body 49 br label %if.end 50 51if.else: ; preds = %for.body 52 br label %if.end 53 54if.end: ; preds = %if.else, %if.then 55 %phi = phi i32 [ 1, %if.then], [ 2, %if.else ] 56 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv 57 store i32 %phi, i32* %arrayidx, align 4 58 br label %for.inc 59 60for.inc: ; preds = %if.end 61 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 62 br label %for.cond 63 64for.end: ; preds = %for.cond 65 ret void 66} 67