1 ; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-print-scops -disable-output < %s | FileCheck %s
3 ; Verify that we do not allow PHI nodes such as %phi, if they reference an error
4 ; block and are used by anything else than a terminator instruction.
7 ; CHECK-NEXT: Stmt_loop
8 ; CHECK-NEXT: Domain :=
9 ; CHECK-NEXT: [p] -> { Stmt_loop[i0] : p >= 13 and 0 <= i0 <= 1025 };
10 ; CHECK-NEXT: Schedule :=
11 ; CHECK-NEXT: [p] -> { Stmt_loop[i0] -> [i0] };
12 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
13 ; CHECK-NEXT: [p] -> { Stmt_loop[i0] -> MemRef_X[0] };
14 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
15 ; CHECK-NEXT: [p] -> { Stmt_loop[i0] -> MemRef_phi[] };
20 define void @foo(ptr %X, i64 %p) {
25 %cmp1 = icmp sle i64 %p, 12
26 br i1 %cmp1, label %A, label %br2
29 %cmp3 = icmp sle i64 %p, 12
30 br i1 %cmp3, label %cond, label %loop
33 %indvar = phi i64 [0, %br2], [%indvar.next, %loop]
34 %indvar.next = add nsw i64 %indvar, 1
35 store float 41.0, ptr %X
36 %cmp2 = icmp sle i64 %indvar, 1024
37 br i1 %cmp2, label %loop, label %merge
47 %phi = phi i1 [false, %cond2], [true, %loop]
49 br i1 %add, label %A, label %B
52 store float 42.0, ptr %X
57 store float 41.0, ptr %X