1; RUN: opt %loadPolly -polly-optree -analyze < %s | FileCheck %s -match-full-lines 2; 3; Move %val to %bodyB, so %bodyA can be removed (by -polly-simplify) 4; 5; for (int j = 0; j < n; j += 1) { 6; bodyA: 7; double val = 21.0 + 21.0; 8; 9; bodyB: 10; A[0] = val; 11; } 12; 13define void @func(i32 %n, double* noalias nonnull %A) { 14entry: 15 br label %for 16 17for: 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 21 22 bodyA: 23 %val = fadd double 21.0, 21.0 24 br label %bodyB 25 26 bodyB: 27 store double %val, double* %A 28 br label %inc 29 30inc: 31 %j.inc = add nuw nsw i32 %j, 1 32 br label %for 33 34exit: 35 br label %return 36 37return: 38 ret void 39} 40 41 42; CHECK: Statistics { 43; CHECK: Instructions copied: 1 44; CHECK: Operand trees forwarded: 1 45; CHECK: Statements with forwarded operand trees: 1 46; CHECK: } 47 48; CHECK: After statements { 49; CHECK-NEXT: Stmt_bodyA 50; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1] 51; CHECK-NEXT: [n] -> { Stmt_bodyA[i0] -> MemRef_val[] }; 52; CHECK-NEXT: Instructions { 53; CHECK-NEXT: %val = fadd double 2.100000e+01, 2.100000e+01 54; CHECK-NEXT: } 55; CHECK-NEXT: Stmt_bodyB 56; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0] 57; CHECK-NEXT: [n] -> { Stmt_bodyB[i0] -> MemRef_A[0] }; 58; CHECK-NEXT: Instructions { 59; CHECK-NEXT: %val = fadd double 2.100000e+01, 2.100000e+01 60; CHECK-NEXT: store double %val, double* %A, align 8 61; CHECK-NEXT: } 62; CHECK-NEXT: } 63