1 ; RUN: opt %loadPolly -polly-stmt-granularity=scalar-indep -polly-print-instructions -polly-print-scops -disable-output < %s | FileCheck %s -match-full-lines
3 ; Two PHIs, cross-referencing each other. The PHI READs must be carried-out
4 ; before the PHI WRITEs to ensure that the value when entering the block is
6 ; This means that either both PHIs have to be in the same statement, or the
7 ; PHI WRITEs located in a statement after the PHIs.
9 ; for (int j = 0; j < n; j += 1) {
20 define void @func(i32 %n, ptr noalias nonnull %A) {
25 %j = phi i32 [0, %entry], [%j.inc, %for]
26 %valA = phi double [42.0, %entry], [%valB, %for]
27 %valB = phi double [21.0, %entry], [%add, %for]
28 store double %valB, ptr %A
29 %add = fadd double %valA, 0.1
30 %j.cmp = icmp slt i32 %j, %n
31 %j.inc = add nuw nsw i32 %j, 1
32 br i1 %j.cmp, label %for, label %exit
43 ; CHECK-NEXT: Stmt_for
44 ; CHECK-NEXT: Domain :=
45 ; CHECK-NEXT: [n] -> { Stmt_for[i0] : 0 <= i0 <= n; Stmt_for[0] : n < 0 };
46 ; CHECK-NEXT: Schedule :=
47 ; CHECK-NEXT: [n] -> { Stmt_for[i0] -> [i0] : i0 <= n; Stmt_for[0] -> [0] : n < 0 };
48 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
49 ; CHECK-NEXT: [n] -> { Stmt_for[i0] -> MemRef_valA__phi[] };
50 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
51 ; CHECK-NEXT: [n] -> { Stmt_for[i0] -> MemRef_valA__phi[] };
52 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
53 ; CHECK-NEXT: [n] -> { Stmt_for[i0] -> MemRef_valB__phi[] };
54 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
55 ; CHECK-NEXT: [n] -> { Stmt_for[i0] -> MemRef_valB__phi[] };
56 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
57 ; CHECK-NEXT: [n] -> { Stmt_for[i0] -> MemRef_A[0] };
58 ; CHECK-NEXT: Instructions {
59 ; CHECK-NEXT: %valA = phi double [ 4.200000e+01, %entry ], [ %valB, %for ]
60 ; CHECK-NEXT: %valB = phi double [ 2.100000e+01, %entry ], [ %add, %for ]
61 ; CHECK-NEXT: store double %valB, ptr %A, align 8
62 ; CHECK-NEXT: %add = fadd double %valA, 1.000000e-01