1 ; RUN: llc -march=hexagon -O3 -fp-contract=fast -pipeliner-max-stages=3 < %s
4 ; Check Phis are generated correctly in epilogs after setting -swp-max-stages=3
6 @g0 = private unnamed_addr constant [6 x i8] c"s4116\00", align 1
8 ; Function Attrs: noinline nounwind
9 define void @f0(i32 %a0, i32 %a1, float* nocapture readonly %a2, [1000 x float]* nocapture readonly %a3, i32* nocapture readonly %a4, i32 %a5) #0 {
11 %v0 = tail call i32 bitcast (i32 (...)* @f1 to i32 ()*)() #2
12 %v1 = sitofp i32 %v0 to double
13 %v2 = add nsw i32 %a1, -1
14 %v3 = icmp sgt i32 %a1, 1
15 br i1 %v3, label %b1, label %b3
17 b1: ; preds = %b1, %b0
18 %v4 = phi float [ %v13, %b1 ], [ 0.000000e+00, %b0 ]
19 %v5 = phi float* [ %v16, %b1 ], [ %a2, %b0 ]
20 %v6 = phi i32* [ %v17, %b1 ], [ %a4, %b0 ]
21 %v7 = phi i32 [ %v14, %b1 ], [ 0, %b0 ]
22 %v8 = load float, float* %v5, align 4
23 %v9 = load i32, i32* %v6, align 4
24 %v10 = getelementptr inbounds [1000 x float], [1000 x float]* %a3, i32 %v9, i32 %a5
25 %v11 = load float, float* %v10, align 4
26 %v12 = fmul float %v8, %v11
27 %v13 = fadd float %v4, %v12
28 %v14 = add nuw nsw i32 %v7, 1
29 %v15 = icmp slt i32 %v14, %v2
30 %v16 = getelementptr float, float* %v5, i32 1
31 %v17 = getelementptr i32, i32* %v6, i32 1
32 br i1 %v15, label %b1, label %b2
35 %v18 = fpext float %v13 to double
38 b3: ; preds = %b2, %b0
39 %v19 = phi double [ %v18, %b2 ], [ 0.000000e+00, %b0 ]
40 tail call void @f2(double %v19, i32 %a1, i32 %a1, double %v1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @g0, i32 0, i32 0)) #2
44 declare i32 @f1(...) #1
46 declare void @f2(double, i32, i32, double, i8*) #1
48 attributes #0 = { noinline nounwind "target-cpu"="hexagonv60" }
49 attributes #1 = { "target-cpu"="hexagonv60" }
50 attributes #2 = { nounwind }