1 ; RUN: opt %loadPolly -polly-optree -analyze < %s | FileCheck %s -match-full-lines
3 ; Rematerialize a load.
5 define void @func(i32 %n, double* noalias nonnull %A, double* noalias nonnull %B) {
10 %j = phi i32 [0, %entry], [%j.inc, %inc]
11 %j.cmp = icmp slt i32 %j, %n
12 br i1 %j.cmp, label %bodyA, label %exit
15 %B_idx = getelementptr inbounds double, double* %B, i32 %j
16 %val = load double, double* %B_idx
20 %A_idx = getelementptr inbounds double, double* %A, i32 %j
21 store double %val, double* %A_idx
25 %j.inc = add nuw nsw i32 %j, 1
37 ; CHECK: Known loads forwarded: 1
38 ; CHECK: Operand trees forwarded: 1
39 ; CHECK: Statements with forwarded operand trees: 1
43 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
45 ; CHECK-NEXT: new: [n] -> { Stmt_bodyB[i0] -> MemRef_B[i0] };
46 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
47 ; CHECK-NEXT: [n] -> { Stmt_bodyB[i0] -> MemRef_A[i0] };
48 ; CHECK-NEXT: Instructions {
49 ; CHECK-NEXT: %val = load double, double* %B_idx
50 ; CHECK-NEXT: store double %val, double* %A_idx