1 ; RUN: opt %loadPolly -polly-print-optree -disable-output < %s | FileCheck %s -match-full-lines
3 ; Move %v and %val to %bodyB, so %bodyA can be removed (by -polly-simplify)
5 ; for (int j = 0; j < n; j += 1) {
7 ; double val1 = 12.5 + 12.5;
10 ; double val2 = 21.0 + 21.0;
16 define void @func(i32 %n, ptr noalias nonnull %A) {
21 %j = phi i32 [0, %entry], [%j.inc, %inc]
22 %j.cmp = icmp slt i32 %j, %n
23 br i1 %j.cmp, label %bodyA, label %exit
26 %val1 = fadd double 12.5, 12.5
30 %val2 = fadd double %val1, 21.0
34 store double %val2, ptr %A
38 %j.inc = add nuw nsw i32 %j, 1
50 ; CHECK: Instructions copied: 3
51 ; CHECK: Operand trees forwarded: 2
52 ; CHECK: Statements with forwarded operand trees: 2
55 ; CHECK: After statements {
56 ; CHECK-NEXT: Stmt_bodyA
57 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
58 ; CHECK-NEXT: [n] -> { Stmt_bodyA[i0] -> MemRef_val1[] };
59 ; CHECK-NEXT: Instructions {
60 ; CHECK-NEXT: %val1 = fadd double 1.250000e+01, 1.250000e+01
62 ; CHECK-NEXT: Stmt_bodyB
63 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
64 ; CHECK-NEXT: [n] -> { Stmt_bodyB[i0] -> MemRef_val2[] };
65 ; CHECK-NEXT: Instructions {
66 ; CHECK-NEXT: %val1 = fadd double 1.250000e+01, 1.250000e+01
67 ; CHECK-NEXT: %val2 = fadd double %val1, 2.100000e+01
69 ; CHECK-NEXT: Stmt_bodyC
70 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
71 ; CHECK-NEXT: [n] -> { Stmt_bodyC[i0] -> MemRef_A[0] };
72 ; CHECK-NEXT: Instructions {
73 ; CHECK-NEXT: %val1 = fadd double 1.250000e+01, 1.250000e+01
74 ; CHECK-NEXT: %val2 = fadd double %val1, 2.100000e+01
75 ; CHECK-NEXT: store double %val2, ptr %A, align 8