1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64 -O0 -run-pass=legalizer -global-isel-abort=1 %s -o - | FileCheck %s
6 tracksRegLiveness: true
11 ; CHECK-LABEL: name: shuffle_v4i32
12 ; CHECK: liveins: $q0, $q1
14 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
15 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $q1
16 ; CHECK-NEXT: [[SHUF:%[0-9]+]]:_(<4 x s32>) = G_SHUFFLE_VECTOR [[COPY]](<4 x s32>), [[COPY1]], shufflemask(0, 0, 0, 0)
17 ; CHECK-NEXT: $q0 = COPY [[SHUF]](<4 x s32>)
18 ; CHECK-NEXT: RET_ReallyLR implicit $q0
19 %0:_(<4 x s32>) = COPY $q0
20 %1:_(<4 x s32>) = COPY $q1
21 %2:_(<4 x s32>) = G_SHUFFLE_VECTOR %0(<4 x s32>), %1, shufflemask(0, 0, 0, 0)
22 $q0 = COPY %2(<4 x s32>)
23 RET_ReallyLR implicit $q0
29 tracksRegLiveness: true
34 ; CHECK-LABEL: name: shuffle_v2i64
35 ; CHECK: liveins: $q0, $q1
37 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
38 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $q1
39 ; CHECK-NEXT: [[SHUF:%[0-9]+]]:_(<2 x s64>) = G_SHUFFLE_VECTOR [[COPY]](<2 x s64>), [[COPY1]], shufflemask(0, 0)
40 ; CHECK-NEXT: $q0 = COPY [[SHUF]](<2 x s64>)
41 ; CHECK-NEXT: RET_ReallyLR implicit $q0
42 %0:_(<2 x s64>) = COPY $q0
43 %1:_(<2 x s64>) = COPY $q1
44 %2:_(<2 x s64>) = G_SHUFFLE_VECTOR %0(<2 x s64>), %1, shufflemask(0, 0)
45 $q0 = COPY %2(<2 x s64>)
46 RET_ReallyLR implicit $q0
52 tracksRegLiveness: true
57 ; CHECK-LABEL: name: shuffle_v2p0
58 ; CHECK: liveins: $q0, $q1
60 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x p0>) = COPY $q0
61 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<2 x p0>) = COPY $q1
62 ; CHECK-NEXT: [[PTRTOINT:%[0-9]+]]:_(<2 x s64>) = G_PTRTOINT [[COPY]](<2 x p0>)
63 ; CHECK-NEXT: [[PTRTOINT1:%[0-9]+]]:_(<2 x s64>) = G_PTRTOINT [[COPY1]](<2 x p0>)
64 ; CHECK-NEXT: [[SHUF:%[0-9]+]]:_(<2 x s64>) = G_SHUFFLE_VECTOR [[PTRTOINT]](<2 x s64>), [[PTRTOINT1]], shufflemask(0, 0)
65 ; CHECK-NEXT: [[INTTOPTR:%[0-9]+]]:_(<2 x p0>) = G_INTTOPTR [[SHUF]](<2 x s64>)
66 ; CHECK-NEXT: $q0 = COPY [[INTTOPTR]](<2 x p0>)
67 ; CHECK-NEXT: RET_ReallyLR implicit $q0
68 %0:_(<2 x p0>) = COPY $q0
69 %1:_(<2 x p0>) = COPY $q1
70 %2:_(<2 x p0>) = G_SHUFFLE_VECTOR %0(<2 x p0>), %1, shufflemask(0, 0)
71 $q0 = COPY %2(<2 x p0>)
72 RET_ReallyLR implicit $q0
78 tracksRegLiveness: true
83 ; CHECK-LABEL: name: shuffle_v16i8
84 ; CHECK: liveins: $q0, $q1
86 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<16 x s8>) = COPY $q0
87 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<16 x s8>) = COPY $q1
88 ; CHECK-NEXT: [[SHUF:%[0-9]+]]:_(<16 x s8>) = G_SHUFFLE_VECTOR [[COPY]](<16 x s8>), [[COPY1]], shufflemask(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
89 ; CHECK-NEXT: $q0 = COPY [[SHUF]](<16 x s8>)
90 ; CHECK-NEXT: RET_ReallyLR implicit $q0
91 %0:_(<16 x s8>) = COPY $q0
92 %1:_(<16 x s8>) = COPY $q1
93 %2:_(<16 x s8>) = G_SHUFFLE_VECTOR %0(<16 x s8>), %1, shufflemask(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
94 $q0 = COPY %2(<16 x s8>)
95 RET_ReallyLR implicit $q0
101 tracksRegLiveness: true
106 ; CHECK-LABEL: name: shuffle_v8i16
107 ; CHECK: liveins: $q0, $q1
109 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
110 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<8 x s16>) = COPY $q1
111 ; CHECK-NEXT: [[SHUF:%[0-9]+]]:_(<8 x s16>) = G_SHUFFLE_VECTOR [[COPY]](<8 x s16>), [[COPY1]], shufflemask(0, 0, 0, 0, 0, 0, 0, 0)
112 ; CHECK-NEXT: $q0 = COPY [[SHUF]](<8 x s16>)
113 ; CHECK-NEXT: RET_ReallyLR implicit $q0
114 %0:_(<8 x s16>) = COPY $q0
115 %1:_(<8 x s16>) = COPY $q1
116 %2:_(<8 x s16>) = G_SHUFFLE_VECTOR %0(<8 x s16>), %1, shufflemask(0, 0, 0, 0, 0, 0, 0, 0)
117 $q0 = COPY %2(<8 x s16>)
118 RET_ReallyLR implicit $q0
122 name: shuffle_1elt_mask
124 tracksRegLiveness: true
129 ; CHECK-LABEL: name: shuffle_1elt_mask
130 ; CHECK: liveins: $d0, $d1
132 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $d0
133 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $d1
134 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY [[COPY]](s64)
135 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s64) = COPY [[COPY1]](s64)
136 ; CHECK-NEXT: $d0 = COPY [[COPY2]](s64)
137 ; CHECK-NEXT: $d1 = COPY [[COPY3]](s64)
138 ; CHECK-NEXT: RET_ReallyLR implicit $d0, implicit $d1
141 %3:_(s64) = G_SHUFFLE_VECTOR %0:_(s64), %1:_, shufflemask(0)
142 %4:_(s64) = G_SHUFFLE_VECTOR %0:_(s64), %1:_, shufflemask(1)
145 RET_ReallyLR implicit $d0, implicit $d1
149 name: oversize_shuffle_v4i64
151 tracksRegLiveness: true
154 liveins: $q0, $q1, $q2, $q3, $x0
156 ; CHECK-LABEL: name: oversize_shuffle_v4i64
157 ; CHECK: liveins: $q0, $q1, $q2, $q3, $x0
159 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
160 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $q1
161 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(<2 x s64>) = COPY $q2
162 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(<2 x s64>) = COPY $q3
163 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(p0) = COPY $x0
164 ; CHECK-NEXT: [[SHUF:%[0-9]+]]:_(<2 x s64>) = G_SHUFFLE_VECTOR [[COPY1]](<2 x s64>), [[COPY2]], shufflemask(1, 2)
165 ; CHECK-NEXT: [[SHUF1:%[0-9]+]]:_(<2 x s64>) = G_SHUFFLE_VECTOR [[COPY3]](<2 x s64>), [[COPY]], shufflemask(1, 2)
166 ; CHECK-NEXT: G_STORE [[SHUF]](<2 x s64>), [[COPY4]](p0) :: (store (<2 x s64>), align 32)
167 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
168 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY4]], [[C]](s64)
169 ; CHECK-NEXT: G_STORE [[SHUF1]](<2 x s64>), [[PTR_ADD]](p0) :: (store (<2 x s64>) into unknown-address + 16)
170 ; CHECK-NEXT: RET_ReallyLR
171 %3:_(<2 x s64>) = COPY $q0
172 %4:_(<2 x s64>) = COPY $q1
173 %0:_(<4 x s64>) = G_CONCAT_VECTORS %3(<2 x s64>), %4(<2 x s64>)
174 %5:_(<2 x s64>) = COPY $q2
175 %6:_(<2 x s64>) = COPY $q3
176 %1:_(<4 x s64>) = G_CONCAT_VECTORS %5(<2 x s64>), %6(<2 x s64>)
178 %7:_(<4 x s64>) = G_SHUFFLE_VECTOR %0(<4 x s64>), %1, shufflemask(3, 4, 7, 0)
179 G_STORE %7(<4 x s64>), %2(p0) :: (store (<4 x s64>))
184 name: oversize_shuffle_v8i32_build_vector
186 tracksRegLiveness: true
189 liveins: $q0, $q1, $q2, $q3, $x0
191 ; CHECK-LABEL: name: oversize_shuffle_v8i32_build_vector
192 ; CHECK: liveins: $q0, $q1, $q2, $q3, $x0
194 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
195 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $q1
196 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(<4 x s32>) = COPY $q2
197 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(<4 x s32>) = COPY $q3
198 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(p0) = COPY $x0
199 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
200 ; CHECK-NEXT: [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[COPY]](<4 x s32>), [[C]](s64)
201 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
202 ; CHECK-NEXT: [[EVEC1:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[COPY1]](<4 x s32>), [[C1]](s64)
203 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
204 ; CHECK-NEXT: [[EVEC2:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[COPY2]](<4 x s32>), [[C2]](s64)
205 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 3
206 ; CHECK-NEXT: [[EVEC3:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[COPY3]](<4 x s32>), [[C3]](s64)
207 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[EVEC]](s32), [[EVEC1]](s32), [[EVEC2]](s32), [[EVEC3]](s32)
208 ; CHECK-NEXT: [[SHUF:%[0-9]+]]:_(<4 x s32>) = G_SHUFFLE_VECTOR [[COPY1]](<4 x s32>), [[COPY]], shufflemask(2, 6, 5, 3)
209 ; CHECK-NEXT: G_STORE [[BUILD_VECTOR]](<4 x s32>), [[COPY4]](p0) :: (store (<4 x s32>), align 32)
210 ; CHECK-NEXT: [[C4:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
211 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY4]], [[C4]](s64)
212 ; CHECK-NEXT: G_STORE [[SHUF]](<4 x s32>), [[PTR_ADD]](p0) :: (store (<4 x s32>) into unknown-address + 16)
213 ; CHECK-NEXT: RET_ReallyLR
214 %3:_(<4 x s32>) = COPY $q0
215 %4:_(<4 x s32>) = COPY $q1
216 %0:_(<8 x s32>) = G_CONCAT_VECTORS %3(<4 x s32>), %4(<4 x s32>)
217 %5:_(<4 x s32>) = COPY $q2
218 %6:_(<4 x s32>) = COPY $q3
219 %1:_(<8 x s32>) = G_CONCAT_VECTORS %5(<4 x s32>), %6(<4 x s32>)
221 %7:_(<8 x s32>) = G_SHUFFLE_VECTOR %0(<8 x s32>), %1, shufflemask(0, 5, 10, 15, 6, 2, 1, 7)
222 G_STORE %7(<8 x s32>), %2(p0) :: (store (<8 x s32>))
227 name: oversize_shuffle_v6i64
229 tracksRegLiveness: true
233 - { id: 0, offset: 24, size: 8, alignment: 8, isImmutable: true }
234 - { id: 1, offset: 16, size: 8, alignment: 16, isImmutable: true }
235 - { id: 2, offset: 8, size: 8, alignment: 8, isImmutable: true }
236 - { id: 3, size: 8, alignment: 16, isImmutable: true }
239 liveins: $d0, $d1, $d2, $d3, $d4, $d5, $d6, $d7, $x0
241 ; CHECK-LABEL: name: oversize_shuffle_v6i64
242 ; CHECK: liveins: $d0, $d1, $d2, $d3, $d4, $d5, $d6, $d7, $x0
244 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $d0
245 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $d1
246 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $d2
247 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s64) = COPY $d3
248 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(s64) = COPY $d4
249 ; CHECK-NEXT: [[COPY5:%[0-9]+]]:_(s64) = COPY $d5
250 ; CHECK-NEXT: [[COPY6:%[0-9]+]]:_(s64) = COPY $d6
251 ; CHECK-NEXT: [[COPY7:%[0-9]+]]:_(s64) = COPY $d7
252 ; CHECK-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.2
253 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(s64) = G_LOAD [[FRAME_INDEX]](p0) :: (invariant load (s64) from %fixed-stack.2, align 16)
254 ; CHECK-NEXT: [[FRAME_INDEX1:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.3
255 ; CHECK-NEXT: [[LOAD1:%[0-9]+]]:_(s64) = G_LOAD [[FRAME_INDEX1]](p0) :: (invariant load (s64) from %fixed-stack.3)
256 ; CHECK-NEXT: [[COPY8:%[0-9]+]]:_(p0) = COPY $x0
257 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[COPY2]](s64), [[COPY3]](s64)
258 ; CHECK-NEXT: [[BUILD_VECTOR1:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[COPY4]](s64), [[COPY5]](s64)
259 ; CHECK-NEXT: [[BUILD_VECTOR2:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[COPY]](s64), [[COPY1]](s64)
260 ; CHECK-NEXT: [[BUILD_VECTOR3:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[COPY]](s64), [[COPY1]](s64)
261 ; CHECK-NEXT: [[BUILD_VECTOR4:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[COPY6]](s64), [[COPY7]](s64)
262 ; CHECK-NEXT: [[BUILD_VECTOR5:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[LOAD]](s64), [[LOAD1]](s64)
263 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
264 ; CHECK-NEXT: [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[BUILD_VECTOR]](<2 x s64>), [[C]](s64)
265 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
266 ; CHECK-NEXT: [[EVEC1:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[BUILD_VECTOR1]](<2 x s64>), [[C1]](s64)
267 ; CHECK-NEXT: [[EVEC2:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[BUILD_VECTOR4]](<2 x s64>), [[C]](s64)
268 ; CHECK-NEXT: [[EVEC3:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[BUILD_VECTOR2]](<2 x s64>), [[C1]](s64)
269 ; CHECK-NEXT: [[SHUF:%[0-9]+]]:_(<2 x s64>) = G_SHUFFLE_VECTOR [[BUILD_VECTOR3]](<2 x s64>), [[BUILD_VECTOR5]], shufflemask(1, 3)
270 ; CHECK-NEXT: [[BUILD_VECTOR6:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[EVEC]](s64), [[EVEC1]](s64)
271 ; CHECK-NEXT: [[BUILD_VECTOR7:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[EVEC2]](s64), [[EVEC3]](s64)
272 ; CHECK-NEXT: G_STORE [[BUILD_VECTOR6]](<2 x s64>), [[COPY8]](p0) :: (store (<2 x s64>), align 64)
273 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
274 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY8]], [[C2]](s64)
275 ; CHECK-NEXT: G_STORE [[BUILD_VECTOR7]](<2 x s64>), [[PTR_ADD]](p0) :: (store (<2 x s64>) into unknown-address + 16)
276 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 32
277 ; CHECK-NEXT: [[PTR_ADD1:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY8]], [[C3]](s64)
278 ; CHECK-NEXT: G_STORE [[SHUF]](<2 x s64>), [[PTR_ADD1]](p0) :: (store (<2 x s64>) into unknown-address + 32, align 32)
279 ; CHECK-NEXT: RET_ReallyLR
286 %0:_(<6 x s64>) = G_BUILD_VECTOR %3(s64), %4(s64), %5(s64), %6(s64), %7(s64), %8(s64)
288 %10:_(s64) = COPY $d7
289 %15:_(p0) = G_FRAME_INDEX %fixed-stack.3
290 %11:_(s64) = G_LOAD %15(p0) :: (invariant load (s64) from %fixed-stack.3, align 16)
291 %16:_(p0) = G_FRAME_INDEX %fixed-stack.2
292 %12:_(s64) = G_LOAD %16(p0) :: (invariant load (s64) from %fixed-stack.2)
293 %17:_(p0) = G_FRAME_INDEX %fixed-stack.1
294 %13:_(s64) = G_LOAD %17(p0) :: (invariant load 8 from %fixed-stack.1, align 16)
295 %18:_(p0) = G_FRAME_INDEX %fixed-stack.0
296 %14:_(s64) = G_LOAD %18(p0) :: (invariant load 8 from %fixed-stack.0)
297 %1:_(<6 x s64>) = G_BUILD_VECTOR %9(s64), %10(s64), %11(s64), %12(s64), %13(s64), %14(s64)
299 %19:_(<6 x s64>) = G_SHUFFLE_VECTOR %0(<6 x s64>), %1, shufflemask(3, 4, 7, 0, 1, 11)
300 G_STORE %19(<6 x s64>), %2(p0) :: (store (<6 x s64>), align 64)
305 name: shuffle_v4i32_v1i32
307 tracksRegLiveness: true
310 liveins: $w0, $w1, $w2
312 ; CHECK-LABEL: name: shuffle_v4i32_v1i32
313 ; CHECK: liveins: $w0, $w1, $w2
315 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
316 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
317 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $w2
318 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(<4 x s32>) = G_IMPLICIT_DEF
319 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[DEF]](<4 x s32>)
320 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[COPY]](s32), [[COPY1]](s32), [[COPY2]](s32), [[UV]](s32)
321 ; CHECK-NEXT: [[BUILD_VECTOR1:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[COPY]](s32), [[COPY1]](s32), [[COPY2]](s32), [[UV]](s32)
322 ; CHECK-NEXT: [[SHUF:%[0-9]+]]:_(<4 x s32>) = G_SHUFFLE_VECTOR [[BUILD_VECTOR]](<4 x s32>), [[BUILD_VECTOR1]], shufflemask(0, 1, 5, 6)
323 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
324 ; CHECK-NEXT: [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[SHUF]](<4 x s32>), [[C]](s64)
325 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
326 ; CHECK-NEXT: [[EVEC1:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[SHUF]](<4 x s32>), [[C1]](s64)
327 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
328 ; CHECK-NEXT: [[EVEC2:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[SHUF]](<4 x s32>), [[C2]](s64)
329 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 3
330 ; CHECK-NEXT: [[EVEC3:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[SHUF]](<4 x s32>), [[C3]](s64)
331 ; CHECK-NEXT: [[BUILD_VECTOR2:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[EVEC]](s32), [[EVEC1]](s32), [[EVEC2]](s32), [[EVEC3]](s32)
332 ; CHECK-NEXT: $q0 = COPY [[BUILD_VECTOR2]](<4 x s32>)
333 ; CHECK-NEXT: RET_ReallyLR implicit $q0
337 %3:_(<3 x s32>) = G_BUILD_VECTOR %0(s32), %1(s32), %2(s32)
338 %4:_(<4 x s32>) = G_SHUFFLE_VECTOR %3(<3 x s32>), %3, shufflemask(0, 1, 4, 5)
339 $q0 = COPY %4(<4 x s32>)
340 RET_ReallyLR implicit $q0
344 name: shuffle_v4i32_v2i32
346 tracksRegLiveness: true
351 ; CHECK-LABEL: name: shuffle_v4i32_v2i32
352 ; CHECK: liveins: $q0, $d1
354 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
355 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $d1
356 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(<2 x s32>) = G_IMPLICIT_DEF
357 ; CHECK-NEXT: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x s32>) = G_CONCAT_VECTORS [[COPY]](<2 x s32>), [[DEF]](<2 x s32>)
358 ; CHECK-NEXT: [[CONCAT_VECTORS1:%[0-9]+]]:_(<4 x s32>) = G_CONCAT_VECTORS [[COPY1]](<2 x s32>), [[DEF]](<2 x s32>)
359 ; CHECK-NEXT: [[SHUF:%[0-9]+]]:_(<4 x s32>) = G_SHUFFLE_VECTOR [[CONCAT_VECTORS]](<4 x s32>), [[CONCAT_VECTORS1]], shufflemask(0, 1, 4, 5)
360 ; CHECK-NEXT: $q0 = COPY [[SHUF]](<4 x s32>)
361 ; CHECK-NEXT: RET_ReallyLR implicit $q0
362 %0:_(<2 x s32>) = COPY $d0
363 %1:_(<2 x s32>) = COPY $d1
364 %2:_(<4 x s32>) = G_SHUFFLE_VECTOR %0(<2 x s32>), %1, shufflemask(0, 1, 2, 3)
365 $q0 = COPY %2(<4 x s32>)
366 RET_ReallyLR implicit $q0
370 name: shuffle_v8i16_v4i16
372 tracksRegLiveness: true
377 ; CHECK-LABEL: name: shuffle_v8i16_v4i16
378 ; CHECK: liveins: $d0, $d1
380 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
381 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<4 x s16>) = COPY $d1
382 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
383 ; CHECK-NEXT: [[CONCAT_VECTORS:%[0-9]+]]:_(<8 x s16>) = G_CONCAT_VECTORS [[COPY]](<4 x s16>), [[DEF]](<4 x s16>)
384 ; CHECK-NEXT: [[CONCAT_VECTORS1:%[0-9]+]]:_(<8 x s16>) = G_CONCAT_VECTORS [[COPY1]](<4 x s16>), [[DEF]](<4 x s16>)
385 ; CHECK-NEXT: [[SHUF:%[0-9]+]]:_(<8 x s16>) = G_SHUFFLE_VECTOR [[CONCAT_VECTORS]](<8 x s16>), [[CONCAT_VECTORS1]], shufflemask(11, 10, 9, 8, 3, 2, 1, 0)
386 ; CHECK-NEXT: $q0 = COPY [[SHUF]](<8 x s16>)
387 ; CHECK-NEXT: RET_ReallyLR implicit $q0
388 %0:_(<4 x s16>) = COPY $d0
389 %1:_(<4 x s16>) = COPY $d1
390 %2:_(<8 x s16>) = G_SHUFFLE_VECTOR %0(<4 x s16>), %1, shufflemask(7, 6, 5, 4, 3, 2, 1, 0)
391 $q0 = COPY %2(<8 x s16>)
392 RET_ReallyLR implicit $q0
396 name: shuffle_v16i8_v8i8
398 tracksRegLiveness: true
403 ; CHECK-LABEL: name: shuffle_v16i8_v8i8
404 ; CHECK: liveins: $d0, $d1
406 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<8 x s8>) = COPY $d0
407 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<8 x s8>) = COPY $d1
408 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(<8 x s8>) = G_IMPLICIT_DEF
409 ; CHECK-NEXT: [[CONCAT_VECTORS:%[0-9]+]]:_(<16 x s8>) = G_CONCAT_VECTORS [[COPY]](<8 x s8>), [[DEF]](<8 x s8>)
410 ; CHECK-NEXT: [[CONCAT_VECTORS1:%[0-9]+]]:_(<16 x s8>) = G_CONCAT_VECTORS [[COPY1]](<8 x s8>), [[DEF]](<8 x s8>)
411 ; CHECK-NEXT: [[SHUF:%[0-9]+]]:_(<16 x s8>) = G_SHUFFLE_VECTOR [[CONCAT_VECTORS]](<16 x s8>), [[CONCAT_VECTORS1]], shufflemask(7, 21, 6, 4, 5, 3, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0)
412 ; CHECK-NEXT: $q0 = COPY [[SHUF]](<16 x s8>)
413 ; CHECK-NEXT: RET_ReallyLR implicit $q0
414 %0:_(<8 x s8>) = COPY $d0
415 %1:_(<8 x s8>) = COPY $d1
416 %2:_(<16 x s8>) = G_SHUFFLE_VECTOR %0(<8 x s8>), %1, shufflemask(7, 13, 6, 4, 5, 3, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0)
417 $q0 = COPY %2(<16 x s8>)
418 RET_ReallyLR implicit $q0
422 name: size_shuffle_v6i32_v4i32
424 tracksRegLiveness: true
427 liveins: $s0, $s1, $s2, $s3, $s4, $s5, $s6, $s7, $x0
429 ; CHECK-LABEL: name: size_shuffle_v6i32_v4i32
430 ; CHECK: liveins: $s0, $s1, $s2, $s3, $s4, $s5, $s6, $s7, $x0
432 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
433 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $s1
434 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $s2
435 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $s3
436 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[COPY]](s32), [[COPY1]](s32), [[COPY2]](s32), [[COPY3]](s32)
437 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(s32) = COPY $s4
438 ; CHECK-NEXT: [[COPY5:%[0-9]+]]:_(s32) = COPY $s5
439 ; CHECK-NEXT: [[COPY6:%[0-9]+]]:_(s32) = COPY $s6
440 ; CHECK-NEXT: [[COPY7:%[0-9]+]]:_(s32) = COPY $s7
441 ; CHECK-NEXT: [[BUILD_VECTOR1:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[COPY4]](s32), [[COPY5]](s32), [[COPY6]](s32), [[COPY7]](s32)
442 ; CHECK-NEXT: [[COPY8:%[0-9]+]]:_(p0) = COPY $x0
443 ; CHECK-NEXT: [[SHUF:%[0-9]+]]:_(<4 x s32>) = G_SHUFFLE_VECTOR [[BUILD_VECTOR]](<4 x s32>), [[BUILD_VECTOR1]], shufflemask(3, 4, 7, 0)
444 ; CHECK-NEXT: [[SHUF1:%[0-9]+]]:_(<4 x s32>) = G_SHUFFLE_VECTOR [[BUILD_VECTOR]](<4 x s32>), [[BUILD_VECTOR1]], shufflemask(1, 5, undef, undef)
445 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
446 ; CHECK-NEXT: [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[SHUF]](<4 x s32>), [[C]](s64)
447 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
448 ; CHECK-NEXT: [[EVEC1:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[SHUF]](<4 x s32>), [[C1]](s64)
449 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
450 ; CHECK-NEXT: [[EVEC2:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[SHUF]](<4 x s32>), [[C2]](s64)
451 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 3
452 ; CHECK-NEXT: [[EVEC3:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[SHUF]](<4 x s32>), [[C3]](s64)
453 ; CHECK-NEXT: [[EVEC4:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[SHUF1]](<4 x s32>), [[C]](s64)
454 ; CHECK-NEXT: [[EVEC5:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[SHUF1]](<4 x s32>), [[C1]](s64)
455 ; CHECK-NEXT: [[BUILD_VECTOR2:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[EVEC]](s32), [[EVEC1]](s32)
456 ; CHECK-NEXT: [[BUILD_VECTOR3:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[EVEC2]](s32), [[EVEC3]](s32)
457 ; CHECK-NEXT: [[BUILD_VECTOR4:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[EVEC4]](s32), [[EVEC5]](s32)
458 ; CHECK-NEXT: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x s32>) = G_CONCAT_VECTORS [[BUILD_VECTOR2]](<2 x s32>), [[BUILD_VECTOR3]](<2 x s32>)
459 ; CHECK-NEXT: G_STORE [[CONCAT_VECTORS]](<4 x s32>), [[COPY8]](p0) :: (store (<4 x s32>), align 32)
460 ; CHECK-NEXT: [[C4:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
461 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY8]], [[C4]](s64)
462 ; CHECK-NEXT: G_STORE [[BUILD_VECTOR4]](<2 x s32>), [[PTR_ADD]](p0) :: (store (<2 x s32>) into unknown-address + 16, align 16)
463 ; CHECK-NEXT: RET_ReallyLR
468 %0:_(<4 x s32>) = G_BUILD_VECTOR %3(s32), %4(s32), %5(s32), %6(s32)
472 %10:_(s32) = COPY $s7
473 %1:_(<4 x s32>) = G_BUILD_VECTOR %7(s32), %8(s32), %9(s32), %10(s32)
475 %19:_(<6 x s32>) = G_SHUFFLE_VECTOR %0(<4 x s32>), %1, shufflemask(3, 4, 7, 0, 1, 5)
476 G_STORE %19(<6 x s32>), %2(p0) :: (store (<6 x s32>), align 32)
481 name: shuffle_v3i32_v4i32
483 tracksRegLiveness: true
488 ; CHECK-LABEL: name: shuffle_v3i32_v4i32
489 ; CHECK: liveins: $q0, $q1
491 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
492 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $q1
493 ; CHECK-NEXT: [[SHUF:%[0-9]+]]:_(<4 x s32>) = G_SHUFFLE_VECTOR [[COPY]](<4 x s32>), [[COPY1]], shufflemask(0, 1, 4, undef)
494 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[SHUF]](<4 x s32>)
495 ; CHECK-NEXT: $w0 = COPY [[UV]](s32)
496 ; CHECK-NEXT: RET_ReallyLR implicit $w0
497 %0:_(<4 x s32>) = COPY $q0
498 %1:_(<4 x s32>) = COPY $q1
499 %2:_(<3 x s32>) = G_SHUFFLE_VECTOR %0(<4 x s32>), %1, shufflemask(0, 1, 4)
500 %3:_(s32), %4:_(s32), %5:_(s32) = G_UNMERGE_VALUES %2(<3 x s32>)
502 RET_ReallyLR implicit $w0
506 name: shuffle_v2i32_v4i32
508 tracksRegLiveness: true
513 ; CHECK-LABEL: name: shuffle_v2i32_v4i32
514 ; CHECK: liveins: $q0, $q1
516 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
517 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $q1
518 ; CHECK-NEXT: [[SHUF:%[0-9]+]]:_(<4 x s32>) = G_SHUFFLE_VECTOR [[COPY]](<4 x s32>), [[COPY1]], shufflemask(0, 4, undef, undef)
519 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(<2 x s32>), [[UV1:%[0-9]+]]:_(<2 x s32>) = G_UNMERGE_VALUES [[SHUF]](<4 x s32>)
520 ; CHECK-NEXT: $d0 = COPY [[UV]](<2 x s32>)
521 ; CHECK-NEXT: RET_ReallyLR implicit $d0
522 %0:_(<4 x s32>) = COPY $q0
523 %1:_(<4 x s32>) = COPY $q1
524 %2:_(<2 x s32>) = G_SHUFFLE_VECTOR %0(<4 x s32>), %1, shufflemask(0, 4)
525 $d0 = COPY %2(<2 x s32>)
526 RET_ReallyLR implicit $d0
530 name: shuffle_v4i16_v8i16
532 tracksRegLiveness: true
537 ; CHECK-LABEL: name: shuffle_v4i16_v8i16
538 ; CHECK: liveins: $q0, $q1
540 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
541 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<8 x s16>) = COPY $q1
542 ; CHECK-NEXT: [[SHUF:%[0-9]+]]:_(<8 x s16>) = G_SHUFFLE_VECTOR [[COPY]](<8 x s16>), [[COPY1]], shufflemask(15, 14, 13, 4, undef, undef, undef, undef)
543 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(<4 x s16>), [[UV1:%[0-9]+]]:_(<4 x s16>) = G_UNMERGE_VALUES [[SHUF]](<8 x s16>)
544 ; CHECK-NEXT: $d0 = COPY [[UV]](<4 x s16>)
545 ; CHECK-NEXT: RET_ReallyLR implicit $d0
546 %0:_(<8 x s16>) = COPY $q0
547 %1:_(<8 x s16>) = COPY $q1
548 %2:_(<4 x s16>) = G_SHUFFLE_VECTOR %0(<8 x s16>), %1, shufflemask(15, 14, 13, 4)
549 $d0 = COPY %2(<4 x s16>)
550 RET_ReallyLR implicit $d0
554 name: shuffle_v8i8_v16i8
556 tracksRegLiveness: true
561 ; CHECK-LABEL: name: shuffle_v8i8_v16i8
562 ; CHECK: liveins: $q0, $q1
564 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<16 x s8>) = COPY $q0
565 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<16 x s8>) = COPY $q1
566 ; CHECK-NEXT: [[SHUF:%[0-9]+]]:_(<16 x s8>) = G_SHUFFLE_VECTOR [[COPY]](<16 x s8>), [[COPY1]], shufflemask(7, 13, 6, 4, 17, 3, 0, 0, undef, undef, undef, undef, undef, undef, undef, undef)
567 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(<8 x s8>), [[UV1:%[0-9]+]]:_(<8 x s8>) = G_UNMERGE_VALUES [[SHUF]](<16 x s8>)
568 ; CHECK-NEXT: $d0 = COPY [[UV]](<8 x s8>)
569 ; CHECK-NEXT: RET_ReallyLR implicit $d0
570 %0:_(<16 x s8>) = COPY $q0
571 %1:_(<16 x s8>) = COPY $q1
572 %2:_(<8 x s8>) = G_SHUFFLE_VECTOR %0(<16 x s8>), %1, shufflemask(7, 13, 6, 4, 17, 3, 0, 0)
573 $d0 = COPY %2(<8 x s8>)
574 RET_ReallyLR implicit $d0
578 name: size_shuffle_v4i32_v6i32
580 tracksRegLiveness: true
583 liveins: $s0, $s1, $s2, $s3, $s4, $s5
585 ; CHECK-LABEL: name: size_shuffle_v4i32_v6i32
586 ; CHECK: liveins: $s0, $s1, $s2, $s3, $s4, $s5
588 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
589 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $s1
590 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $s2
591 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $s3
592 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(s32) = COPY $s4
593 ; CHECK-NEXT: [[COPY5:%[0-9]+]]:_(s32) = COPY $s5
594 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
595 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[COPY]](s32), [[COPY1]](s32), [[COPY2]](s32), [[COPY3]](s32)
596 ; CHECK-NEXT: [[BUILD_VECTOR1:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[COPY4]](s32), [[COPY5]](s32), [[DEF]](s32), [[DEF]](s32)
597 ; CHECK-NEXT: [[BUILD_VECTOR2:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[COPY]](s32), [[COPY1]](s32), [[COPY2]](s32), [[COPY3]](s32)
598 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 3
599 ; CHECK-NEXT: [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[BUILD_VECTOR]](<4 x s32>), [[C]](s64)
600 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
601 ; CHECK-NEXT: [[EVEC1:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[BUILD_VECTOR1]](<4 x s32>), [[C1]](s64)
602 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
603 ; CHECK-NEXT: [[EVEC2:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[BUILD_VECTOR2]](<4 x s32>), [[C2]](s64)
604 ; CHECK-NEXT: [[COPY6:%[0-9]+]]:_(s64) = COPY [[C1]](s64)
605 ; CHECK-NEXT: [[EVEC3:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[BUILD_VECTOR]](<4 x s32>), [[COPY6]](s64)
606 ; CHECK-NEXT: [[BUILD_VECTOR3:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[EVEC]](s32), [[EVEC1]](s32), [[EVEC2]](s32), [[EVEC3]](s32)
607 ; CHECK-NEXT: $q0 = COPY [[BUILD_VECTOR3]](<4 x s32>)
608 ; CHECK-NEXT: RET_ReallyLR implicit $q0
615 %0:_(<6 x s32>) = G_BUILD_VECTOR %3(s32), %4(s32), %5(s32), %6(s32), %7(s32), %8(s32)
616 %19:_(<4 x s32>) = G_SHUFFLE_VECTOR %0(<6 x s32>), %0, shufflemask(3, 4, 7, 0)
617 $q0 = COPY %19(<4 x s32>)
618 RET_ReallyLR implicit $q0