1 ; RUN: opt %loadPolly -polly-scops -analyze \
2 ; RUN: < %s | FileCheck %s
4 ; float foo(float sum, float A[]) {
6 ; for (long i = 0; i < 100; i++)
12 ; Verify that we do not model the read from %sum. Reads that only happen in
13 ; case control flow reaches the PHI node from outside the SCoP are handled
14 ; implicitly during code generation.
16 ; CHECK: Stmt_bb1[i0] -> MemRef_phisum__ph
17 ; CHECK-NOT: Stmt_bb1[i0] -> MemRef_sum[]
19 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
21 define float @foo(float %sum, float* %A) {
26 %i = phi i64 [ 0, %bb ], [ %i.next, %bb1 ]
27 %phisum = phi float [ %sum, %bb ], [ %tmp5, %bb1 ]
28 %tmp = getelementptr inbounds float, float* %A, i64 %i
29 %tmp4 = load float, float* %tmp, align 4
30 %tmp5 = fadd float %phisum, %tmp4
31 %i.next = add nuw nsw i64 %i, 1
32 %exitcond = icmp ne i64 %i, 100
33 br i1 %exitcond, label %bb1, label %bb7