1 ; RUN: opt %loadPolly -polly-print-scops -disable-output < %s | FileCheck %s
3 ; Test comes from a bug (15771) or better a feature request. It was not allowed
4 ; in Polly in the old domain generation as ScalarEvolution cannot figure out the
5 ; loop bounds. However, the new domain generation will detect the SCoP.
8 ; CHECK-NEXT: [n] -> { : -2147483648 <= n <= 2147483647 }
13 ; CHECK-NEXT: Stmt_for_next
14 ; CHECK-NEXT: Domain :=
15 ; CHECK-NEXT: [n] -> { Stmt_for_next[i0] : i0 >= 0 and 2i0 <= -3 + n };
16 ; CHECK-NEXT: Schedule :=
17 ; CHECK-NEXT: [n] -> { Stmt_for_next[i0] -> [i0] };
18 ; CHECK-NEXT: ReadAccess := [Reduction Type: +] [Scalar: 0]
19 ; CHECK-NEXT: [n] -> { Stmt_for_next[i0] -> MemRef_A[i0] };
20 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: +] [Scalar: 0]
21 ; CHECK-NEXT: [n] -> { Stmt_for_next[i0] -> MemRef_A[i0] };
24 @A = common global [100 x i32] zeroinitializer, align 16
26 define void @foo(i32 %n) #0 {
30 entry.split: ; preds = %entry
31 %cmp2 = icmp sgt i32 %n, 0
32 br i1 %cmp2, label %for.body.lr.ph, label %for.end
34 for.body.lr.ph: ; preds = %entry.split
37 for.body: ; preds = %for.body.lr.ph, %for.body
38 %indvar = phi i64 [ 0, %for.body.lr.ph ], [ %indvar.next, %for.next ]
39 %arrayidx = getelementptr [100 x i32], ptr @A, i64 0, i64 %indvar
40 %0 = mul i64 %indvar, 2
42 %add1 = trunc i64 %1 to i32
43 %cmp = icmp slt i32 %add1, %n
44 %indvar.next = add i64 %indvar, 1
45 br i1 %cmp, label %for.next, label %for.cond.for.end_crit_edge
48 %2 = load i32, ptr %arrayidx, align 4
49 %add = add nsw i32 %2, 1
50 store i32 %add, ptr %arrayidx, align 4
53 for.cond.for.end_crit_edge: ; preds = %for.body
56 for.end: ; preds = %for.cond.for.end_crit_edge, %entry.split