1 ; RUN: opt %loadPolly -polly-print-optree -disable-output < %s | FileCheck %s -match-full-lines
3 ; Forward an operand tree consisting of a speculatable instruction (%add)
6 ; for (int j = 0; j < n; j += 1) {
9 ; double add = val + 42.0;
15 define void @func(i32 %n, ptr noalias nonnull %A, ptr noalias nonnull %B) {
20 %j = phi i32 [0, %entry], [%j.inc, %inc]
21 %j.cmp = icmp slt i32 %j, %n
22 br i1 %j.cmp, label %bodyA, label %exit
25 %B_idx = getelementptr inbounds double, ptr %B, i32 %j
26 %val = load double, ptr %B_idx
27 %add = fadd double %val, 42.0
31 %A_idx = getelementptr inbounds double, ptr %A, i32 %j
32 store double %add, ptr %A_idx
36 %j.inc = add nuw nsw i32 %j, 1
48 ; CHECK: Instructions copied: 1
49 ; CHECK: Known loads forwarded: 1
50 ; CHECK: Operand trees forwarded: 1
51 ; CHECK: Statements with forwarded operand trees: 1
54 ; CHECK: After statements {
55 ; CHECK-NEXT: Stmt_bodyA
56 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
57 ; CHECK-NEXT: [n] -> { Stmt_bodyA[i0] -> MemRef_B[i0] };
58 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
59 ; CHECK-NEXT: [n] -> { Stmt_bodyA[i0] -> MemRef_add[] };
60 ; CHECK-NEXT: Instructions {
61 ; CHECK-NEXT: %val = load double, ptr %B_idx, align 8
62 ; CHECK-NEXT: %add = fadd double %val, 4.200000e+01
64 ; CHECK-NEXT: Stmt_bodyB
65 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
67 ; CHECK-NEXT: new: [n] -> { Stmt_bodyB[i0] -> MemRef_B[i0] };
68 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
69 ; CHECK-NEXT: [n] -> { Stmt_bodyB[i0] -> MemRef_A[i0] };
70 ; CHECK-NEXT: Instructions {
71 ; CHECK-NEXT: %val = load double, ptr %B_idx, align 8
72 ; CHECK-NEXT: %add = fadd double %val, 4.200000e+01
73 ; CHECK-NEXT: store double %add, ptr %A_idx, align 8