1 ; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s
3 ;void f(long a[][128], long N, long M) {
5 ; for (j = 0; j < (4*N + 7*M +3); ++j)
6 ; for (i = j; i < (5*N + 2); ++i)
10 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
12 define void @f([128 x i64]* nocapture %a, i64 %N, i64 %M) nounwind {
14 %0 = shl i64 %N, 2 ; <i64> [#uses=2]
15 %1 = mul i64 %M, 7 ; <i64> [#uses=2]
16 %2 = or i64 %0, 3 ; <i64> [#uses=1]
17 %3 = add nsw i64 %2, %1 ; <i64> [#uses=1]
18 %4 = icmp sgt i64 %3, 0 ; <i1> [#uses=1]
19 br i1 true, label %bb.nph8, label %return
21 bb1: ; preds = %bb2.preheader, %bb1
22 %indvar = phi i64 [ 0, %bb2.preheader ], [ %indvar.next, %bb1 ] ; <i64> [#uses=2]
23 %scevgep = getelementptr [128 x i64], [128 x i64]* %a, i64 %indvar, i64 %tmp10 ; <i64*> [#uses=1]
24 store i64 0, i64* %scevgep, align 8
25 %indvar.next = add i64 %indvar, 1 ; <i64> [#uses=2]
26 %exitcond = icmp sge i64 %indvar.next, %tmp9 ; <i1> [#uses=1]
27 br i1 %exitcond, label %bb3, label %bb1
29 bb3: ; preds = %bb2.preheader, %bb1
30 %5 = add i64 %8, 1 ; <i64> [#uses=2]
31 %exitcond14 = icmp sge i64 %5, %tmp13 ; <i1> [#uses=1]
32 br i1 %exitcond14, label %return, label %bb2.preheader
34 bb.nph8: ; preds = %entry
35 %6 = mul i64 %N, 5 ; <i64> [#uses=1]
36 %7 = add nsw i64 %6, 2 ; <i64> [#uses=2]
37 %tmp12 = add i64 %1, %0 ; <i64> [#uses=1]
38 %tmp13 = add i64 %tmp12, 3 ; <i64> [#uses=1]
39 br label %bb2.preheader
41 bb2.preheader: ; preds = %bb.nph8, %bb3
42 %8 = phi i64 [ 0, %bb.nph8 ], [ %5, %bb3 ] ; <i64> [#uses=4]
43 %tmp10 = mul i64 %8, 129 ; <i64> [#uses=1]
44 %tmp9 = sub i64 %7, %8 ; <i64> [#uses=1]
45 %9 = icmp sgt i64 %7, %8 ; <i1> [#uses=1]
46 br i1 %9, label %bb1, label %bb3
48 return: ; preds = %bb3, %entry
57 ; CHECK-NEXT: Stmt_bb1
58 ; CHECK-NEXT: Domain :=
59 ; CHECK-NEXT: [N, M] -> { Stmt_bb1[i0, i1] : 0 <= i0 <= 2 + 4N + 7M and 0 <= i1 <= 1 + 5N - i0; Stmt_bb1[0, i1] : 7M <= -3 - 4N and 0 <= i1 <= 1 + 5N };
60 ; CHECK-NEXT: Schedule :=
61 ; CHECK-NEXT: [N, M] -> { Stmt_bb1[i0, i1] -> [i0, i1] : i0 <= 2 + 4N + 7M; Stmt_bb1[0, i1] -> [0, i1] : 7M <= -3 - 4N };
62 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
63 ; CHECK-NEXT: [N, M] -> { Stmt_bb1[i0, i1] -> MemRef_a[i1, 129i0] };