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 slt i32 %j, %n
10 br i1 %j.cmp, label %bodyA, label %exit
13 %B_idx = getelementptr inbounds double, double* %B, i32 %j
14 %val = load double, double* %B_idx
15 %add = fadd double %val, 42.0
19 %A_idx = getelementptr inbounds double, double* %A, i32 %j
20 store double %add, double* %A_idx
24 %j.inc = add nuw nsw i32 %j, 1
36 ; CHECK: Instructions copied: 1
37 ; CHECK: Known loads forwarded: 1
38 ; CHECK: Operand trees forwarded: 1
39 ; CHECK: Statements with forwarded operand trees: 1
42 ; CHECK: After statements {
43 ; CHECK-NEXT: Stmt_bodyA
44 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
45 ; CHECK-NEXT: [n] -> { Stmt_bodyA[i0] -> MemRef_B[i0] };
46 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
47 ; CHECK-NEXT: [n] -> { Stmt_bodyA[i0] -> MemRef_add[] };
48 ; CHECK-NEXT: Instructions {
49 ; CHECK-NEXT: %val = load double, double* %B_idx
50 ; CHECK-NEXT: %add = fadd double %val, 4.200000e+01
52 ; CHECK-NEXT: Stmt_bodyB
53 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
55 ; CHECK-NEXT: new: [n] -> { Stmt_bodyB[i0] -> MemRef_B[i0] };
56 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
57 ; CHECK-NEXT: [n] -> { Stmt_bodyB[i0] -> MemRef_A[i0] };
58 ; CHECK-NEXT: Instructions {
59 ; CHECK-NEXT: %val = load double, double* %B_idx
60 ; CHECK-NEXT: %add = fadd double %val, 4.200000e+01
61 ; CHECK-NEXT: store double %add, double* %A_idx