1 ; RUN: opt %loadNPMPolly '-passes=print<polly-function-scops>' -disable-output < %s 2>&1 | FileCheck %s
4 ; CHECK-NEXT: Stmt_for_body
5 ; CHECK-NEXT: Domain :=
6 ; CHECK-NEXT: [N] -> { Stmt_for_body[i0] : 0 <= i0 < N };
7 ; CHECK-NEXT: Schedule :=
8 ; CHECK-NEXT: [N] -> { Stmt_for_body[i0] -> [i0] };
9 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
10 ; CHECK-NEXT: [N] -> { Stmt_for_body[i0] -> MemRef_A[o0] : -4 + N + 5i0 <= 5o0 <= N + 5i0 };
11 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
12 ; CHECK-NEXT: [N] -> { Stmt_for_body[i0] -> MemRef_A[o0] : -N + 5i0 <= 5o0 <= 4 - N + 5i0 };
13 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
14 ; CHECK-NEXT: [N] -> { Stmt_for_body[i0] -> MemRef_A[i0] };
17 ; void f(int *A, int N) {
18 ; for (int i = 0; i < N; i++)
19 ; A[i] = A[i + (N / 5)] + A[i + (N / -5)];
22 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
24 define void @f(ptr %A, i32 %N) {
26 %tmp = sext i32 %N to i64
29 for.cond: ; preds = %for.inc, %entry
30 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
31 %cmp = icmp slt i64 %indvars.iv, %tmp
32 br i1 %cmp, label %for.body, label %for.end
34 for.body: ; preds = %for.cond
36 %tmp1 = trunc i64 %indvars.iv to i32
37 %add = add nsw i32 %tmp1, %div
38 %idxprom = sext i32 %add to i64
39 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
40 %tmp2 = load i32, ptr %arrayidx, align 4
41 %div1 = sdiv i32 %N, -5
42 %tmp3 = trunc i64 %indvars.iv to i32
43 %add2 = add nsw i32 %tmp3, %div1
44 %idxprom3 = sext i32 %add2 to i64
45 %arrayidx4 = getelementptr inbounds i32, ptr %A, i64 %idxprom3
46 %tmp4 = load i32, ptr %arrayidx4, align 4
47 %add5 = add nsw i32 %tmp2, %tmp4
48 %arrayidx7 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
49 store i32 %add5, ptr %arrayidx7, align 4
52 for.inc: ; preds = %for.body
53 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
56 for.end: ; preds = %for.cond