53 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<scops>' -polly-print-scops -disable-output < %s 2>&1 | FileCheck %s2;3; CHECK: Invariant Accesses: {4; CHECK-NEXT: }5;6; CHECK-NOT: Stmt_if_then7;8;9; void f(int *A) {10; for (int i = 1; i < 10; i++) {11; A[i]++;12; if (i > 10)13; A[i] += A[0];14; }15; }16;17target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"18 19define void @f(ptr %A) {20entry:21 br label %for.cond22 23for.cond: ; preds = %for.inc, %entry24 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %entry ]25 %exitcond = icmp ne i64 %indvars.iv, 1026 br i1 %exitcond, label %for.body, label %for.end27 28for.body: ; preds = %for.cond29 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv30 %tmp = load i32, ptr %arrayidx, align 431 %inc = add nsw i32 %tmp, 132 store i32 %inc, ptr %arrayidx, align 433 br i1 false, label %if.then, label %if.end34 35if.then: ; preds = %for.body36 %tmp1 = load i32, ptr %A, align 437 %arrayidx4 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv38 %tmp2 = load i32, ptr %arrayidx4, align 439 %add = add nsw i32 %tmp2, %tmp140 store i32 %add, ptr %arrayidx4, align 441 br label %if.end42 43if.end: ; preds = %if.then, %for.body44 br label %for.inc45 46for.inc: ; preds = %if.end47 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 148 br label %for.cond49 50for.end: ; preds = %for.cond51 ret void52}53