1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-linux-gnu -O0 -run-pass=legalizer %s -o - -global-isel-abort=1 | FileCheck %s
8 ; CHECK-LABEL: name: pr63826_v2s16
11 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
12 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
13 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
14 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<2 x s32>) = G_INSERT_VECTOR_ELT [[COPY]], [[C1]](s32), [[C]](s64)
15 ; CHECK-NEXT: $d0 = COPY [[IVEC]](<2 x s32>)
16 ; CHECK-NEXT: RET_ReallyLR implicit $d0
17 %1:_(<2 x s32>) = COPY $d0
18 %0:_(<2 x s16>) = G_TRUNC %1(<2 x s32>)
19 %4:_(s64) = G_CONSTANT i64 0
20 %3:_(s16) = G_CONSTANT i16 1
21 %2:_(<2 x s16>) = G_INSERT_VECTOR_ELT %0, %3(s16), %4(s64)
22 %5:_(<2 x s32>) = G_ANYEXT %2(<2 x s16>)
23 $d0 = COPY %5(<2 x s32>)
24 RET_ReallyLR implicit $d0
31 ; CHECK-LABEL: name: pr63826_v2s8
34 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
35 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
36 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
37 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<2 x s32>) = G_INSERT_VECTOR_ELT [[COPY]], [[C1]](s32), [[C]](s64)
38 ; CHECK-NEXT: $d0 = COPY [[IVEC]](<2 x s32>)
39 ; CHECK-NEXT: RET_ReallyLR implicit $d0
40 %1:_(<2 x s32>) = COPY $d0
41 %0:_(<2 x s8>) = G_TRUNC %1(<2 x s32>)
42 %4:_(s64) = G_CONSTANT i64 0
43 %3:_(s8) = G_CONSTANT i8 1
44 %2:_(<2 x s8>) = G_INSERT_VECTOR_ELT %0, %3(s8), %4(s64)
45 %5:_(<2 x s32>) = G_ANYEXT %2(<2 x s8>)
46 $d0 = COPY %5(<2 x s32>)
47 RET_ReallyLR implicit $d0
54 ; CHECK-LABEL: name: pr63826_v4s8
57 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
58 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
59 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s16) = G_CONSTANT i16 1
60 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<4 x s16>) = G_INSERT_VECTOR_ELT [[COPY]], [[C1]](s16), [[C]](s64)
61 ; CHECK-NEXT: $d0 = COPY [[IVEC]](<4 x s16>)
62 ; CHECK-NEXT: RET_ReallyLR implicit $d0
63 %1:_(<4 x s16>) = COPY $d0
64 %0:_(<4 x s8>) = G_TRUNC %1(<4 x s16>)
65 %4:_(s64) = G_CONSTANT i64 0
66 %3:_(s8) = G_CONSTANT i8 1
67 %2:_(<4 x s8>) = G_INSERT_VECTOR_ELT %0, %3(s8), %4(s64)
68 %5:_(<4 x s16>) = G_ANYEXT %2(<4 x s8>)
69 $d0 = COPY %5(<4 x s16>)
70 RET_ReallyLR implicit $d0
77 ; CHECK-LABEL: name: v8s8
80 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<8 x s8>) = COPY $d0
81 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
82 ; CHECK-NEXT: %val:_(s8) = G_CONSTANT i8 42
83 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<8 x s8>) = G_INSERT_VECTOR_ELT [[COPY]], %val(s8), [[C]](s64)
84 ; CHECK-NEXT: $d0 = COPY [[IVEC]](<8 x s8>)
85 ; CHECK-NEXT: RET_ReallyLR
86 %0:_(<8 x s8>) = COPY $d0
87 %1:_(s64) = G_CONSTANT i64 1
88 %val:_(s8) = G_CONSTANT i8 42
89 %2:_(<8 x s8>) = G_INSERT_VECTOR_ELT %0(<8 x s8>), %val(s8), %1(s64)
90 $d0 = COPY %2(<8 x s8>)
98 ; CHECK-LABEL: name: v16s8
101 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<16 x s8>) = COPY $q0
102 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
103 ; CHECK-NEXT: %val:_(s8) = G_CONSTANT i8 42
104 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<16 x s8>) = G_INSERT_VECTOR_ELT [[COPY]], %val(s8), [[C]](s64)
105 ; CHECK-NEXT: $q0 = COPY [[IVEC]](<16 x s8>)
106 ; CHECK-NEXT: RET_ReallyLR
107 %0:_(<16 x s8>) = COPY $q0
108 %1:_(s64) = G_CONSTANT i64 1
109 %val:_(s8) = G_CONSTANT i8 42
110 %2:_(<16 x s8>) = G_INSERT_VECTOR_ELT %0(<16 x s8>), %val(s8), %1(s64)
111 $q0 = COPY %2(<16 x s8>)
119 ; CHECK-LABEL: name: v4s16
120 ; CHECK: liveins: $q0
122 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
123 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
124 ; CHECK-NEXT: %val:_(s16) = G_CONSTANT i16 42
125 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<4 x s16>) = G_INSERT_VECTOR_ELT [[COPY]], %val(s16), [[C]](s64)
126 ; CHECK-NEXT: $d0 = COPY [[IVEC]](<4 x s16>)
127 ; CHECK-NEXT: RET_ReallyLR
128 %0:_(<4 x s16>) = COPY $d0
129 %1:_(s64) = G_CONSTANT i64 1
130 %val:_(s16) = G_CONSTANT i16 42
131 %2:_(<4 x s16>) = G_INSERT_VECTOR_ELT %0(<4 x s16>), %val(s16), %1(s64)
132 $d0 = COPY %2(<4 x s16>)
140 ; CHECK-LABEL: name: v8s16
141 ; CHECK: liveins: $q0
143 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
144 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
145 ; CHECK-NEXT: %val:_(s16) = G_CONSTANT i16 42
146 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<8 x s16>) = G_INSERT_VECTOR_ELT [[COPY]], %val(s16), [[C]](s64)
147 ; CHECK-NEXT: $q0 = COPY [[IVEC]](<8 x s16>)
148 ; CHECK-NEXT: RET_ReallyLR
149 %0:_(<8 x s16>) = COPY $q0
150 %1:_(s64) = G_CONSTANT i64 1
151 %val:_(s16) = G_CONSTANT i16 42
152 %2:_(<8 x s16>) = G_INSERT_VECTOR_ELT %0(<8 x s16>), %val(s16), %1(s64)
153 $q0 = COPY %2(<8 x s16>)
161 ; CHECK-LABEL: name: v2s32
162 ; CHECK: liveins: $q0
164 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
165 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
166 ; CHECK-NEXT: %val:_(s32) = G_CONSTANT i32 42
167 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<2 x s32>) = G_INSERT_VECTOR_ELT [[COPY]], %val(s32), [[C]](s64)
168 ; CHECK-NEXT: $d0 = COPY [[IVEC]](<2 x s32>)
169 ; CHECK-NEXT: RET_ReallyLR
170 %0:_(<2 x s32>) = COPY $d0
171 %1:_(s64) = G_CONSTANT i64 1
172 %val:_(s32) = G_CONSTANT i32 42
173 %2:_(<2 x s32>) = G_INSERT_VECTOR_ELT %0(<2 x s32>), %val(s32), %1(s64)
174 $d0 = COPY %2(<2 x s32>)
182 ; CHECK-LABEL: name: v4s32
183 ; CHECK: liveins: $q0
185 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
186 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
187 ; CHECK-NEXT: %val:_(s32) = G_CONSTANT i32 42
188 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<4 x s32>) = G_INSERT_VECTOR_ELT [[COPY]], %val(s32), [[C]](s64)
189 ; CHECK-NEXT: $q0 = COPY [[IVEC]](<4 x s32>)
190 ; CHECK-NEXT: RET_ReallyLR
191 %0:_(<4 x s32>) = COPY $q0
192 %1:_(s64) = G_CONSTANT i64 1
193 %val:_(s32) = G_CONSTANT i32 42
194 %2:_(<4 x s32>) = G_INSERT_VECTOR_ELT %0(<4 x s32>), %val(s32), %1(s64)
195 $q0 = COPY %2(<4 x s32>)
203 ; CHECK-LABEL: name: v2s64
204 ; CHECK: liveins: $q0
206 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
207 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
208 ; CHECK-NEXT: %val:_(s64) = G_CONSTANT i64 42
209 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<2 x s64>) = G_INSERT_VECTOR_ELT [[COPY]], %val(s64), [[C]](s64)
210 ; CHECK-NEXT: $q0 = COPY [[IVEC]](<2 x s64>)
211 ; CHECK-NEXT: RET_ReallyLR
212 %0:_(<2 x s64>) = COPY $q0
213 %1:_(s64) = G_CONSTANT i64 1
214 %val:_(s64) = G_CONSTANT i64 42
215 %2:_(<2 x s64>) = G_INSERT_VECTOR_ELT %0(<2 x s64>), %val(s64), %1(s64)
216 $q0 = COPY %2(<2 x s64>)
222 ; CHECK-LABEL: name: v3s8_crash
224 ; CHECK-NEXT: successors: %bb.1(0x80000000)
225 ; CHECK-NEXT: liveins: $w1, $w2, $w3, $x0
227 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
228 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
229 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $w2
230 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $w3
231 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s8) = G_IMPLICIT_DEF
232 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s8) = G_CONSTANT i8 0
235 ; CHECK-NEXT: successors: %bb.1(0x80000000)
237 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
238 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY1]](s32)
239 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[COPY2]](s32)
240 ; CHECK-NEXT: [[TRUNC2:%[0-9]+]]:_(s8) = G_TRUNC [[COPY3]](s32)
241 ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s8) = G_IMPLICIT_DEF
242 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<8 x s8>) = G_BUILD_VECTOR [[TRUNC]](s8), [[TRUNC1]](s8), [[TRUNC2]](s8), [[DEF1]](s8), [[DEF1]](s8), [[DEF1]](s8), [[DEF1]](s8), [[DEF1]](s8)
243 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(<8 x s16>) = G_ANYEXT [[BUILD_VECTOR]](<8 x s8>)
244 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(<4 x s16>), [[UV1:%[0-9]+]]:_(<4 x s16>) = G_UNMERGE_VALUES [[ANYEXT]](<8 x s16>)
245 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s16) = G_CONSTANT i16 0
246 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<4 x s16>) = G_INSERT_VECTOR_ELT [[UV]], [[C2]](s16), [[C1]](s64)
247 ; CHECK-NEXT: [[UV2:%[0-9]+]]:_(s16), [[UV3:%[0-9]+]]:_(s16), [[UV4:%[0-9]+]]:_(s16), [[UV5:%[0-9]+]]:_(s16) = G_UNMERGE_VALUES [[IVEC]](<4 x s16>)
248 ; CHECK-NEXT: [[TRUNC3:%[0-9]+]]:_(s8) = G_TRUNC [[UV2]](s16)
249 ; CHECK-NEXT: [[TRUNC4:%[0-9]+]]:_(s8) = G_TRUNC [[UV3]](s16)
250 ; CHECK-NEXT: [[TRUNC5:%[0-9]+]]:_(s8) = G_TRUNC [[UV4]](s16)
251 ; CHECK-NEXT: [[DEF2:%[0-9]+]]:_(<4 x s8>) = G_IMPLICIT_DEF
252 ; CHECK-NEXT: [[UV6:%[0-9]+]]:_(s8), [[UV7:%[0-9]+]]:_(s8), [[UV8:%[0-9]+]]:_(s8), [[UV9:%[0-9]+]]:_(s8) = G_UNMERGE_VALUES [[DEF2]](<4 x s8>)
253 ; CHECK-NEXT: [[BUILD_VECTOR1:%[0-9]+]]:_(<16 x s8>) = G_BUILD_VECTOR [[TRUNC3]](s8), [[TRUNC4]](s8), [[TRUNC5]](s8), [[UV6]](s8), [[UV7]](s8), [[UV8]](s8), [[UV6]](s8), [[UV7]](s8), [[UV8]](s8), [[UV6]](s8), [[UV7]](s8), [[UV8]](s8), [[DEF1]](s8), [[DEF1]](s8), [[DEF1]](s8), [[DEF1]](s8)
254 ; CHECK-NEXT: [[BUILD_VECTOR2:%[0-9]+]]:_(<16 x s8>) = G_BUILD_VECTOR [[C]](s8), [[DEF]](s8), [[DEF]](s8), [[UV6]](s8), [[UV7]](s8), [[UV8]](s8), [[UV6]](s8), [[UV7]](s8), [[UV8]](s8), [[UV6]](s8), [[UV7]](s8), [[UV8]](s8), [[DEF1]](s8), [[DEF1]](s8), [[DEF1]](s8), [[DEF1]](s8)
255 ; CHECK-NEXT: [[SHUF:%[0-9]+]]:_(<16 x s8>) = G_SHUFFLE_VECTOR [[BUILD_VECTOR1]](<16 x s8>), [[BUILD_VECTOR2]], shufflemask(0, 16, 16, 16, 1, 16, 16, 16, 2, 16, 16, 16, undef, undef, undef, undef)
256 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<4 x s32>) = G_BITCAST [[SHUF]](<16 x s8>)
257 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:_(<4 x s32>) = G_UITOFP [[BITCAST]](<4 x s32>)
258 ; CHECK-NEXT: [[UV10:%[0-9]+]]:_(s32), [[UV11:%[0-9]+]]:_(s32), [[UV12:%[0-9]+]]:_(s32), [[UV13:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[UITOFP]](<4 x s32>)
259 ; CHECK-NEXT: G_STORE [[UV10]](s32), [[COPY]](p0) :: (store (s32), align 16)
260 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 4
261 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY]], [[C3]](s64)
262 ; CHECK-NEXT: G_STORE [[UV11]](s32), [[PTR_ADD]](p0) :: (store (s32) into unknown-address + 4)
263 ; CHECK-NEXT: [[C4:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
264 ; CHECK-NEXT: [[PTR_ADD1:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY]], [[C4]](s64)
265 ; CHECK-NEXT: G_STORE [[UV12]](s32), [[PTR_ADD1]](p0) :: (store (s32) into unknown-address + 8, align 8)
266 ; CHECK-NEXT: G_BR %bb.1
268 liveins: $w1, $w2, $w3, $x0
274 %5:_(<3 x s32>) = G_BUILD_VECTOR %2(s32), %3(s32), %4(s32)
275 %1:_(<3 x s8>) = G_TRUNC %5(<3 x s32>)
276 %8:_(s64) = G_CONSTANT i64 0
277 %11:_(s8) = G_IMPLICIT_DEF
278 %7:_(s8) = G_CONSTANT i8 0
279 %10:_(<3 x s8>) = G_BUILD_VECTOR %7(s8), %11(s8), %11(s8)
282 %14:_(s64) = G_CONSTANT i64 0
283 %15:_(s8) = G_CONSTANT i8 0
284 %6:_(<3 x s8>) = G_INSERT_VECTOR_ELT %1, %15(s8), %14(s64)
285 %9:_(<12 x s8>) = G_SHUFFLE_VECTOR %6(<3 x s8>), %10, shufflemask(0, 3, 3, 3, 1, 3, 3, 3, 2, 3, 3, 3)
286 %12:_(<3 x s32>) = G_BITCAST %9(<12 x s8>)
287 %13:_(<3 x s32>) = G_UITOFP %12(<3 x s32>)
288 G_STORE %13(<3 x s32>), %0(p0) :: (store (<3 x s32>))