1 ; RUN: opt %loadPolly -polly-print-optree -disable-output < %s | FileCheck %s -match-full-lines
3 ; Rematerialize a load.
5 ; for (int j = 0; j < n; j += 1) {
14 declare double @f() #0
16 define void @func(i32 %n, ptr noalias nonnull %A, ptr noalias nonnull %B) {
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 %val = call double @f()
27 %A_idx = getelementptr inbounds double, ptr %A, i32 %j
28 store double %val, ptr %A_idx
32 %B_idx = getelementptr inbounds double, ptr %B, i32 %j
33 store double %val, ptr %B_idx
37 %j.inc = add nuw nsw i32 %j, 1
47 attributes #0 = { nounwind readnone }
54 ; CHECK: After statements {
55 ; CHECK-NEXT: Stmt_bodyA
56 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
57 ; CHECK-NEXT: [n] -> { Stmt_bodyA[i0] -> MemRef_A[i0] };
58 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
59 ; CHECK-NEXT: [n] -> { Stmt_bodyA[i0] -> MemRef_val[] };
60 ; CHECK-NEXT: Instructions {
61 ; CHECK-NEXT: %val = call double @f()
62 ; CHECK-NEXT: store double %val, ptr %A_idx, align 8
64 ; CHECK-NEXT: Stmt_bodyB
65 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
66 ; CHECK-NEXT: [n] -> { Stmt_bodyB[i0] -> MemRef_B[i0] };
67 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
68 ; CHECK-NEXT: [n] -> { Stmt_bodyB[i0] -> MemRef_val[] };
69 ; CHECK-NEXT: new: [n] -> { Stmt_bodyB[i0] -> MemRef_A[i0] };
70 ; CHECK-NEXT: Instructions {
71 ; CHECK-NEXT: store double %val, ptr %B_idx, align 8