1 ; RUN: opt %loadPolly -analyze -polly-scops -polly-detect-keep-going -polly-allow-nonaffine < %s | FileCheck %s
3 ; TODO: FIXME: Investigate why "-polly-detect-keep-going" is needed to detect
4 ; this SCoP. That flag should not make a difference.
7 ; CHECK-NEXT: [N] -> { : -2147483648 <= N <= 2147483647 }
8 ; CHECK-NEXT: Assumed Context:
9 ; CHECK-NEXT: [N] -> { : }
10 ; CHECK-NEXT: Invalid Context:
11 ; CHECK-NEXT: [N] -> { : N >= 514 }
14 ; CHECK-NEXT: Stmt_if_end3
15 ; CHECK-NEXT: Domain :=
16 ; CHECK-NEXT: [N] -> { Stmt_if_end3[i0] : 0 <= i0 < N };
17 ; CHECK-NEXT: Schedule :=
18 ; CHECK-NEXT: [N] -> { Stmt_if_end3[i0] -> [i0] };
19 ; CHECK-NEXT: ReadAccess := [Reduction Type: +] [Scalar: 0]
20 ; CHECK-NEXT: [N] -> { Stmt_if_end3[i0] -> MemRef_A[i0] };
21 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: +] [Scalar: 0]
22 ; CHECK-NEXT: [N] -> { Stmt_if_end3[i0] -> MemRef_A[i0] };
26 ; void g(int *A, int N) {
27 ; for (int i = 0; i < N; i++) {
37 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
39 define void @g(i32* %A, i32 %N) {
41 %tmp = sext i32 %N to i64
44 for.cond: ; preds = %for.inc, %entry
45 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
46 %cmp = icmp slt i64 %indvars.iv, %tmp
47 br i1 %cmp, label %for.body, label %for.end
49 for.body: ; preds = %for.cond
50 %cmp1 = icmp sgt i64 %indvars.iv, 512
51 br i1 %cmp1, label %if.then, label %if.end3
53 if.then: ; preds = %for.body
54 %call = call i32 (...) @f()
58 %idxprom = sext i32 %call to i64
59 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %idxprom
60 %tmp1 = load i32, i32* %arrayidx, align 4
61 %inc = add nsw i32 %tmp1, 1
62 store i32 %inc, i32* %arrayidx, align 4
65 if.end3: ; preds = %if.end, %for.body
66 %arrayidx5 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
67 %tmp2 = load i32, i32* %arrayidx5, align 4
68 %inc6 = add nsw i32 %tmp2, 1
69 store i32 %inc6, i32* %arrayidx5, align 4
72 for.inc: ; preds = %if.end3, %if.then2
73 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
76 for.end: ; preds = %for.cond