1; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-scops -analyze < %s | FileCheck %s
2
3declare void @bar()
4
5define void @foo(float* %A, i64 %p) {
6start:
7   br label %next
8
9next:
10   %cmpA = icmp sle i64 %p, 0
11   br i1 %cmpA, label %error, label %ok
12
13error:
14   call void @bar()
15   br label %merge
16
17ok:
18   br label %merge
19
20merge:
21   %phi = phi i64 [0, %error], [1, %ok]
22   store float 42.0, float* %A
23   %cmp = icmp eq i64 %phi, %p
24   br i1 %cmp, label %loop, label %exit
25
26loop:
27   %indvar = phi i64 [0, %merge], [%indvar.next, %loop]
28   store float 42.0, float* %A
29   %indvar.next = add i64 %indvar, 1
30   %cmp2 = icmp sle i64 %indvar, 1024
31   br i1 %cmp2, label %loop, label %exit
32
33exit:
34   ret void
35}
36
37; CHECK:      Statements {
38; CHECK-NEXT: 	Stmt_ok
39; CHECK-NEXT:         Domain :=
40; CHECK-NEXT:             [p] -> { Stmt_ok[] : p > 0 };
41; CHECK-NEXT:         Schedule :=
42; CHECK-NEXT:             [p] -> { Stmt_ok[] -> [0, 0] };
43; CHECK-NEXT:         MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 1]
44; CHECK-NEXT:             [p] -> { Stmt_ok[] -> MemRef_phi__phi[] };
45; CHECK-NEXT: 	Stmt_merge
46; CHECK-NEXT:         Domain :=
47; CHECK-NEXT:             [p] -> { Stmt_merge[] };
48; CHECK-NEXT:         Schedule :=
49; CHECK-NEXT:             [p] -> { Stmt_merge[] -> [1, 0] };
50; CHECK-NEXT:         ReadAccess :=	[Reduction Type: NONE] [Scalar: 1]
51; CHECK-NEXT:             [p] -> { Stmt_merge[] -> MemRef_phi__phi[] };
52; CHECK-NEXT:         MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 0]
53; CHECK-NEXT:             [p] -> { Stmt_merge[] -> MemRef_A[0] };
54; CHECK-NEXT: 	Stmt_loop
55; CHECK-NEXT:         Domain :=
56; CHECK-NEXT:             [p] -> { Stmt_loop[i0] : p = 1 and 0 <= i0 <= 1025 };
57; CHECK-NEXT:         Schedule :=
58; CHECK-NEXT:             [p] -> { Stmt_loop[i0] -> [2, i0] };
59; CHECK-NEXT:         MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 0]
60; CHECK-NEXT:             [p] -> { Stmt_loop[i0] -> MemRef_A[0] };
61; CHECK-NEXT: }
62