1 ; RUN: llc -fp-contract=fast -O3 -march=hexagon < %s
4 ; Test that the pipeliner doesn't ICE due because the PHI generation
5 ; code in the epilog does not attempt to reuse an existing PHI.
6 ; Similar test case as swp-epilog-reuse.ll but with a couple of
9 ; Function Attrs: nounwind
10 define void @f0(ptr noalias %a0, ptr noalias %a1) #0 {
12 %v0 = getelementptr inbounds float, ptr %a1, i32 2
13 br i1 undef, label %b1, label %b6
15 b1: ; preds = %b5, %b0
16 %v1 = phi ptr [ undef, %b5 ], [ %v0, %b0 ]
17 %v2 = phi ptr [ %v32, %b5 ], [ undef, %b0 ]
18 %v3 = getelementptr inbounds float, ptr %a0, i32 undef
19 %v4 = getelementptr inbounds float, ptr %v1, i32 1
20 br i1 undef, label %b2, label %b5
23 %v5 = getelementptr float, ptr %v3, i32 1
26 b3: ; preds = %b3, %b2
27 %v6 = phi ptr [ %v5, %b2 ], [ %v20, %b3 ]
28 %v7 = phi float [ %v19, %b3 ], [ undef, %b2 ]
29 %v8 = phi float [ %v7, %b3 ], [ undef, %b2 ]
30 %v9 = phi ptr [ %v15, %b3 ], [ %v4, %b2 ]
31 %v11 = fadd float undef, 0.000000e+00
32 %v12 = fadd float undef, %v11
33 %v13 = fadd float %v7, %v12
34 %v14 = fmul float %v13, 3.906250e-03
35 %v15 = getelementptr inbounds float, ptr %v9, i32 1
36 store float %v14, ptr %v9, align 4, !tbaa !0
37 %v16 = getelementptr i8, ptr %v6, i32 undef
38 %v18 = load float, ptr %v16, align 4, !tbaa !0
39 %v19 = fadd float %v18, undef
40 %v20 = getelementptr float, ptr %v6, i32 2
41 %v21 = icmp ult ptr %v15, %v2
42 br i1 %v21, label %b3, label %b4
45 %v22 = getelementptr float, ptr %v4, i32 undef
48 b5: ; preds = %b4, %b1
49 %v23 = phi ptr [ %v4, %b1 ], [ %v22, %b4 ]
50 %v24 = phi float [ undef, %b1 ], [ %v8, %b4 ]
51 %v25 = fadd float %v24, undef
52 %v26 = fadd float %v25, undef
53 %v27 = fadd float undef, %v26
54 %v28 = fadd float undef, %v27
55 %v29 = fpext float %v28 to double
56 %v30 = fmul double %v29, 0x3F7111112119E8FB
57 %v31 = fptrunc double %v30 to float
58 store float %v31, ptr %v23, align 4, !tbaa !0
59 %v32 = getelementptr inbounds float, ptr %v2, i32 undef
60 br i1 undef, label %b1, label %b6
62 b6: ; preds = %b5, %b0
66 attributes #0 = { nounwind "target-cpu"="hexagonv55" }
69 !1 = !{!"omnipotent char", !2, i64 0}
70 !2 = !{!"Simple C/C++ TBAA"}