1 ; RUN: llc -mtriple=hexagon -O2 -mcpu=hexagonv60 -hexagon-initial-cfg-cleanup=0 --stats -o - 2>&1 < %s | FileCheck %s
2 ; This was aborting while processing SUnits.
7 ; CHECK-NOT: Number of node order issues found
8 ; CHECK: Number of loops software pipelined
9 ; CHECK-NOT: Number of node order issues found
11 target datalayout = "e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048"
12 target triple = "hexagon-unknown--elf"
14 declare <16 x i32> @llvm.hexagon.V6.lo(<32 x i32>) #0
15 declare <16 x i32> @llvm.hexagon.V6.hi(<32 x i32>) #0
16 declare <32 x i32> @llvm.hexagon.V6.vshuffvdd(<16 x i32>, <16 x i32>, i32) #0
17 declare <32 x i32> @llvm.hexagon.V6.vdealvdd(<16 x i32>, <16 x i32>, i32) #0
18 declare <32 x i32> @llvm.hexagon.V6.vcombine(<16 x i32>, <16 x i32>) #0
19 declare <16 x i32> @llvm.hexagon.V6.vshufeh(<16 x i32>, <16 x i32>) #0
20 declare <16 x i32> @llvm.hexagon.V6.vshufoh(<16 x i32>, <16 x i32>) #0
21 declare <32 x i32> @llvm.hexagon.V6.vmpyuhv(<16 x i32>, <16 x i32>) #0
22 declare <16 x i32> @llvm.hexagon.V6.vaslw.acc(<16 x i32>, <16 x i32>, i32) #0
24 define void @f0() #1 {
26 %v0 = load ptr, ptr undef, align 4
27 %v1 = load ptr, ptr undef, align 4
30 b1: ; preds = %b3, %b0
31 %v2 = phi i32 [ 0, %b0 ], [ %v129, %b3 ]
32 %v3 = mul nuw nsw i32 %v2, 768
33 %v4 = add nuw nsw i32 %v3, 32
34 %v5 = add nuw nsw i32 %v3, 64
35 %v6 = add nuw nsw i32 %v3, 96
38 b2: ; preds = %b2, %b1
39 %v7 = phi ptr [ %v1, %b1 ], [ %v127, %b2 ]
40 %v8 = phi ptr [ %v0, %b1 ], [ %v128, %b2 ]
41 %v9 = phi i32 [ 0, %b1 ], [ %v125, %b2 ]
42 %v10 = mul nuw nsw i32 %v9, 32
43 %v12 = load <16 x i32>, ptr %v7, align 64, !tbaa !1
44 %v13 = add nuw nsw i32 %v10, 16
45 %v14 = getelementptr inbounds i32, ptr %v1, i32 %v13
46 %v16 = load <16 x i32>, ptr %v14, align 64, !tbaa !1
47 %v17 = tail call <32 x i32> @llvm.hexagon.V6.vcombine(<16 x i32> %v16, <16 x i32> %v12)
48 %v18 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v17) #2
49 %v19 = tail call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v17) #2
50 %v20 = tail call <32 x i32> @llvm.hexagon.V6.vdealvdd(<16 x i32> %v19, <16 x i32> %v18, i32 -4) #2
51 %v22 = load <16 x i32>, ptr %v8, align 64, !tbaa !4
52 %v23 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v20) #2
53 %v24 = tail call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v20) #2
54 %v25 = tail call <16 x i32> @llvm.hexagon.V6.vshufeh(<16 x i32> %v24, <16 x i32> %v23) #2
55 %v26 = tail call <16 x i32> @llvm.hexagon.V6.vshufoh(<16 x i32> %v24, <16 x i32> %v23) #2
56 %v27 = tail call <32 x i32> @llvm.hexagon.V6.vmpyuhv(<16 x i32> %v25, <16 x i32> %v22) #2
57 %v28 = tail call <32 x i32> @llvm.hexagon.V6.vmpyuhv(<16 x i32> %v26, <16 x i32> %v22) #2
58 %v29 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v27) #2
59 %v30 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v28) #2
60 %v31 = tail call <16 x i32> @llvm.hexagon.V6.vaslw.acc(<16 x i32> %v29, <16 x i32> %v30, i32 16) #2
61 %v32 = tail call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v28) #2
62 %v33 = tail call <16 x i32> @llvm.hexagon.V6.vaslw.acc(<16 x i32> undef, <16 x i32> %v32, i32 16) #2
63 %v34 = tail call <32 x i32> @llvm.hexagon.V6.vcombine(<16 x i32> %v33, <16 x i32> %v31) #2
64 %v35 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v34) #2
65 %v36 = tail call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v34) #2
66 %v37 = tail call <32 x i32> @llvm.hexagon.V6.vshuffvdd(<16 x i32> %v36, <16 x i32> %v35, i32 -4) #2
67 %v38 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v37)
68 %v39 = add nuw nsw i32 %v10, %v3
69 %v40 = getelementptr inbounds i32, ptr undef, i32 %v39
70 store <16 x i32> %v38, ptr %v40, align 64, !tbaa !6
71 %v42 = tail call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v37)
72 store <16 x i32> %v42, ptr undef, align 64, !tbaa !6
73 %v43 = getelementptr i32, ptr %v7, i32 32
74 %v44 = getelementptr i16, ptr %v8, i32 32
75 %v46 = load <16 x i32>, ptr %v43, align 64, !tbaa !1
76 %v47 = add nuw nsw i32 %v10, 48
77 %v48 = getelementptr inbounds i32, ptr %v1, i32 %v47
78 %v50 = load <16 x i32>, ptr %v48, align 64, !tbaa !1
79 %v51 = tail call <32 x i32> @llvm.hexagon.V6.vcombine(<16 x i32> %v50, <16 x i32> %v46)
80 %v52 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v51) #2
81 %v53 = tail call <32 x i32> @llvm.hexagon.V6.vdealvdd(<16 x i32> undef, <16 x i32> %v52, i32 -4) #2
82 %v55 = load <16 x i32>, ptr %v44, align 64, !tbaa !4
83 %v56 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v53) #2
84 %v57 = tail call <16 x i32> @llvm.hexagon.V6.vshufeh(<16 x i32> undef, <16 x i32> %v56) #2
85 %v58 = tail call <16 x i32> @llvm.hexagon.V6.vshufoh(<16 x i32> undef, <16 x i32> %v56) #2
86 %v59 = tail call <32 x i32> @llvm.hexagon.V6.vmpyuhv(<16 x i32> %v57, <16 x i32> %v55) #2
87 %v60 = tail call <32 x i32> @llvm.hexagon.V6.vmpyuhv(<16 x i32> %v58, <16 x i32> %v55) #2
88 %v61 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v59) #2
89 %v62 = tail call <16 x i32> @llvm.hexagon.V6.vaslw.acc(<16 x i32> %v61, <16 x i32> undef, i32 16) #2
90 %v63 = tail call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v59) #2
91 %v64 = tail call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v60) #2
92 %v65 = tail call <16 x i32> @llvm.hexagon.V6.vaslw.acc(<16 x i32> %v63, <16 x i32> %v64, i32 16) #2
93 %v66 = tail call <32 x i32> @llvm.hexagon.V6.vcombine(<16 x i32> %v65, <16 x i32> %v62) #2
94 %v67 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v66) #2
95 %v68 = tail call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v66) #2
96 %v69 = tail call <32 x i32> @llvm.hexagon.V6.vshuffvdd(<16 x i32> %v68, <16 x i32> %v67, i32 -4) #2
97 %v70 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v69)
98 %v71 = add nuw nsw i32 %v4, %v10
99 %v72 = getelementptr inbounds i32, ptr undef, i32 %v71
100 store <16 x i32> %v70, ptr %v72, align 64, !tbaa !6
101 %v74 = tail call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v69)
102 %v75 = add nuw nsw i32 %v71, 16
103 %v76 = getelementptr inbounds i32, ptr undef, i32 %v75
104 store <16 x i32> %v74, ptr %v76, align 64, !tbaa !6
105 %v78 = getelementptr i32, ptr %v7, i32 64
106 %v79 = getelementptr i16, ptr %v8, i32 64
107 %v81 = load <16 x i32>, ptr %v78, align 64, !tbaa !1
108 %v82 = add nuw nsw i32 %v10, 80
109 %v83 = getelementptr inbounds i32, ptr %v1, i32 %v82
110 %v85 = load <16 x i32>, ptr %v83, align 64, !tbaa !1
111 %v86 = tail call <32 x i32> @llvm.hexagon.V6.vcombine(<16 x i32> %v85, <16 x i32> %v81)
112 %v87 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v86) #2
113 %v88 = tail call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v86) #2
114 %v89 = tail call <32 x i32> @llvm.hexagon.V6.vdealvdd(<16 x i32> %v88, <16 x i32> %v87, i32 -4) #2
115 %v91 = load <16 x i32>, ptr %v79, align 64, !tbaa !4
116 %v92 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v89) #2
117 %v93 = tail call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v89) #2
118 %v94 = tail call <16 x i32> @llvm.hexagon.V6.vshufeh(<16 x i32> %v93, <16 x i32> %v92) #2
119 %v95 = tail call <16 x i32> @llvm.hexagon.V6.vshufoh(<16 x i32> %v93, <16 x i32> %v92) #2
120 %v96 = tail call <32 x i32> @llvm.hexagon.V6.vmpyuhv(<16 x i32> %v94, <16 x i32> %v91) #2
121 %v97 = tail call <32 x i32> @llvm.hexagon.V6.vmpyuhv(<16 x i32> %v95, <16 x i32> %v91) #2
122 %v98 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v97) #2
123 %v99 = tail call <16 x i32> @llvm.hexagon.V6.vaslw.acc(<16 x i32> undef, <16 x i32> %v98, i32 16) #2
124 %v100 = tail call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v96) #2
125 %v101 = tail call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v97) #2
126 %v102 = tail call <16 x i32> @llvm.hexagon.V6.vaslw.acc(<16 x i32> %v100, <16 x i32> %v101, i32 16) #2
127 %v103 = tail call <32 x i32> @llvm.hexagon.V6.vcombine(<16 x i32> %v102, <16 x i32> %v99) #2
128 %v104 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v103) #2
129 %v105 = tail call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v103) #2
130 %v106 = tail call <32 x i32> @llvm.hexagon.V6.vshuffvdd(<16 x i32> %v105, <16 x i32> %v104, i32 -4) #2
131 %v107 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v106)
132 %v108 = add nuw nsw i32 %v5, %v10
133 %v109 = getelementptr inbounds i32, ptr undef, i32 %v108
134 store <16 x i32> %v107, ptr %v109, align 64, !tbaa !6
135 %v111 = tail call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v106)
136 %v112 = add nuw nsw i32 %v108, 16
137 %v113 = getelementptr inbounds i32, ptr undef, i32 %v112
138 store <16 x i32> %v111, ptr %v113, align 64, !tbaa !6
139 %v115 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> undef) #2
140 %v116 = tail call <32 x i32> @llvm.hexagon.V6.vshuffvdd(<16 x i32> undef, <16 x i32> %v115, i32 -4) #2
141 %v117 = tail call <16 x i32> @llvm.hexagon.V6.lo(<32 x i32> %v116)
142 %v118 = add nuw nsw i32 %v6, %v10
143 %v119 = getelementptr inbounds i32, ptr undef, i32 %v118
144 store <16 x i32> %v117, ptr %v119, align 64, !tbaa !6
145 %v121 = tail call <16 x i32> @llvm.hexagon.V6.hi(<32 x i32> %v116)
146 %v122 = add nuw nsw i32 %v118, 16
147 %v123 = getelementptr inbounds i32, ptr undef, i32 %v122
148 store <16 x i32> %v121, ptr %v123, align 64, !tbaa !6
149 %v125 = add nuw nsw i32 %v9, 4
150 %v126 = icmp eq i32 %v125, 24
151 %v127 = getelementptr i32, ptr %v7, i32 128
152 %v128 = getelementptr i16, ptr %v8, i32 128
153 br i1 %v126, label %b3, label %b2
156 %v129 = add nuw nsw i32 %v2, 1
160 attributes #0 = { nounwind readnone }
161 attributes #1 = { "target-cpu"="hexagonv60" "target-features"="+hvxv60,+hvx-length64b" }
162 attributes #2 = { nounwind }
164 !llvm.module.flags = !{!0}
166 !0 = !{i32 2, !"halide_mattrs", !"+hvx"}
167 !1 = !{!2, !2, i64 0}
168 !2 = !{!"in_u32", !3}
169 !3 = !{!"Halide buffer"}
170 !4 = !{!5, !5, i64 0}
171 !5 = !{!"in_u16", !3}
172 !6 = !{!7, !7, i64 0}
173 !7 = !{!"op_vmpy_v__uh_v__uh__1", !3}