1 ; RUN: opt %loadPolly -polly-invariant-load-hoisting=true -polly-optree -analyze < %s | FileCheck %s -match-full-lines
3 ; Move %val to %bodyB, so %bodyA can be removed (by -polly-simplify)
5 ; for (int j = 0; j < n; j += 1) {
7 ; double val = B[0] + 21.0;
13 define void @func(i32 %n, double* noalias nonnull %A, double* noalias nonnull %B) {
18 %j = phi i32 [0, %entry], [%j.inc, %inc]
19 %j.cmp = icmp slt i32 %j, %n
20 br i1 %j.cmp, label %bodyA, label %exit
23 %val1 = load double, double* %B
24 %val2 = fadd double %val1, 21.0
28 store double %val2, double* %A
32 %j.inc = add nuw nsw i32 %j, 1
44 ; CHECK: Instructions copied: 1
45 ; CHECK: Operand trees forwarded: 1
46 ; CHECK: Statements with forwarded operand trees: 1
49 ; CHECK: After statements {
50 ; CHECK-NEXT: Stmt_bodyA
51 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
52 ; CHECK-NEXT: [n] -> { Stmt_bodyA[i0] -> MemRef_val2[] };
53 ; CHECK-NEXT: Instructions {
54 ; CHECK-NEXT: %val1 = load double, double* %B
55 ; CHECK-NEXT: %val2 = fadd double %val1, 2.100000e+01
57 ; CHECK-NEXT: Stmt_bodyB
58 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
59 ; CHECK-NEXT: [n] -> { Stmt_bodyB[i0] -> MemRef_A[0] };
60 ; CHECK-NEXT: Instructions {
61 ; CHECK-NEXT: %val2 = fadd double %val1, 2.100000e+01
62 ; CHECK-NEXT: store double %val2, double* %A