1 ; RUN: llc -march=hexagon -enable-pipeliner -debug-only=pipeliner < %s -o - 2>&1 > /dev/null -pipeliner-experimental-cg=true | FileCheck %s
4 ; Test that checks that we compute the correct ResMII for haar.
6 ; CHECK: MII = 4 MAX_II = 14 (rec=1, res=4)
8 ; Function Attrs: nounwind
9 define void @f0(ptr noalias nocapture readonly %a0, i32 %a1, i32 %a2, i32 %a3, ptr noalias nocapture %a4, i32 %a5) #0 {
13 %v2 = add i32 %v1, %v0
14 %v3 = icmp sgt i32 %a2, 0
15 br i1 %v3, label %b1, label %b8
18 %v4 = sdiv i32 %a1, 64
19 %v5 = icmp sgt i32 %a1, 63
22 b2: ; preds = %b6, %b1
23 %v6 = phi i32 [ 0, %b1 ], [ %v56, %b6 ]
24 %v7 = ashr exact i32 %v6, 1
25 %v8 = mul nsw i32 %v7, %a3
26 br i1 %v5, label %b3, label %b6
29 %v9 = add nsw i32 %v6, 1
30 %v10 = mul nsw i32 %v9, %a5
31 %v11 = mul nsw i32 %v6, %a5
32 %v12 = add i32 %v2, %v8
33 %v13 = add i32 %v8, %v0
34 %v14 = add i32 %v8, %v1
35 %v15 = getelementptr inbounds i8, ptr %a4, i32 %v10
36 %v16 = getelementptr inbounds i8, ptr %a4, i32 %v11
37 %v17 = getelementptr inbounds i16, ptr %a0, i32 %v12
38 %v18 = getelementptr inbounds i16, ptr %a0, i32 %v13
39 %v19 = getelementptr inbounds i16, ptr %a0, i32 %v14
40 %v20 = getelementptr inbounds i16, ptr %a0, i32 %v8
43 b4: ; preds = %b4, %b3
44 %v27 = phi i32 [ 0, %b3 ], [ %v54, %b4 ]
45 %v28 = phi ptr [ %v20, %b3 ], [ %v34, %b4 ]
46 %v29 = phi ptr [ %v19, %b3 ], [ %v36, %b4 ]
47 %v30 = phi ptr [ %v18, %b3 ], [ %v38, %b4 ]
48 %v31 = phi ptr [ %v17, %b3 ], [ %v40, %b4 ]
49 %v32 = phi ptr [ %v15, %b3 ], [ %v53, %b4 ]
50 %v33 = phi ptr [ %v16, %b3 ], [ %v52, %b4 ]
51 %v34 = getelementptr inbounds <16 x i32>, ptr %v28, i32 1
52 %v35 = load <16 x i32>, ptr %v28, align 64
53 %v36 = getelementptr inbounds <16 x i32>, ptr %v29, i32 1
54 %v37 = load <16 x i32>, ptr %v29, align 64
55 %v38 = getelementptr inbounds <16 x i32>, ptr %v30, i32 1
56 %v39 = load <16 x i32>, ptr %v30, align 64
57 %v40 = getelementptr inbounds <16 x i32>, ptr %v31, i32 1
58 %v41 = load <16 x i32>, ptr %v31, align 64
59 %v42 = tail call <16 x i32> @llvm.hexagon.V6.vaddh(<16 x i32> %v35, <16 x i32> %v37)
60 %v43 = tail call <16 x i32> @llvm.hexagon.V6.vsubh(<16 x i32> %v35, <16 x i32> %v37)
61 %v44 = tail call <16 x i32> @llvm.hexagon.V6.vaddh(<16 x i32> %v39, <16 x i32> %v41)
62 %v45 = tail call <16 x i32> @llvm.hexagon.V6.vsubh(<16 x i32> %v39, <16 x i32> %v41)
63 %v46 = tail call <16 x i32> @llvm.hexagon.V6.vavgh(<16 x i32> %v42, <16 x i32> %v44)
64 %v47 = tail call <16 x i32> @llvm.hexagon.V6.vnavgh(<16 x i32> %v42, <16 x i32> %v44)
65 %v48 = tail call <16 x i32> @llvm.hexagon.V6.vavgh(<16 x i32> %v43, <16 x i32> %v45)
66 %v49 = tail call <16 x i32> @llvm.hexagon.V6.vnavgh(<16 x i32> %v43, <16 x i32> %v45)
67 %v50 = tail call <16 x i32> @llvm.hexagon.V6.vsathub(<16 x i32> %v47, <16 x i32> %v46)
68 %v51 = tail call <16 x i32> @llvm.hexagon.V6.vsathub(<16 x i32> %v49, <16 x i32> %v48)
69 %v52 = getelementptr inbounds <16 x i32>, ptr %v33, i32 1
70 store <16 x i32> %v50, ptr %v33, align 64
71 %v53 = getelementptr inbounds <16 x i32>, ptr %v32, i32 1
72 store <16 x i32> %v51, ptr %v32, align 64
73 %v54 = add nsw i32 %v27, 1
74 %v55 = icmp slt i32 %v54, %v4
75 br i1 %v55, label %b4, label %b5
80 b6: ; preds = %b5, %b2
81 %v56 = add nsw i32 %v6, 2
82 %v57 = icmp slt i32 %v56, %a2
83 br i1 %v57, label %b2, label %b7
88 b8: ; preds = %b7, %b0
92 ; Function Attrs: nounwind readnone
93 declare <16 x i32> @llvm.hexagon.V6.vaddh(<16 x i32>, <16 x i32>) #1
95 ; Function Attrs: nounwind readnone
96 declare <16 x i32> @llvm.hexagon.V6.vsubh(<16 x i32>, <16 x i32>) #1
98 ; Function Attrs: nounwind readnone
99 declare <16 x i32> @llvm.hexagon.V6.vavgh(<16 x i32>, <16 x i32>) #1
101 ; Function Attrs: nounwind readnone
102 declare <16 x i32> @llvm.hexagon.V6.vnavgh(<16 x i32>, <16 x i32>) #1
104 ; Function Attrs: nounwind readnone
105 declare <16 x i32> @llvm.hexagon.V6.vsathub(<16 x i32>, <16 x i32>) #1
107 attributes #0 = { nounwind "target-cpu"="hexagonv60" "target-features"="+hvxv60,+hvx-length64b" }
108 attributes #1 = { nounwind readnone }