brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 3837219 Raw
62 lines · plain
1; RUN: opt %loadNPMPolly -polly-stmt-granularity=scalar-indep -polly-print-instructions '-passes=polly-custom<scops>' -polly-print-scops -disable-output < %s 2>&1 | FileCheck %s -match-full-lines2;3; This case has no explicit epilogue for PHI writes because it would4; have a scalar dependency to the previous statement.5;6; for (int j = 0; j < n; j += 1) {7; bodyA:8;   double valA = A[0];9;   A[0] = valA;10;11; bodyB:12;   phi = valA;13; }14;15define void @func(i32 %n, ptr noalias nonnull %A) {16entry:17  br label %for18 19for:20  %j = phi i32 [0, %entry], [%j.inc, %inc]21  %j.cmp = icmp slt i32 %j, %n22  br i1 %j.cmp, label %bodyA, label %exit23 24    bodyA:25      %valA = load double, ptr %A26      store double %valA, ptr %A27      br label %bodyB28 29    bodyB:30      %phi = phi double [%valA, %bodyA]31      br label %inc32 33inc:34  %j.inc = add nuw nsw i32 %j, 135  br label %for36 37exit:38  br label %return39 40return:41  ret void42}43 44 45; CHECK:      Statements {46; CHECK-NEXT:     Stmt_bodyA47; CHECK-NEXT:         Domain :=48; CHECK-NEXT:             [n] -> { Stmt_bodyA[i0] : 0 <= i0 < n };49; CHECK-NEXT:         Schedule :=50; CHECK-NEXT:             [n] -> { Stmt_bodyA[i0] -> [i0] };51; CHECK-NEXT:         ReadAccess :=       [Reduction Type: NONE] [Scalar: 0]52; CHECK-NEXT:             [n] -> { Stmt_bodyA[i0] -> MemRef_A[0] };53; CHECK-NEXT:         MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 0]54; CHECK-NEXT:             [n] -> { Stmt_bodyA[i0] -> MemRef_A[0] };55; CHECK-NEXT:         MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 1]56; CHECK-NEXT:             [n] -> { Stmt_bodyA[i0] -> MemRef_phi__phi[] };57; CHECK-NEXT:         Instructions {58; CHECK-NEXT:               %valA = load double, ptr %A, align 859; CHECK-NEXT:               store double %valA, ptr %A, align 860; CHECK-NEXT:         }61; CHECK-NEXT: }62