brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 860e603 Raw
60 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<optree>' -polly-print-optree -disable-output < %s | FileCheck %s -match-full-lines2;3; Rematerialize a load.4;5; for (int j = 0; j < n; j += 1) {6; bodyA:7;   double val = B[j];8;9; bodyB:10;   A[j] = val;11; }12;13define void @func(i32 %n, ptr noalias nonnull %A, ptr noalias nonnull %B) {14entry:15  br label %for16 17for:18  %j = phi i32 [0, %entry], [%j.inc, %inc]19  %j.cmp = icmp slt i32 %j, %n20  br i1 %j.cmp, label %bodyA, label %exit21 22    bodyA:23      %B_idx = getelementptr inbounds double, ptr %B, i32 %j24      %val = load double, ptr %B_idx25      br label %bodyB26 27    bodyB:28      %A_idx = getelementptr inbounds double, ptr %A, i32 %j29      store double %val, ptr %A_idx30      br label %inc31 32inc:33  %j.inc = add nuw nsw i32 %j, 134  br label %for35 36exit:37  br label %return38 39return:40  ret void41}42 43 44; CHECK: Statistics {45; CHECK:     Known loads forwarded: 146; CHECK:     Operand trees forwarded: 147; CHECK:     Statements with forwarded operand trees: 148; CHECK: }49 50; CHECK:      Stmt_bodyB51; CHECK-NEXT:         ReadAccess :=       [Reduction Type: NONE] [Scalar: 0]52; CHECK-NEXT:             ;53; CHECK-NEXT:        new: [n] -> { Stmt_bodyB[i0] -> MemRef_B[i0] };54; CHECK-NEXT:         MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 0]55; CHECK-NEXT:             [n] -> { Stmt_bodyB[i0] -> MemRef_A[i0] };56; CHECK-NEXT:         Instructions {57; CHECK-NEXT:               %val = load double, ptr %B_idx, align 858; CHECK-NEXT:               store double %val, ptr %A_idx, align 859; CHECK-NEXT:         }60