1 ; RUN: opt %loadPolly -S \
2 ; RUN: -polly-analyze-read-only-scalars=false -polly-codegen < %s | FileCheck %s
4 ; RUN: opt %loadPolly -S \
5 ; RUN: -polly-analyze-read-only-scalars=true -polly-codegen < %s | FileCheck %s
7 ; float f(float *A, int N) {
9 ; for (int i = 0; i < N; i++)
14 ; CHECK-LABEL: polly.merge_new_and_old:
15 ; CHECK-NEXT: %tmp.0.merge = phi float [ %tmp.0.final_reload, %polly.exiting ], [ %tmp.0, %bb8 ]
16 ; CHECK-NEXT: br label %exit
18 ; CHECK-LABEL: polly.start:
19 ; CHECK-NEXT: store float 0.000000e+00, ptr %tmp.0.phiops
22 ; CHECK-LABEL: polly.exiting:
23 ; CHECK-NEXT: %tmp.0.final_reload = load float, ptr %tmp.0.s2a
24 ; CHECK-NEXT: br label %polly.merge_new_and_old
26 ; CHECK-LABEL: polly.stmt.bb1{{[0-9]*}}:
27 ; CHECK-NEXT: %tmp.0.phiops.reload[[R1:[0-9]*]] = load float, ptr %tmp.0.phiops
28 ; CHECK-: store float %tmp.0.phiops.reload[[R1]], ptr %tmp.0.s2a
30 ; CHECK-LABEL: polly.stmt.bb4:
31 ; CHECK: %tmp.0.s2a.reload[[R3:[0-9]*]] = load float, ptr %tmp.0.s2a
32 ; CHECK: %tmp[[R5:[0-9]*]]_p_scalar_ = load float, ptr %scevgep, align 4, !alias.scope !0, !noalias !3
33 ; CHECK: %p_tmp[[R4:[0-9]*]] = fadd float %tmp.0.s2a.reload[[R3]], %tmp[[R5]]_p_scalar_
34 ; CHECK: store float %p_tmp[[R4]], ptr %tmp.0.phiops
36 ; CHECK-LABEL: polly.stmt.bb1{{[0-9]*}}:
37 ; CHECK-NEXT: %tmp.0.phiops.reload[[R2:[0-9]*]] = load float, ptr %tmp.0.phiops
38 ; CHECK: store float %tmp.0.phiops.reload[[R2]], ptr %tmp.0.s2a
40 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
42 define float @f(ptr %A, i32 %N) {
44 %tmp = sext i32 %N to i64
47 bb1: ; preds = %bb4, %bb
48 %indvars.iv = phi i64 [ %indvars.iv.next, %bb4 ], [ 0, %bb ]
49 %tmp.0 = phi float [ 0.000000e+00, %bb ], [ %tmp7, %bb4 ]
50 %tmp2 = icmp slt i64 %indvars.iv, %tmp
51 br i1 %tmp2, label %bb3, label %bb8
57 %tmp5 = getelementptr inbounds float, ptr %A, i64 %indvars.iv
58 %tmp6 = load float, ptr %tmp5, align 4
59 %tmp7 = fadd float %tmp.0, %tmp6
60 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1