1 ; RUN: opt %loadPolly -polly-stmt-granularity=scalar-indep -polly-print-instructions -polly-print-scops -disable-output < %s | FileCheck %s -match-full-lines
3 ; Check that the PHI Write of value that is defined in the same basic
4 ; block is in the statement where it is defined.
6 ; for (int j = 0; j < n; j += 1) {
17 define void @func(i32 %n, ptr noalias nonnull %A, ptr noalias nonnull %B) {
22 %j = phi i32 [0, %entry], [%j.inc, %inc]
23 %j.cmp = icmp slt i32 %j, %n
24 br i1 %j.cmp, label %bodyA, label %exit
27 %valA = load double, ptr %A
28 store double %valA, ptr %A
29 %valB = load double, ptr %B
30 store double %valB, ptr %B
34 %phi = phi double [%valA, %bodyA]
38 %j.inc = add nuw nsw i32 %j, 1
50 ; CHECK-NEXT: Stmt_bodyA
51 ; CHECK-NEXT: Domain :=
52 ; CHECK-NEXT: [n] -> { Stmt_bodyA[i0] : 0 <= i0 < n };
53 ; CHECK-NEXT: Schedule :=
54 ; CHECK-NEXT: [n] -> { Stmt_bodyA[i0] -> [i0, 0] };
55 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
56 ; CHECK-NEXT: [n] -> { Stmt_bodyA[i0] -> MemRef_A[0] };
57 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
58 ; CHECK-NEXT: [n] -> { Stmt_bodyA[i0] -> MemRef_A[0] };
59 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
60 ; CHECK-NEXT: [n] -> { Stmt_bodyA[i0] -> MemRef_phi__phi[] };
61 ; CHECK-NEXT: Instructions {
62 ; CHECK-NEXT: %valA = load double, ptr %A, align 8
63 ; CHECK-NEXT: store double %valA, ptr %A, align 8
65 ; CHECK-NEXT: Stmt_bodyA_b
66 ; CHECK-NEXT: Domain :=
67 ; CHECK-NEXT: [n] -> { Stmt_bodyA_b[i0] : 0 <= i0 < n };
68 ; CHECK-NEXT: Schedule :=
69 ; CHECK-NEXT: [n] -> { Stmt_bodyA_b[i0] -> [i0, 1] };
70 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
71 ; CHECK-NEXT: [n] -> { Stmt_bodyA_b[i0] -> MemRef_B[0] };
72 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
73 ; CHECK-NEXT: [n] -> { Stmt_bodyA_b[i0] -> MemRef_B[0] };
74 ; CHECK-NEXT: Instructions {
75 ; CHECK-NEXT: %valB = load double, ptr %B, align 8
76 ; CHECK-NEXT: store double %valB, ptr %B, align 8