1 ; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-print-scops -disable-output < %s | FileCheck %s
2 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-n8:16:32:64-S128"
4 ; void foo(long n, long m, long o, double A[n][m][o]) {
6 ; for (long i = 0; i < n-13; i++)
7 ; for (long j = 14; j < m; j++)
8 ; for (long k = 0; k < o-17; k++) {
9 ; A[i+3][j-4][k+7] = 1.0;
10 ; A[i+13][j-14][k+17] = 11.0;
14 ; CHECK: Assumed Context:
21 ; CHECK: [o, m, n] -> { Stmt_for_k[i0, i1, i2] -> MemRef_A[3 + i0, 10 + i1, 7 + i2] };
22 ; CHECK: [o, m, n] -> { Stmt_for_k[i0, i1, i2] -> MemRef_A[13 + i0, i1, 17 + i2] };
24 define void @foo(i64 %n, i64 %m, i64 %o, ptr %A) {
29 %i = phi i64 [ 0, %entry ], [ %i.inc, %for.i.inc ]
33 %j = phi i64 [ 14, %for.i ], [ %j.inc, %for.j.inc ]
37 %k = phi i64 [ 0, %for.j ], [ %k.inc, %for.k.inc ]
39 %offset0 = add nsw i64 %i, 3
40 %subscript0 = mul i64 %offset0, %m
41 %offset1 = add nsw i64 %j, -4
42 %subscript1 = add i64 %offset1, %subscript0
43 %subscript2 = mul i64 %subscript1, %o
44 %offset2 = add nsw i64 %k, 7
45 %subscript3 = add i64 %subscript2, %offset2
46 %idx = getelementptr inbounds double, ptr %A, i64 %subscript3
47 store double 1.0, ptr %idx
49 %offset3 = add nsw i64 %i, 13
50 %subscript4 = mul i64 %offset3, %m
51 %offset4 = add nsw i64 %j, -14
52 %subscript5 = add i64 %offset4, %subscript4
53 %subscript6 = mul i64 %subscript5, %o
54 %offset5 = add nsw i64 %k, 17
55 %subscript7 = add i64 %subscript6, %offset5
56 %idx1 = getelementptr inbounds double, ptr %A, i64 %subscript7
57 store double 11.0, ptr %idx1
62 %k.inc = add nsw i64 %k, 1
63 %osub = sub nsw i64 %o, 17
64 %k.exitcond = icmp eq i64 %k.inc, %osub
65 br i1 %k.exitcond, label %for.j.inc, label %for.k
68 %j.inc = add nsw i64 %j, 1
69 %j.exitcond = icmp eq i64 %j.inc, %m
70 br i1 %j.exitcond, label %for.i.inc, label %for.j
73 %i.inc = add nsw i64 %i, 1
74 %nsub = sub nsw i64 %n, 13
75 %i.exitcond = icmp eq i64 %i.inc, %nsub
76 br i1 %i.exitcond, label %end, label %for.i