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
13 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
14 ; CHECK: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $q1
15 ; CHECK: [[SHUF:%[0-9]+]]:_(<4 x s32>) = G_SHUFFLE_VECTOR [[COPY]](<4 x s32>), [[COPY1]], shufflemask(0, 0, 0, 0)
16 ; CHECK: $q0 = COPY [[SHUF]](<4 x s32>)
17 ; CHECK: RET_ReallyLR implicit $q0
18 %0:_(<4 x s32>) = COPY $q0
19 %1:_(<4 x s32>) = COPY $q1
20 %2:_(<4 x s32>) = G_SHUFFLE_VECTOR %0(<4 x s32>), %1, shufflemask(0, 0, 0, 0)
21 $q0 = COPY %2(<4 x s32>)
22 RET_ReallyLR implicit $q0
28 tracksRegLiveness: true
33 ; CHECK-LABEL: name: shuffle_v2i64
34 ; CHECK: liveins: $q0, $q1
35 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
36 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $q1
37 ; CHECK: [[SHUF:%[0-9]+]]:_(<2 x s64>) = G_SHUFFLE_VECTOR [[COPY]](<2 x s64>), [[COPY1]], shufflemask(0, 0)
38 ; CHECK: $q0 = COPY [[SHUF]](<2 x s64>)
39 ; CHECK: RET_ReallyLR implicit $q0
40 %0:_(<2 x s64>) = COPY $q0
41 %1:_(<2 x s64>) = COPY $q1
42 %2:_(<2 x s64>) = G_SHUFFLE_VECTOR %0(<2 x s64>), %1, shufflemask(0, 0)
43 $q0 = COPY %2(<2 x s64>)
44 RET_ReallyLR implicit $q0
50 tracksRegLiveness: true
55 ; CHECK-LABEL: name: shuffle_v2p0
56 ; CHECK: liveins: $q0, $q1
57 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x p0>) = COPY $q0
58 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x p0>) = COPY $q1
59 ; CHECK: [[SHUF:%[0-9]+]]:_(<2 x p0>) = G_SHUFFLE_VECTOR [[COPY]](<2 x p0>), [[COPY1]], shufflemask(0, 0)
60 ; CHECK: $q0 = COPY [[SHUF]](<2 x p0>)
61 ; CHECK: RET_ReallyLR implicit $q0
62 %0:_(<2 x p0>) = COPY $q0
63 %1:_(<2 x p0>) = COPY $q1
64 %2:_(<2 x p0>) = G_SHUFFLE_VECTOR %0(<2 x p0>), %1, shufflemask(0, 0)
65 $q0 = COPY %2(<2 x p0>)
66 RET_ReallyLR implicit $q0
72 tracksRegLiveness: true
77 ; CHECK-LABEL: name: shuffle_v16i8
78 ; CHECK: liveins: $q0, $q1
79 ; CHECK: [[COPY:%[0-9]+]]:_(<16 x s8>) = COPY $q0
80 ; CHECK: [[COPY1:%[0-9]+]]:_(<16 x s8>) = COPY $q1
81 ; CHECK: [[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)
82 ; CHECK: $q0 = COPY [[SHUF]](<16 x s8>)
83 ; CHECK: RET_ReallyLR implicit $q0
84 %0:_(<16 x s8>) = COPY $q0
85 %1:_(<16 x s8>) = COPY $q1
86 %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)
87 $q0 = COPY %2(<16 x s8>)
88 RET_ReallyLR implicit $q0
94 tracksRegLiveness: true
99 ; CHECK-LABEL: name: shuffle_v8i16
100 ; CHECK: liveins: $q0, $q1
101 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
102 ; CHECK: [[COPY1:%[0-9]+]]:_(<8 x s16>) = COPY $q1
103 ; CHECK: [[SHUF:%[0-9]+]]:_(<8 x s16>) = G_SHUFFLE_VECTOR [[COPY]](<8 x s16>), [[COPY1]], shufflemask(0, 0, 0, 0, 0, 0, 0, 0)
104 ; CHECK: $q0 = COPY [[SHUF]](<8 x s16>)
105 ; CHECK: RET_ReallyLR implicit $q0
106 %0:_(<8 x s16>) = COPY $q0
107 %1:_(<8 x s16>) = COPY $q1
108 %2:_(<8 x s16>) = G_SHUFFLE_VECTOR %0(<8 x s16>), %1, shufflemask(0, 0, 0, 0, 0, 0, 0, 0)
109 $q0 = COPY %2(<8 x s16>)
110 RET_ReallyLR implicit $q0
114 name: shuffle_1elt_mask
116 tracksRegLiveness: true
121 ; CHECK-LABEL: name: shuffle_1elt_mask
122 ; CHECK: liveins: $d0, $d1
123 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $d0
124 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $d1
125 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY [[COPY]](s64)
126 ; CHECK: [[COPY3:%[0-9]+]]:_(s64) = COPY [[COPY1]](s64)
127 ; CHECK: $d0 = COPY [[COPY2]](s64)
128 ; CHECK: $d1 = COPY [[COPY3]](s64)
129 ; CHECK: RET_ReallyLR implicit $d0, implicit $d1
132 %3:_(s64) = G_SHUFFLE_VECTOR %0:_(s64), %1:_, shufflemask(0)
133 %4:_(s64) = G_SHUFFLE_VECTOR %0:_(s64), %1:_, shufflemask(1)
136 RET_ReallyLR implicit $d0, implicit $d1
140 name: oversize_shuffle_v4i64
142 tracksRegLiveness: true
145 liveins: $q0, $q1, $q2, $q3, $x0
147 ; CHECK-LABEL: name: oversize_shuffle_v4i64
148 ; CHECK: liveins: $q0, $q1, $q2, $q3, $x0
149 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
150 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $q1
151 ; CHECK: [[COPY2:%[0-9]+]]:_(<2 x s64>) = COPY $q2
152 ; CHECK: [[COPY3:%[0-9]+]]:_(<2 x s64>) = COPY $q3
153 ; CHECK: [[COPY4:%[0-9]+]]:_(p0) = COPY $x0
154 ; CHECK: [[SHUF:%[0-9]+]]:_(<2 x s64>) = G_SHUFFLE_VECTOR [[COPY1]](<2 x s64>), [[COPY2]], shufflemask(1, 2)
155 ; CHECK: [[SHUF1:%[0-9]+]]:_(<2 x s64>) = G_SHUFFLE_VECTOR [[COPY3]](<2 x s64>), [[COPY]], shufflemask(1, 2)
156 ; CHECK: G_STORE [[SHUF]](<2 x s64>), [[COPY4]](p0) :: (store (<2 x s64>), align 32)
157 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
158 ; CHECK: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY4]], [[C]](s64)
159 ; CHECK: G_STORE [[SHUF1]](<2 x s64>), [[PTR_ADD]](p0) :: (store (<2 x s64>) into unknown-address + 16)
160 ; CHECK: RET_ReallyLR
161 %3:_(<2 x s64>) = COPY $q0
162 %4:_(<2 x s64>) = COPY $q1
163 %0:_(<4 x s64>) = G_CONCAT_VECTORS %3(<2 x s64>), %4(<2 x s64>)
164 %5:_(<2 x s64>) = COPY $q2
165 %6:_(<2 x s64>) = COPY $q3
166 %1:_(<4 x s64>) = G_CONCAT_VECTORS %5(<2 x s64>), %6(<2 x s64>)
168 %7:_(<4 x s64>) = G_SHUFFLE_VECTOR %0(<4 x s64>), %1, shufflemask(3, 4, 7, 0)
169 G_STORE %7(<4 x s64>), %2(p0) :: (store (<4 x s64>))
174 name: oversize_shuffle_v8i32_build_vector
176 tracksRegLiveness: true
179 liveins: $q0, $q1, $q2, $q3, $x0
181 ; CHECK-LABEL: name: oversize_shuffle_v8i32_build_vector
182 ; CHECK: liveins: $q0, $q1, $q2, $q3, $x0
183 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
184 ; CHECK: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $q1
185 ; CHECK: [[COPY2:%[0-9]+]]:_(<4 x s32>) = COPY $q2
186 ; CHECK: [[COPY3:%[0-9]+]]:_(<4 x s32>) = COPY $q3
187 ; CHECK: [[COPY4:%[0-9]+]]:_(p0) = COPY $x0
188 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
189 ; CHECK: [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[COPY]](<4 x s32>), [[C]](s64)
190 ; CHECK: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
191 ; CHECK: [[EVEC1:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[COPY1]](<4 x s32>), [[C1]](s64)
192 ; CHECK: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
193 ; CHECK: [[EVEC2:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[COPY2]](<4 x s32>), [[C2]](s64)
194 ; CHECK: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 3
195 ; CHECK: [[EVEC3:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[COPY3]](<4 x s32>), [[C3]](s64)
196 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[EVEC]](s32), [[EVEC1]](s32), [[EVEC2]](s32), [[EVEC3]](s32)
197 ; CHECK: [[SHUF:%[0-9]+]]:_(<4 x s32>) = G_SHUFFLE_VECTOR [[COPY1]](<4 x s32>), [[COPY]], shufflemask(2, 6, 5, 3)
198 ; CHECK: G_STORE [[BUILD_VECTOR]](<4 x s32>), [[COPY4]](p0) :: (store (<4 x s32>), align 32)
199 ; CHECK: [[C4:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
200 ; CHECK: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY4]], [[C4]](s64)
201 ; CHECK: G_STORE [[SHUF]](<4 x s32>), [[PTR_ADD]](p0) :: (store (<4 x s32>) into unknown-address + 16)
202 ; CHECK: RET_ReallyLR
203 %3:_(<4 x s32>) = COPY $q0
204 %4:_(<4 x s32>) = COPY $q1
205 %0:_(<8 x s32>) = G_CONCAT_VECTORS %3(<4 x s32>), %4(<4 x s32>)
206 %5:_(<4 x s32>) = COPY $q2
207 %6:_(<4 x s32>) = COPY $q3
208 %1:_(<8 x s32>) = G_CONCAT_VECTORS %5(<4 x s32>), %6(<4 x s32>)
210 %7:_(<8 x s32>) = G_SHUFFLE_VECTOR %0(<8 x s32>), %1, shufflemask(0, 5, 10, 15, 6, 2, 1, 7)
211 G_STORE %7(<8 x s32>), %2(p0) :: (store (<8 x s32>))
216 name: oversize_shuffle_v6i64
218 tracksRegLiveness: true
222 - { id: 0, offset: 24, size: 8, alignment: 8, isImmutable: true }
223 - { id: 1, offset: 16, size: 8, alignment: 16, isImmutable: true }
224 - { id: 2, offset: 8, size: 8, alignment: 8, isImmutable: true }
225 - { id: 3, size: 8, alignment: 16, isImmutable: true }
228 liveins: $d0, $d1, $d2, $d3, $d4, $d5, $d6, $d7, $x0
230 ; CHECK-LABEL: name: oversize_shuffle_v6i64
231 ; CHECK: liveins: $d0, $d1, $d2, $d3, $d4, $d5, $d6, $d7, $x0
232 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $d0
233 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $d1
234 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $d2
235 ; CHECK: [[COPY3:%[0-9]+]]:_(s64) = COPY $d3
236 ; CHECK: [[COPY4:%[0-9]+]]:_(s64) = COPY $d4
237 ; CHECK: [[COPY5:%[0-9]+]]:_(s64) = COPY $d5
238 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[COPY2]](s64), [[COPY3]](s64)
239 ; CHECK: [[BUILD_VECTOR1:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[COPY4]](s64), [[COPY5]](s64)
240 ; CHECK: [[BUILD_VECTOR2:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[COPY]](s64), [[COPY1]](s64)
241 ; CHECK: [[BUILD_VECTOR3:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[COPY]](s64), [[COPY1]](s64)
242 ; CHECK: [[COPY6:%[0-9]+]]:_(s64) = COPY $d6
243 ; CHECK: [[COPY7:%[0-9]+]]:_(s64) = COPY $d7
244 ; CHECK: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.0
245 ; CHECK: [[LOAD:%[0-9]+]]:_(s64) = G_LOAD [[FRAME_INDEX]](p0) :: (invariant load (s64) from %fixed-stack.0, align 16)
246 ; CHECK: [[FRAME_INDEX1:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.1
247 ; CHECK: [[LOAD1:%[0-9]+]]:_(s64) = G_LOAD [[FRAME_INDEX1]](p0) :: (invariant load (s64) from %fixed-stack.1)
248 ; CHECK: [[FRAME_INDEX2:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.2
249 ; CHECK: [[LOAD2:%[0-9]+]]:_(s64) = G_LOAD [[FRAME_INDEX2]](p0) :: (invariant load (s64) from %fixed-stack.2, align 16)
250 ; CHECK: [[FRAME_INDEX3:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.3
251 ; CHECK: [[LOAD3:%[0-9]+]]:_(s64) = G_LOAD [[FRAME_INDEX3]](p0) :: (invariant load (s64) from %fixed-stack.3)
252 ; CHECK: [[BUILD_VECTOR4:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[COPY6]](s64), [[COPY7]](s64)
253 ; CHECK: [[BUILD_VECTOR5:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[LOAD2]](s64), [[LOAD3]](s64)
254 ; CHECK: [[COPY8:%[0-9]+]]:_(p0) = COPY $x0
255 ; CHECK: [[DEF:%[0-9]+]]:_(<2 x s64>) = G_IMPLICIT_DEF
256 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 3
257 ; CHECK: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
258 ; CHECK: [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[BUILD_VECTOR]](<2 x s64>), [[C1]](s64)
259 ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
260 ; CHECK: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
261 ; CHECK: [[EVEC1:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[BUILD_VECTOR1]](<2 x s64>), [[C3]](s64)
262 ; CHECK: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
263 ; CHECK: [[EVEC2:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[BUILD_VECTOR4]](<2 x s64>), [[C1]](s64)
264 ; CHECK: [[EVEC3:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[BUILD_VECTOR2]](<2 x s64>), [[C3]](s64)
265 ; CHECK: [[SHUF:%[0-9]+]]:_(<2 x s64>) = G_SHUFFLE_VECTOR [[BUILD_VECTOR3]](<2 x s64>), [[BUILD_VECTOR5]], shufflemask(1, 3)
266 ; CHECK: [[BUILD_VECTOR6:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[EVEC]](s64), [[EVEC1]](s64)
267 ; CHECK: [[BUILD_VECTOR7:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[EVEC2]](s64), [[EVEC3]](s64)
268 ; CHECK: G_STORE [[BUILD_VECTOR6]](<2 x s64>), [[COPY8]](p0) :: (store (<2 x s64>), align 64)
269 ; CHECK: [[C5:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
270 ; CHECK: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY8]], [[C5]](s64)
271 ; CHECK: G_STORE [[BUILD_VECTOR7]](<2 x s64>), [[PTR_ADD]](p0) :: (store (<2 x s64>) into unknown-address + 16)
272 ; CHECK: [[C6:%[0-9]+]]:_(s64) = G_CONSTANT i64 32
273 ; CHECK: [[PTR_ADD1:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY8]], [[C6]](s64)
274 ; CHECK: G_STORE [[SHUF]](<2 x s64>), [[PTR_ADD1]](p0) :: (store (<2 x s64>) into unknown-address + 32, align 32)
275 ; CHECK: RET_ReallyLR
282 %0:_(<6 x s64>) = G_BUILD_VECTOR %3(s64), %4(s64), %5(s64), %6(s64), %7(s64), %8(s64)
284 %10:_(s64) = COPY $d7
285 %15:_(p0) = G_FRAME_INDEX %fixed-stack.3
286 %11:_(s64) = G_LOAD %15(p0) :: (invariant load (s64) from %fixed-stack.3, align 16)
287 %16:_(p0) = G_FRAME_INDEX %fixed-stack.2
288 %12:_(s64) = G_LOAD %16(p0) :: (invariant load (s64) from %fixed-stack.2)
289 %17:_(p0) = G_FRAME_INDEX %fixed-stack.1
290 %13:_(s64) = G_LOAD %17(p0) :: (invariant load 8 from %fixed-stack.1, align 16)
291 %18:_(p0) = G_FRAME_INDEX %fixed-stack.0
292 %14:_(s64) = G_LOAD %18(p0) :: (invariant load 8 from %fixed-stack.0)
293 %1:_(<6 x s64>) = G_BUILD_VECTOR %9(s64), %10(s64), %11(s64), %12(s64), %13(s64), %14(s64)
295 %19:_(<6 x s64>) = G_SHUFFLE_VECTOR %0(<6 x s64>), %1, shufflemask(3, 4, 7, 0, 1, 11)
296 G_STORE %19(<6 x s64>), %2(p0) :: (store (<6 x s64>), align 64)