1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-linux-gnu -O0 -run-pass=legalizer -global-isel-abort=0 -verify-machineinstrs %s -o - | FileCheck %s
9 ; CHECK-LABEL: name: test_eve_1
10 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
11 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
12 ; CHECK-NEXT: [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[COPY]](<2 x s64>), [[C]](s64)
13 ; CHECK-NEXT: $x0 = COPY [[EVEC]](s64)
14 ; CHECK-NEXT: RET_ReallyLR
15 %0:_(<2 x s64>) = COPY $q0
16 %1:_(s32) = G_CONSTANT i32 1
17 %2:_(s64) = G_EXTRACT_VECTOR_ELT %0(<2 x s64>), %1(s32)
26 ; CHECK-LABEL: name: test_eve_v2s1
27 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
28 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $q1
29 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
30 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(<2 x s64>) = G_ICMP intpred(eq), [[COPY]](<2 x s64>), [[COPY1]]
31 ; CHECK-NEXT: [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[ICMP]](<2 x s64>), [[C]](s64)
32 ; CHECK-NEXT: $x0 = COPY [[EVEC]](s64)
33 ; CHECK-NEXT: RET_ReallyLR
34 %0:_(<2 x s64>) = COPY $q0
35 %1:_(<2 x s64>) = COPY $q1
36 %2:_(s64) = G_CONSTANT i64 1
37 %3:_(<2 x s1>) = G_ICMP intpred(eq), %0(<2 x s64>), %1
38 %4:_(s1) = G_EXTRACT_VECTOR_ELT %3:_(<2 x s1>), %2:_(s64)
39 %5:_(s64) = G_ANYEXT %4(s1)
48 ; CHECK-LABEL: name: test_eve_v4s1
49 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
50 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $q1
51 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
52 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(<4 x s32>) = G_ICMP intpred(eq), [[COPY]](<4 x s32>), [[COPY1]]
53 ; CHECK-NEXT: [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[ICMP]](<4 x s32>), [[C]](s64)
54 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[EVEC]](s32)
55 ; CHECK-NEXT: $x0 = COPY [[ANYEXT]](s64)
56 ; CHECK-NEXT: RET_ReallyLR
57 %0:_(<4 x s32>) = COPY $q0
58 %1:_(<4 x s32>) = COPY $q1
59 %2:_(s64) = G_CONSTANT i64 1
60 %3:_(<4 x s1>) = G_ICMP intpred(eq), %0(<4 x s32>), %1
61 %4:_(s1) = G_EXTRACT_VECTOR_ELT %3:_(<4 x s1>), %2:_(s64)
62 %5:_(s64) = G_ANYEXT %4(s1)
71 ; CHECK-LABEL: name: test_eve_v8s1
72 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
73 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<8 x s16>) = COPY $q1
74 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
75 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(<8 x s16>) = G_ICMP intpred(eq), [[COPY]](<8 x s16>), [[COPY1]]
76 ; CHECK-NEXT: [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[ICMP]](<8 x s16>), [[C]](s64)
77 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[EVEC]](s16)
78 ; CHECK-NEXT: $x0 = COPY [[ANYEXT]](s64)
79 ; CHECK-NEXT: RET_ReallyLR
80 %0:_(<8 x s16>) = COPY $q0
81 %1:_(<8 x s16>) = COPY $q1
82 %2:_(s64) = G_CONSTANT i64 1
83 %3:_(<8 x s1>) = G_ICMP intpred(eq), %0(<8 x s16>), %1
84 %4:_(s1) = G_EXTRACT_VECTOR_ELT %3:_(<8 x s1>), %2:_(s64)
85 %5:_(s64) = G_ANYEXT %4(s1)
94 ; CHECK-LABEL: name: test_eve_v16s1
95 ; CHECK: [[COPY:%[0-9]+]]:_(<16 x s8>) = COPY $q0
96 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<16 x s8>) = COPY $q1
97 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
98 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(<16 x s8>) = G_ICMP intpred(eq), [[COPY]](<16 x s8>), [[COPY1]]
99 ; CHECK-NEXT: [[EVEC:%[0-9]+]]:_(s8) = G_EXTRACT_VECTOR_ELT [[ICMP]](<16 x s8>), [[C]](s64)
100 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[EVEC]](s8)
101 ; CHECK-NEXT: $x0 = COPY [[ANYEXT]](s64)
102 ; CHECK-NEXT: RET_ReallyLR
103 %0:_(<16 x s8>) = COPY $q0
104 %1:_(<16 x s8>) = COPY $q1
105 %2:_(s64) = G_CONSTANT i64 1
106 %3:_(<16 x s1>) = G_ICMP intpred(eq), %0(<16 x s8>), %1
107 %4:_(s1) = G_EXTRACT_VECTOR_ELT %3:_(<16 x s1>), %2:_(s64)
108 %5:_(s64) = G_ANYEXT %4(s1)
117 ; CHECK-LABEL: name: test_eve_v2p0
118 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x p0>) = COPY $q0
119 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
120 ; CHECK-NEXT: [[EVEC:%[0-9]+]]:_(p0) = G_EXTRACT_VECTOR_ELT [[COPY]](<2 x p0>), [[C]](s64)
121 ; CHECK-NEXT: $x0 = COPY [[EVEC]](p0)
122 ; CHECK-NEXT: RET_ReallyLR
123 %0:_(<2 x p0>) = COPY $q0
124 %2:_(s64) = G_CONSTANT i64 1
125 %3:_(p0) = G_EXTRACT_VECTOR_ELT %0:_(<2 x p0>), %2:_(s64)
133 liveins: $q0, $q1, $x0
134 ; CHECK-LABEL: name: test_eve_v4s64
135 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
136 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
137 ; CHECK-NEXT: [[EVEC:%[0-9]+]]:_(s64) = G_EXTRACT_VECTOR_ELT [[COPY]](<2 x s64>), [[C]](s64)
138 ; CHECK-NEXT: $x0 = COPY [[EVEC]](s64)
139 ; CHECK-NEXT: RET_ReallyLR
140 %0:_(<2 x s64>) = COPY $q0
141 %1:_(<2 x s64>) = COPY $q1
142 %concat:_(<4 x s64>) = G_CONCAT_VECTORS %0(<2 x s64>), %1(<2 x s64>)
143 %idx:_(s32) = G_CONSTANT i32 1
144 %idxprom:_(s64) = G_SEXT %idx(s32)
145 %3:_(s64) = G_EXTRACT_VECTOR_ELT %concat:_(<4 x s64>), %idxprom:_(s64)
150 name: test_eve_v2s1_unknown_idx
153 liveins: $q0, $q1, $x0
154 ; CHECK-LABEL: name: test_eve_v2s1_unknown_idx
155 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
156 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $q1
157 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x0
158 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(<2 x s64>) = G_ICMP intpred(eq), [[COPY]](<2 x s64>), [[COPY1]]
159 ; CHECK-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.0
160 ; CHECK-NEXT: G_STORE [[ICMP]](<2 x s64>), [[FRAME_INDEX]](p0) :: (store (<2 x s64>) into %stack.0)
161 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
162 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY2]], [[C]]
163 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
164 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[AND]], [[C1]]
165 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[FRAME_INDEX]], [[MUL]](s64)
166 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(s64) = G_LOAD [[PTR_ADD]](p0) :: (load (s64))
167 ; CHECK-NEXT: $x0 = COPY [[LOAD]](s64)
168 ; CHECK-NEXT: RET_ReallyLR
169 %0:_(<2 x s64>) = COPY $q0
170 %1:_(<2 x s64>) = COPY $q1
172 %3:_(<2 x s1>) = G_ICMP intpred(eq), %0(<2 x s64>), %1
173 %4:_(s1) = G_EXTRACT_VECTOR_ELT %3:_(<2 x s1>), %2:_(s64)
174 %5:_(s64) = G_ANYEXT %4(s1)
179 name: test_eve_v4s1_unknown_idx
182 liveins: $q0, $q1, $x0
183 ; CHECK-LABEL: name: test_eve_v4s1_unknown_idx
184 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
185 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $q1
186 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x0
187 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(<4 x s32>) = G_ICMP intpred(eq), [[COPY]](<4 x s32>), [[COPY1]]
188 ; CHECK-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.0
189 ; CHECK-NEXT: G_STORE [[ICMP]](<4 x s32>), [[FRAME_INDEX]](p0) :: (store (<4 x s32>) into %stack.0)
190 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 3
191 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY2]], [[C]]
192 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 4
193 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[AND]], [[C1]]
194 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[FRAME_INDEX]], [[MUL]](s64)
195 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[PTR_ADD]](p0) :: (load (s32))
196 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[LOAD]](s32)
197 ; CHECK-NEXT: $x0 = COPY [[ANYEXT]](s64)
198 ; CHECK-NEXT: RET_ReallyLR
199 %0:_(<4 x s32>) = COPY $q0
200 %1:_(<4 x s32>) = COPY $q1
202 %3:_(<4 x s1>) = G_ICMP intpred(eq), %0(<4 x s32>), %1
203 %4:_(s1) = G_EXTRACT_VECTOR_ELT %3:_(<4 x s1>), %2:_(s64)
204 %5:_(s64) = G_ANYEXT %4(s1)
209 name: test_eve_v8s1_unknown_idx
212 liveins: $q0, $q1, $x0
213 ; CHECK-LABEL: name: test_eve_v8s1_unknown_idx
214 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
215 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<8 x s16>) = COPY $q1
216 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x0
217 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(<8 x s16>) = G_ICMP intpred(eq), [[COPY]](<8 x s16>), [[COPY1]]
218 ; CHECK-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.0
219 ; CHECK-NEXT: G_STORE [[ICMP]](<8 x s16>), [[FRAME_INDEX]](p0) :: (store (<8 x s16>) into %stack.0)
220 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 7
221 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY2]], [[C]]
222 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
223 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[AND]], [[C1]]
224 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[FRAME_INDEX]], [[MUL]](s64)
225 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(s16) = G_LOAD [[PTR_ADD]](p0) :: (load (s16))
226 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[LOAD]](s16)
227 ; CHECK-NEXT: $x0 = COPY [[ANYEXT]](s64)
228 ; CHECK-NEXT: RET_ReallyLR
229 %0:_(<8 x s16>) = COPY $q0
230 %1:_(<8 x s16>) = COPY $q1
232 %3:_(<8 x s1>) = G_ICMP intpred(eq), %0(<8 x s16>), %1
233 %4:_(s1) = G_EXTRACT_VECTOR_ELT %3:_(<8 x s1>), %2:_(s64)
234 %5:_(s64) = G_ANYEXT %4(s1)
239 name: test_eve_v16s1_unknown_idx
242 liveins: $q0, $q1, $x0
243 ; CHECK-LABEL: name: test_eve_v16s1_unknown_idx
244 ; CHECK: [[COPY:%[0-9]+]]:_(<16 x s8>) = COPY $q0
245 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<16 x s8>) = COPY $q1
246 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x0
247 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(<16 x s8>) = G_ICMP intpred(eq), [[COPY]](<16 x s8>), [[COPY1]]
248 ; CHECK-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.0
249 ; CHECK-NEXT: G_STORE [[ICMP]](<16 x s8>), [[FRAME_INDEX]](p0) :: (store (<16 x s8>) into %stack.0)
250 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 15
251 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY2]], [[C]]
252 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
253 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[AND]], [[C1]]
254 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[FRAME_INDEX]], [[MUL]](s64)
255 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(s8) = G_LOAD [[PTR_ADD]](p0) :: (load (s8))
256 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[LOAD]](s8)
257 ; CHECK-NEXT: $x0 = COPY [[ANYEXT]](s64)
258 ; CHECK-NEXT: RET_ReallyLR
259 %0:_(<16 x s8>) = COPY $q0
260 %1:_(<16 x s8>) = COPY $q1
262 %3:_(<16 x s1>) = G_ICMP intpred(eq), %0(<16 x s8>), %1
263 %4:_(s1) = G_EXTRACT_VECTOR_ELT %3:_(<16 x s1>), %2:_(s64)
264 %5:_(s64) = G_ANYEXT %4(s1)
269 name: test_eve_v2p0_unknown_idx
272 liveins: $q0, $q1, $x0
273 ; CHECK-LABEL: name: test_eve_v2p0_unknown_idx
274 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x p0>) = COPY $q0
275 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x0
276 ; CHECK-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.0
277 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<2 x s64>) = G_BITCAST [[COPY]](<2 x p0>)
278 ; CHECK-NEXT: G_STORE [[BITCAST]](<2 x s64>), [[FRAME_INDEX]](p0) :: (store (<2 x s64>) into %stack.0)
279 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
280 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY1]], [[C]]
281 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
282 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[AND]], [[C1]]
283 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[FRAME_INDEX]], [[MUL]](s64)
284 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(p0) = G_LOAD [[PTR_ADD]](p0) :: (load (p0))
285 ; CHECK-NEXT: $x0 = COPY [[LOAD]](p0)
286 ; CHECK-NEXT: RET_ReallyLR
287 %0:_(<2 x p0>) = COPY $q0
289 %3:_(p0) = G_EXTRACT_VECTOR_ELT %0:_(<2 x p0>), %2:_(s64)
294 name: test_eve_v4s64_unknown_idx
297 liveins: $q0, $q1, $x0
298 ; CHECK-LABEL: name: test_eve_v4s64_unknown_idx
299 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
300 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $q1
301 ; CHECK-NEXT: %idx:_(s64) = COPY $x0
302 ; CHECK-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.0
303 ; CHECK-NEXT: G_STORE [[COPY]](<2 x s64>), [[FRAME_INDEX]](p0) :: (store (<2 x s64>) into %stack.0, align 32)
304 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
305 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[FRAME_INDEX]], [[C]](s64)
306 ; CHECK-NEXT: G_STORE [[COPY1]](<2 x s64>), [[PTR_ADD]](p0) :: (store (<2 x s64>) into %stack.0 + 16, basealign 32)
307 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 3
308 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND %idx, [[C1]]
309 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
310 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[AND]], [[C2]]
311 ; CHECK-NEXT: [[PTR_ADD1:%[0-9]+]]:_(p0) = G_PTR_ADD [[FRAME_INDEX]], [[MUL]](s64)
312 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(s64) = G_LOAD [[PTR_ADD1]](p0) :: (load (s64))
313 ; CHECK-NEXT: $x0 = COPY [[LOAD]](s64)
314 ; CHECK-NEXT: RET_ReallyLR
315 %0:_(<2 x s64>) = COPY $q0
316 %1:_(<2 x s64>) = COPY $q1
317 %concat:_(<4 x s64>) = G_CONCAT_VECTORS %0(<2 x s64>), %1(<2 x s64>)
318 %idx:_(s64) = COPY $x0
319 %3:_(s64) = G_EXTRACT_VECTOR_ELT %concat:_(<4 x s64>), %idx:_(s64)
327 liveins: $q0, $q1, $x0
328 ; CHECK-LABEL: name: test_eve_v8s32
329 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
330 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
331 ; CHECK-NEXT: [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[COPY]](<4 x s32>), [[C]](s64)
332 ; CHECK-NEXT: $w0 = COPY [[EVEC]](s32)
333 ; CHECK-NEXT: RET_ReallyLR
334 %0:_(<4 x s32>) = COPY $q0
335 %1:_(<4 x s32>) = COPY $q1
336 %concat:_(<8 x s32>) = G_CONCAT_VECTORS %0(<4 x s32>), %1(<4 x s32>)
337 %idx:_(s32) = G_CONSTANT i32 1
338 %idxprom:_(s64) = G_SEXT %idx(s32)
339 %3:_(s32) = G_EXTRACT_VECTOR_ELT %concat:_(<8 x s32>), %idxprom:_(s64)
344 name: test_eve_v16s16
347 liveins: $q0, $q1, $x0
348 ; CHECK-LABEL: name: test_eve_v16s16
349 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q1
350 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
351 ; CHECK-NEXT: [[EVEC:%[0-9]+]]:_(s16) = G_EXTRACT_VECTOR_ELT [[COPY]](<8 x s16>), [[C]](s64)
352 ; CHECK-NEXT: %ext:_(s32) = G_ANYEXT [[EVEC]](s16)
353 ; CHECK-NEXT: $w0 = COPY %ext(s32)
354 ; CHECK-NEXT: RET_ReallyLR
355 %0:_(<8 x s16>) = COPY $q0
356 %1:_(<8 x s16>) = COPY $q1
357 %concat:_(<16 x s16>) = G_CONCAT_VECTORS %0(<8 x s16>), %1(<8 x s16>)
358 %idx:_(s32) = G_CONSTANT i32 9
359 %idxprom:_(s64) = G_SEXT %idx(s32)
360 %3:_(s16) = G_EXTRACT_VECTOR_ELT %concat:_(<16 x s16>), %idxprom:_(s64)
361 %ext:_(s32) = G_ANYEXT %3
370 ; CHECK-LABEL: name: test_eve_v4p0
371 ; CHECK: [[DEF:%[0-9]+]]:_(p0) = G_IMPLICIT_DEF
372 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x p0>) = G_BUILD_VECTOR [[DEF]](p0), [[DEF]](p0)
373 ; CHECK-NEXT: %idx:_(s64) = G_CONSTANT i64 1
374 ; CHECK-NEXT: %eve:_(p0) = G_EXTRACT_VECTOR_ELT [[BUILD_VECTOR]](<2 x p0>), %idx(s64)
375 ; CHECK-NEXT: $x0 = COPY %eve(p0)
376 ; CHECK-NEXT: RET_ReallyLR
377 %vec:_(<4 x p0>) = G_IMPLICIT_DEF
378 %idx:_(s64) = G_CONSTANT i64 1
379 %eve:_(p0) = G_EXTRACT_VECTOR_ELT %vec:_(<4 x p0>), %idx:_(s64)
384 name: test_eve_v8s32_unknown_idx
387 liveins: $q0, $q1, $w0
388 ; CHECK-LABEL: name: test_eve_v8s32_unknown_idx
389 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
390 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $q1
391 ; CHECK-NEXT: %idx:_(s32) = COPY $w0
392 ; CHECK-NEXT: %idxprom:_(s64) = G_SEXT %idx(s32)
393 ; CHECK-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.0
394 ; CHECK-NEXT: G_STORE [[COPY]](<4 x s32>), [[FRAME_INDEX]](p0) :: (store (<4 x s32>) into %stack.0, align 32)
395 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
396 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[FRAME_INDEX]], [[C]](s64)
397 ; CHECK-NEXT: G_STORE [[COPY1]](<4 x s32>), [[PTR_ADD]](p0) :: (store (<4 x s32>) into %stack.0 + 16, basealign 32)
398 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 7
399 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND %idxprom, [[C1]]
400 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 4
401 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[AND]], [[C2]]
402 ; CHECK-NEXT: [[PTR_ADD1:%[0-9]+]]:_(p0) = G_PTR_ADD [[FRAME_INDEX]], [[MUL]](s64)
403 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[PTR_ADD1]](p0) :: (load (s32))
404 ; CHECK-NEXT: $w0 = COPY [[LOAD]](s32)
405 ; CHECK-NEXT: RET_ReallyLR
406 %0:_(<4 x s32>) = COPY $q0
407 %1:_(<4 x s32>) = COPY $q1
408 %concat:_(<8 x s32>) = G_CONCAT_VECTORS %0(<4 x s32>), %1(<4 x s32>)
409 %idx:_(s32) = COPY $w0
410 %idxprom:_(s64) = G_SEXT %idx(s32)
411 %3:_(s32) = G_EXTRACT_VECTOR_ELT %concat:_(<8 x s32>), %idxprom:_(s64)
416 name: test_eve_v16s16_unknown_idx
419 liveins: $q0, $q1, $w0
420 ; CHECK-LABEL: name: test_eve_v16s16_unknown_idx
421 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
422 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<8 x s16>) = COPY $q1
423 ; CHECK-NEXT: %idx:_(s32) = COPY $w0
424 ; CHECK-NEXT: %idxprom:_(s64) = G_SEXT %idx(s32)
425 ; CHECK-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.0
426 ; CHECK-NEXT: G_STORE [[COPY]](<8 x s16>), [[FRAME_INDEX]](p0) :: (store (<8 x s16>) into %stack.0, align 32)
427 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
428 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[FRAME_INDEX]], [[C]](s64)
429 ; CHECK-NEXT: G_STORE [[COPY1]](<8 x s16>), [[PTR_ADD]](p0) :: (store (<8 x s16>) into %stack.0 + 16, basealign 32)
430 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 15
431 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND %idxprom, [[C1]]
432 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
433 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[AND]], [[C2]]
434 ; CHECK-NEXT: [[PTR_ADD1:%[0-9]+]]:_(p0) = G_PTR_ADD [[FRAME_INDEX]], [[MUL]](s64)
435 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(s16) = G_LOAD [[PTR_ADD1]](p0) :: (load (s16))
436 ; CHECK-NEXT: %ext:_(s32) = G_ANYEXT [[LOAD]](s16)
437 ; CHECK-NEXT: $w0 = COPY %ext(s32)
438 ; CHECK-NEXT: RET_ReallyLR
439 %0:_(<8 x s16>) = COPY $q0
440 %1:_(<8 x s16>) = COPY $q1
441 %concat:_(<16 x s16>) = G_CONCAT_VECTORS %0(<8 x s16>), %1(<8 x s16>)
442 %idx:_(s32) = COPY $w0
443 %idxprom:_(s64) = G_SEXT %idx(s32)
444 %3:_(s16) = G_EXTRACT_VECTOR_ELT %concat:_(<16 x s16>), %idxprom:_(s64)
445 %ext:_(s32) = G_ANYEXT %3
450 name: test_eve_v4p0_unknown_idx
454 ; CHECK-LABEL: name: test_eve_v4p0_unknown_idx
455 ; CHECK: [[DEF:%[0-9]+]]:_(p0) = G_IMPLICIT_DEF
456 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x p0>) = G_BUILD_VECTOR [[DEF]](p0), [[DEF]](p0)
457 ; CHECK-NEXT: [[BUILD_VECTOR1:%[0-9]+]]:_(<2 x p0>) = G_BUILD_VECTOR [[DEF]](p0), [[DEF]](p0)
458 ; CHECK-NEXT: %idx:_(s64) = COPY $x0
459 ; CHECK-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.0
460 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<2 x s64>) = G_BITCAST [[BUILD_VECTOR]](<2 x p0>)
461 ; CHECK-NEXT: G_STORE [[BITCAST]](<2 x s64>), [[FRAME_INDEX]](p0) :: (store (<2 x s64>) into %stack.0, align 32)
462 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
463 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[FRAME_INDEX]], [[C]](s64)
464 ; CHECK-NEXT: [[BITCAST1:%[0-9]+]]:_(<2 x s64>) = G_BITCAST [[BUILD_VECTOR1]](<2 x p0>)
465 ; CHECK-NEXT: G_STORE [[BITCAST1]](<2 x s64>), [[PTR_ADD]](p0) :: (store (<2 x s64>) into %stack.0 + 16, basealign 32)
466 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 3
467 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND %idx, [[C1]]
468 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
469 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[AND]], [[C2]]
470 ; CHECK-NEXT: [[PTR_ADD1:%[0-9]+]]:_(p0) = G_PTR_ADD [[FRAME_INDEX]], [[MUL]](s64)
471 ; CHECK-NEXT: %eve:_(p0) = G_LOAD [[PTR_ADD1]](p0) :: (load (p0))
472 ; CHECK-NEXT: $x0 = COPY %eve(p0)
473 ; CHECK-NEXT: RET_ReallyLR
474 %vec:_(<4 x p0>) = G_IMPLICIT_DEF
475 %idx:_(s64) = COPY $x0
476 %eve:_(p0) = G_EXTRACT_VECTOR_ELT %vec:_(<4 x p0>), %idx:_(s64)
481 name: cant_legalize_different_address_spaces
485 ; Make sure that the pointer legalization rules don't apply when we have
486 ; different address spaces.
488 ; CHECK-LABEL: name: cant_legalize_different_address_spaces
489 ; CHECK: %vec:_(<4 x p1>) = G_IMPLICIT_DEF
490 ; CHECK-NEXT: %idx:_(s64) = G_CONSTANT i64 1
491 ; CHECK-NEXT: %eve:_(p0) = G_EXTRACT_VECTOR_ELT %vec(<4 x p1>), %idx(s64)
492 ; CHECK-NEXT: $x0 = COPY %eve(p0)
493 ; CHECK-NEXT: RET_ReallyLR
494 %vec:_(<4 x p1>) = G_IMPLICIT_DEF
495 %idx:_(s64) = G_CONSTANT i64 1
496 %eve:_(p0) = G_EXTRACT_VECTOR_ELT %vec:_(<4 x p1>), %idx:_(s64)