brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1015 B · 528dbb1 Raw
37 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<scops>' -polly-print-scops -disable-output < %s 2>&1 | FileCheck %s2;3;    float foo(float sum, float A[]) {4;5;      for (long i = 0; i < 100; i++)6;        sum += A[i];7;8;      return sum;9;    }10 11; Verify that we do not model the read from %sum. Reads that only happen in12; case control flow reaches the PHI node from outside the SCoP are handled13; implicitly during code generation.14 15; CHECK: Stmt_bb1[i0] -> MemRef_phisum__ph16; CHECK-NOT: Stmt_bb1[i0] -> MemRef_sum[]17 18target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"19 20define float @foo(float %sum, ptr %A) {21bb:22  br label %bb123 24bb1:25  %i = phi i64 [ 0, %bb ], [ %i.next, %bb1 ]26  %phisum = phi float [ %sum, %bb ], [ %tmp5, %bb1 ]27  %tmp = getelementptr inbounds float, ptr %A, i64 %i28  %tmp4 = load float, ptr %tmp, align 429  %tmp5 = fadd float %phisum, %tmp430  %i.next = add nuw nsw i64 %i, 131  %exitcond = icmp ne i64 %i, 10032  br i1 %exitcond, label %bb1, label %bb733 34bb7:35  ret float %phisum36}37