1 ; RUN: llc -march=hexagon < %s -pipeliner-experimental-cg=true | FileCheck %s
3 ; This version of the conv3x3 test has both loops. This test checks that the
4 ; inner loop has 13 packets.
6 ; CHECK: loop0(.LBB0_[[LOOP:.]],
7 ; CHECK: .LBB0_[[LOOP]]:
21 ; CHECK: }{{[ \t]*}}:endloop0
23 declare <16 x i32> @llvm.hexagon.V6.vd0() #0
24 declare <16 x i32> @llvm.hexagon.V6.valignbi(<16 x i32>, <16 x i32>, i32) #0
25 declare <32 x i32> @llvm.hexagon.V6.vcombine(<16 x i32>, <16 x i32>) #0
26 declare <32 x i32> @llvm.hexagon.V6.vrmpybusi(<32 x i32>, i32, i32) #0
27 declare <32 x i32> @llvm.hexagon.V6.vrmpybusi.acc(<32 x i32>, <32 x i32>, i32, i32) #0
28 declare <16 x i32> @llvm.hexagon.V6.vasrwhsat(<16 x i32>, <16 x i32>, i32) #0
29 declare <16 x i32> @llvm.hexagon.V6.hi(<32 x i32>) #0
30 declare <16 x i32> @llvm.hexagon.V6.lo(<32 x i32>) #0
31 declare <16 x i32> @llvm.hexagon.V6.vsathub(<16 x i32>, <16 x i32>) #0
32 declare <16 x i32> @llvm.hexagon.V6.vlalignbi(<16 x i32>, <16 x i32>, i32) #0
34 define void @f0(i8* noalias nocapture readonly %a0, i32 %a1, i32 %a2, i32 %a3, i8* noalias nocapture readonly %a4, i32 %a5, i8* noalias nocapture %a6) local_unnamed_addr #1 {
36 %v0 = add nsw i32 %a3, -1
37 %v1 = icmp sgt i32 %a3, 2
38 br i1 %v1, label %b1, label %b6
41 %v2 = getelementptr inbounds i8, i8* %a6, i32 %a1
42 %v3 = getelementptr inbounds i8, i8* %a0, i32 %a1
43 %v4 = bitcast i8* %a4 to i32*
44 %v5 = load i32, i32* %v4, align 4, !tbaa !1, !alias.scope !5, !noalias !8
45 %v6 = getelementptr inbounds i8, i8* %a4, i32 4
46 %v7 = bitcast i8* %v6 to i32*
47 %v8 = load i32, i32* %v7, align 4, !tbaa !1, !alias.scope !5, !noalias !8
48 %v9 = getelementptr inbounds i8, i8* %a4, i32 8
49 %v10 = bitcast i8* %v9 to i32*
50 %v11 = load i32, i32* %v10, align 4, !tbaa !1, !alias.scope !5, !noalias !8
52 %v13 = shl nsw i32 %a1, 1
53 %v14 = tail call <16 x i32> @llvm.hexagon.V6.vd0() #2
54 %v15 = icmp sgt i32 %a2, 0
57 b2: ; preds = %b5, %b1
58 %v16 = phi i8* [ %v2, %b1 ], [ %v102, %b5 ]
59 %v17 = phi i8* [ %v3, %b1 ], [ %v21, %b5 ]
60 %v18 = phi i32 [ 1, %b1 ], [ %v103, %b5 ]
61 %v19 = getelementptr inbounds i8, i8* %v17, i32 %v12
62 %v20 = getelementptr inbounds i8, i8* %v17, i32 %a1
63 %v21 = getelementptr inbounds i8, i8* %v17, i32 %v13
64 br i1 %v15, label %b3, label %b5
67 %v22 = bitcast i8* %v21 to <16 x i32>*
68 %v23 = load <16 x i32>, <16 x i32>* %v22, align 64, !tbaa !11, !alias.scope !12, !noalias !13
69 %v24 = getelementptr inbounds i8, i8* %v21, i32 64
70 %v25 = bitcast i8* %v24 to <16 x i32>*
71 %v26 = bitcast i8* %v20 to <16 x i32>*
72 %v27 = load <16 x i32>, <16 x i32>* %v26, align 64, !tbaa !11, !alias.scope !12, !noalias !13
73 %v28 = getelementptr inbounds i8, i8* %v20, i32 64
74 %v29 = bitcast i8* %v28 to <16 x i32>*
75 %v30 = bitcast i8* %v17 to <16 x i32>*
76 %v31 = load <16 x i32>, <16 x i32>* %v30, align 64, !tbaa !11, !alias.scope !12, !noalias !13
77 %v32 = getelementptr inbounds i8, i8* %v17, i32 64
78 %v33 = bitcast i8* %v32 to <16 x i32>*
79 %v34 = bitcast i8* %v19 to <16 x i32>*
80 %v35 = load <16 x i32>, <16 x i32>* %v34, align 64, !tbaa !11, !alias.scope !12, !noalias !13
81 %v36 = getelementptr inbounds i8, i8* %v19, i32 64
82 %v37 = bitcast i8* %v36 to <16 x i32>*
83 %v38 = getelementptr inbounds i8, i8* %v16, i32 %a1
84 %v39 = bitcast i8* %v38 to <16 x i32>*
85 %v40 = bitcast i8* %v16 to <16 x i32>*
88 b4: ; preds = %b4, %b3
89 %v41 = phi <16 x i32>* [ %v39, %b3 ], [ %v99, %b4 ]
90 %v42 = phi <16 x i32>* [ %v40, %b3 ], [ %v84, %b4 ]
91 %v43 = phi <16 x i32>* [ %v25, %b3 ], [ %v60, %b4 ]
92 %v44 = phi <16 x i32>* [ %v29, %b3 ], [ %v58, %b4 ]
93 %v45 = phi <16 x i32>* [ %v33, %b3 ], [ %v56, %b4 ]
94 %v46 = phi <16 x i32>* [ %v37, %b3 ], [ %v54, %b4 ]
95 %v47 = phi i32 [ %a2, %b3 ], [ %v100, %b4 ]
96 %v48 = phi <16 x i32> [ %v35, %b3 ], [ %v55, %b4 ]
97 %v49 = phi <16 x i32> [ %v31, %b3 ], [ %v57, %b4 ]
98 %v50 = phi <16 x i32> [ %v27, %b3 ], [ %v59, %b4 ]
99 %v51 = phi <16 x i32> [ %v23, %b3 ], [ %v61, %b4 ]
100 %v52 = phi <16 x i32> [ %v14, %b3 ], [ %v82, %b4 ]
101 %v53 = phi <16 x i32> [ %v14, %b3 ], [ %v97, %b4 ]
102 %v54 = getelementptr inbounds <16 x i32>, <16 x i32>* %v46, i32 1
103 %v55 = load <16 x i32>, <16 x i32>* %v46, align 64, !tbaa !11, !alias.scope !12, !noalias !13
104 %v56 = getelementptr inbounds <16 x i32>, <16 x i32>* %v45, i32 1
105 %v57 = load <16 x i32>, <16 x i32>* %v45, align 64, !tbaa !11, !alias.scope !12, !noalias !13
106 %v58 = getelementptr inbounds <16 x i32>, <16 x i32>* %v44, i32 1
107 %v59 = load <16 x i32>, <16 x i32>* %v44, align 64, !tbaa !11, !alias.scope !12, !noalias !13
108 %v60 = getelementptr inbounds <16 x i32>, <16 x i32>* %v43, i32 1
109 %v61 = load <16 x i32>, <16 x i32>* %v43, align 64, !tbaa !11, !alias.scope !12, !noalias !13
110 %v62 = tail call <16 x i32> @llvm.hexagon.V6.valignbi(<16 x i32> %v55, <16 x i32> %v48, i32 4) #2
111 %v63 = tail call <16 x i32> @llvm.hexagon.V6.valignbi(<16 x i32> %v57, <16 x i32> %v49, i32 4) #2
112 %v64 = tail call <16 x i32> @llvm.hexagon.V6.valignbi(<16 x i32> %v59, <16 x i32> %v50, i32 4) #2
113 %v65 = tail call <16 x i32> @llvm.hexagon.V6.valignbi(<16 x i32> %v61, <16 x i32> %v51, i32 4) #2
114 %v66 = tail call <32 x i32> @llvm.hexagon.V6.vcombine(<16 x i32> %v62, <16 x i32> %v48) #2
115 %v67 = tail call <32 x i32> @llvm.hexagon.V6.vcombine(<16 x i32> %v63, <16 x i32> %v49) #2
116 %v68 = tail call <32 x i32> @llvm.hexagon.V6.vcombine(<16 x i32> %v64, <16 x i32> %v50) #2
117 %v69 = tail call <32 x i32> @llvm.hexagon.V6.vcombine(<16 x i32> %v65, <16 x i32> %v51) #2
118 %v70 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi(<32 x i32> %v66, i32 %v5, i32 0) #2
119 %v71 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi(<32 x i32> %v66, i32 %v5, i32 1) #2
120 %v72 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi.acc(<32 x i32> %v70, <32 x i32> %v67, i32 %v8, i32 0) #2
121 %v73 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi.acc(<32 x i32> %v71, <32 x i32> %v67, i32 %v8, i32 1) #2
122 %v74 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi.acc(<32 x i32> %v72, <32 x i32> %v68, i32 %v11, i32 0) #2
123 %v75 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi.acc(<32 x i32> %v73, <32 x i32> %v68, i32 %v11, i32 1) #2
124 %v76 = tail call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v75) #2
125 %v77 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v75) #2
126 %v78 = tail call <16 x i32> @llvm.hexagon.V6.vasrwhsat(<16 x i32> %v76, <16 x i32> %v77, i32 %a5) #2
127 %v79 = tail call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v74) #2
128 %v80 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v74) #2
129 %v81 = tail call <16 x i32> @llvm.hexagon.V6.vasrwhsat(<16 x i32> %v79, <16 x i32> %v80, i32 %a5) #2
130 %v82 = tail call <16 x i32> @llvm.hexagon.V6.vsathub(<16 x i32> %v78, <16 x i32> %v81) #2
131 %v83 = tail call <16 x i32> @llvm.hexagon.V6.vlalignbi(<16 x i32> %v82, <16 x i32> %v52, i32 1) #2
132 %v84 = getelementptr inbounds <16 x i32>, <16 x i32>* %v42, i32 1
133 store <16 x i32> %v83, <16 x i32>* %v42, align 64, !tbaa !11, !alias.scope !14, !noalias !15
134 %v85 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi(<32 x i32> %v67, i32 %v5, i32 0) #2
135 %v86 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi(<32 x i32> %v67, i32 %v5, i32 1) #2
136 %v87 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi.acc(<32 x i32> %v85, <32 x i32> %v68, i32 %v8, i32 0) #2
137 %v88 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi.acc(<32 x i32> %v86, <32 x i32> %v68, i32 %v8, i32 1) #2
138 %v89 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi.acc(<32 x i32> %v87, <32 x i32> %v69, i32 %v11, i32 0) #2
139 %v90 = tail call <32 x i32> @llvm.hexagon.V6.vrmpybusi.acc(<32 x i32> %v88, <32 x i32> %v69, i32 %v11, i32 1) #2
140 %v91 = tail call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v90) #2
141 %v92 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v90) #2
142 %v93 = tail call <16 x i32> @llvm.hexagon.V6.vasrwhsat(<16 x i32> %v91, <16 x i32> %v92, i32 %a5) #2
143 %v94 = tail call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v89) #2
144 %v95 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v89) #2
145 %v96 = tail call <16 x i32> @llvm.hexagon.V6.vasrwhsat(<16 x i32> %v94, <16 x i32> %v95, i32 %a5) #2
146 %v97 = tail call <16 x i32> @llvm.hexagon.V6.vsathub(<16 x i32> %v93, <16 x i32> %v96) #2
147 %v98 = tail call <16 x i32> @llvm.hexagon.V6.vlalignbi(<16 x i32> %v97, <16 x i32> %v53, i32 1) #2
148 %v99 = getelementptr inbounds <16 x i32>, <16 x i32>* %v41, i32 1
149 store <16 x i32> %v98, <16 x i32>* %v41, align 64, !tbaa !11, !alias.scope !14, !noalias !15
150 %v100 = add nsw i32 %v47, -64
151 %v101 = icmp sgt i32 %v47, 64
152 br i1 %v101, label %b4, label %b5
154 b5: ; preds = %b4, %b2
155 %v102 = getelementptr inbounds i8, i8* %v16, i32 %v13
156 %v103 = add nuw nsw i32 %v18, 2
157 %v104 = icmp slt i32 %v103, %v0
158 br i1 %v104, label %b2, label %b6
160 b6: ; preds = %b5, %b0
164 attributes #0 = { nounwind readnone }
165 attributes #1 = { nounwind "target-cpu"="hexagonv62" "target-features"="+hvx-length64b,+hvxv62" }
166 attributes #2 = { nounwind }
168 !llvm.module.flags = !{!0}
170 !0 = !{i32 1, !"wchar_size", i32 4}
171 !1 = !{!2, !2, i64 0}
172 !2 = !{!"int", !3, i64 0}
173 !3 = !{!"omnipotent char", !4, i64 0}
174 !4 = !{!"Simple C/C++ TBAA"}
176 !6 = distinct !{!6, !7, !"x: %a"}
177 !7 = distinct !{!7, !"x"}
179 !9 = distinct !{!9, !7, !"x: %b"}
180 !10 = distinct !{!10, !7, !"x: %c"}
181 !11 = !{!3, !3, i64 0}