1; RUN: llc -march=hexagon -enable-pipeliner -fp-contract=fast < %s
2; REQUIRES: asserts
3
4; Test that the code which reuses existing Phis works when the Phis are used
5; in multiple stages. In this case, one can be reused, but the other must be
6; generated.
7
8; Function Attrs: nounwind
9define void @f0(i32 %a0) #0 {
10b0:
11  %v0 = icmp sgt i32 %a0, 0
12  br i1 %v0, label %b1, label %b2
13
14b1:                                               ; preds = %b1, %b0
15  %v1 = phi i32 [ %v11, %b1 ], [ 0, %b0 ]
16  %v2 = phi float [ %v4, %b1 ], [ undef, %b0 ]
17  %v3 = phi float [ %v2, %b1 ], [ undef, %b0 ]
18  %v4 = load float, float* undef, align 4
19  %v5 = fmul float %v4, 0x3FEFAA0000000000
20  %v6 = fadd float undef, %v5
21  %v7 = fmul float %v2, 0xBFFFAA0000000000
22  %v8 = fadd float %v7, %v6
23  %v9 = fmul float %v3, 0x3FEFAA0000000000
24  %v10 = fadd float %v9, %v8
25  store float %v10, float* undef, align 4
26  %v11 = add nsw i32 %v1, 1
27  %v12 = icmp eq i32 %v11, %a0
28  br i1 %v12, label %b2, label %b1
29
30b2:                                               ; preds = %b1, %b0
31  ret void
32}
33
34attributes #0 = { nounwind "target-cpu"="hexagonv55" }
35