-; RUN: opt %loadPolly -polly-scops -analyze -polly-delinearize < %s | FileCheck %s
+; RUN: opt %loadPolly -polly-scops -analyze -polly-delinearize -polly-codegen-scev < %s | FileCheck %s
; void foo(long n, long m, long o, double A[n][m][o]) {
-; for (long i = 0; i < n; i++)
-; for (long j = 0; j < m; j++)
-; for (long k = 0; k < o; k++) {
+; for (long i = 0; i < n-3; i++)
+; for (long j = 4; j < m; j++)
+; for (long k = 0; k < o-7; k++) {
; A[i+3][j-4][k+7] = 1.0;
; A[i][0][k] = 2.0;
; }
; }
-; CHECK: [n, m, o] -> { Stmt_for_body6[i0, i1, i2] -> MemRef_A[3 + i0, -4 + i1, 7 + i2] };
+; CHECK: [n, m, o] -> { Stmt_for_body6[i0, i1, i2] -> MemRef_A[3 + i0, i1, 7 + i2] };
; CHECK: [n, m, o] -> { Stmt_for_body6[i0, i1, i2] -> MemRef_A[i0, 0, i2] };
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
br label %for.cond4.preheader
for.cond4.preheader: ; preds = %for.inc13, %for.cond4.preheader.lr.ph
- %j.034 = phi i64 [ 0, %for.cond4.preheader.lr.ph ], [ %inc14, %for.inc13 ]
+ %j.034 = phi i64 [ 4, %for.cond4.preheader.lr.ph ], [ %inc14, %for.inc13 ]
br i1 %cmp531, label %for.body6.lr.ph, label %for.inc13
for.body6.lr.ph: ; preds = %for.cond4.preheader
%arrayidx12 = getelementptr inbounds double* %A, i64 %arrayidx10.sum
store double 2.000000e+00, double* %arrayidx12, align 8
%inc = add nsw i64 %k.032, 1
- %exitcond = icmp eq i64 %inc, %o
+ %osub = sub nsw i64 %o, 7
+ %exitcond = icmp eq i64 %inc, %osub
br i1 %exitcond, label %for.inc13, label %for.body6
for.inc13: ; preds = %for.body6, %for.cond4.preheader
for.inc16: ; preds = %for.inc13, %for.cond1.preheader
%inc17 = add nsw i64 %i.036, 1
- %exitcond38 = icmp eq i64 %inc17, %n
+ %nsub = sub nsw i64 %n, 3
+ %exitcond38 = icmp eq i64 %inc17, %nsub
br i1 %exitcond38, label %for.end18, label %for.cond1.preheader
for.end18: ; preds = %for.inc16, %entry