1 ; RUN: opt %loadPolly -polly-optree -analyze < %s | FileCheck %s -match-full-lines
3 define void @func(i32 %n, double* noalias nonnull %A, double* noalias nonnull %B) {
8 %j = phi i32 [0, %entry], [%j.inc, %inc]
9 %j.cmp = icmp sle i32 %j, %n
10 br i1 %j.cmp, label %bodyA, label %exit
13 %i = phi i32 [0, %for], [%i.inc, %bodyA]
14 %B_idx = getelementptr inbounds double, double* %B, i32 %i
15 %val = load double, double* %B_idx
16 %i.inc = add nuw nsw i32 %i, 1
17 %i.cmp = icmp slt i32 %i, %n
18 br i1 %i.cmp, label %bodyA, label %bodyB
21 %A_idx = getelementptr inbounds double, double* %A, i32 %j
22 store double %val, double* %A_idx
26 %j.inc = add nuw nsw i32 %j, 1
38 ; CHECK: Known loads forwarded: 1
39 ; CHECK: Operand trees forwarded: 1
40 ; CHECK: Statements with forwarded operand trees: 1
43 ; CHECK: After statements {
44 ; CHECK-NEXT: Stmt_bodyA
45 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
46 ; CHECK-NEXT: [n] -> { Stmt_bodyA[i0, i1] -> MemRef_B[i1] };
47 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
48 ; CHECK-NEXT: [n] -> { Stmt_bodyA[i0, i1] -> MemRef_val[] };
49 ; CHECK-NEXT: Instructions {
50 ; CHECK-NEXT: %val = load double, double* %B_idx
51 ; CHECK-NEXT: %i.cmp = icmp slt i32 %i, %n
53 ; CHECK-NEXT: Stmt_bodyB
54 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
56 ; CHECK-NEXT: new: [n] -> { Stmt_bodyB[i0] -> MemRef_B[n] };
57 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
58 ; CHECK-NEXT: [n] -> { Stmt_bodyB[i0] -> MemRef_A[i0] };
59 ; CHECK-NEXT: Instructions {
60 ; CHECK-NEXT: %val = load double, double* %B_idx
61 ; CHECK-NEXT: store double %val, double* %A_idx