67 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<scops>' -polly-print-scops -disable-output < %s 2>&1 | FileCheck %s2;3; void jd(int *A, int c) {4; for (int i = 0; i < 1024; i++) {5; if (c)6; A[i] = 1;7; else8; A[i] = 2;9; }10; }11;12; CHECK: Statements {13; CHECK-LABEL: Stmt_if_else14; CHECK-NOT: Access15; CHECK: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]16; CHECK: [c] -> { Stmt_if_else[i0] -> MemRef_phi__phi[] };17; CHECK-NOT: Access18; CHECK-LABEL: Stmt_if_then19; CHECK-NOT: Access20; CHECK: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]21; CHECK: [c] -> { Stmt_if_then[i0] -> MemRef_phi__phi[] };22; CHECK-NOT: Access23; CHECK-LABEL: Stmt_if_end24; CHECK-NOT: Access25; CHECK: ReadAccess := [Reduction Type: NONE] [Scalar: 1]26; CHECK: [c] -> { Stmt_if_end[i0] -> MemRef_phi__phi[] };27; CHECK-NOT: Access28; CHECK: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]29; CHECK: [c] -> { Stmt_if_end[i0] -> MemRef_A[i0] };30; CHECK-NOT: Access31; CHECK: }32 33target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"34 35define void @jd(ptr %A, i32 %c) {36entry:37 br label %for.cond38 39for.cond: ; preds = %for.inc, %entry40 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]41 %exitcond = icmp ne i64 %indvars.iv, 102442 br i1 %exitcond, label %for.body, label %for.end43 44for.body: ; preds = %for.cond45 %tobool = icmp eq i32 %c, 046 br i1 %tobool, label %if.else, label %if.then47 48if.then: ; preds = %for.body49 br label %if.end50 51if.else: ; preds = %for.body52 br label %if.end53 54if.end: ; preds = %if.else, %if.then55 %phi = phi i32 [ 1, %if.then], [ 2, %if.else ]56 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv57 store i32 %phi, ptr %arrayidx, align 458 br label %for.inc59 60for.inc: ; preds = %if.end61 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 162 br label %for.cond63 64for.end: ; preds = %for.cond65 ret void66}67