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