1 ; RUN: opt %loadPolly -polly-print-optree -disable-output < %s | FileCheck %s -match-full-lines
3 ; Rematerialize a load.
4 ; The non-analyzable store to C[0] is unrelated and can be ignored.
6 ; for (int j = 0; j < n; j += 1) {
16 define void @func(i32 %n, ptr noalias nonnull %A, ptr noalias nonnull %B, ptr noalias %C) {
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 %B_idx = getelementptr inbounds double, ptr %B, i32 %j
27 %val = load double, ptr %B_idx
28 store double 21.0, ptr %C
29 store double 41.0, ptr %C
33 %A_idx = getelementptr inbounds double, ptr %A, i32 %j
34 store double %val, ptr %A_idx
38 %j.inc = add nuw nsw i32 %j, 1
50 ; CHECK: Known loads forwarded: 1
51 ; CHECK: Operand trees forwarded: 1
52 ; CHECK: Statements with forwarded operand trees: 1
56 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
58 ; CHECK-NEXT: new: [n] -> { Stmt_bodyB[i0] -> MemRef_B[i0] };
59 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
60 ; CHECK-NEXT: [n] -> { Stmt_bodyB[i0] -> MemRef_A[i0] };
61 ; CHECK-NEXT: Instructions {
62 ; CHECK-NEXT: %val = load double, ptr %B_idx, align 8
63 ; CHECK-NEXT: store double %val, ptr %A_idx, align 8