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], [%valA, %for]
28 store double %valA, ptr %A
29 %j.cmp = icmp slt i32 %j, %n
30 %j.inc = add nuw nsw i32 %j, 1
31 br i1 %j.cmp, label %for, label %exit
42 ; CHECK-NEXT: Stmt_for
43 ; CHECK-NEXT: Domain :=
44 ; CHECK-NEXT: [n] -> { Stmt_for[i0] : 0 <= i0 <= n; Stmt_for[0] : n < 0 };
45 ; CHECK-NEXT: Schedule :=
46 ; CHECK-NEXT: [n] -> { Stmt_for[i0] -> [i0] : i0 <= n; Stmt_for[0] -> [0] : n < 0 };
47 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
48 ; CHECK-NEXT: [n] -> { Stmt_for[i0] -> MemRef_valA__phi[] };
49 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
50 ; CHECK-NEXT: [n] -> { Stmt_for[i0] -> MemRef_valA__phi[] };
51 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
52 ; CHECK-NEXT: [n] -> { Stmt_for[i0] -> MemRef_valB__phi[] };
53 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
54 ; CHECK-NEXT: [n] -> { Stmt_for[i0] -> MemRef_valB__phi[] };
55 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
56 ; CHECK-NEXT: [n] -> { Stmt_for[i0] -> MemRef_A[0] };
57 ; CHECK-NEXT: Instructions {
58 ; CHECK-NEXT: %valA = phi double [ 4.200000e+01, %entry ], [ %valB, %for ]
59 ; CHECK-NEXT: %valB = phi double [ 2.100000e+01, %entry ], [ %valA, %for ]
60 ; CHECK-NEXT: store double %valA, ptr %A, align 8