1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=instcombine -S -data-layout="E" | FileCheck %s --check-prefixes=ALL
3 ; RUN: opt < %s -passes=instcombine -S -data-layout="e" | FileCheck %s --check-prefixes=ALL
6 declare void @use64(i64)
8 define <4 x i16> @low_index_same_length_poison_basevec(i64 %x) {
9 ; ALL-LABEL: @low_index_same_length_poison_basevec(
10 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[X:%.*]] to i16
11 ; ALL-NEXT: [[R:%.*]] = insertelement <4 x i16> poison, i16 [[T]], i64 0
12 ; ALL-NEXT: ret <4 x i16> [[R]]
14 %t = trunc i64 %x to i16
15 %r = insertelement <4 x i16> poison, i16 %t, i64 0
19 define <4 x i16> @high_index_same_length_poison_basevec(i64 %x) {
20 ; ALL-LABEL: @high_index_same_length_poison_basevec(
21 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[X:%.*]] to i16
22 ; ALL-NEXT: [[R:%.*]] = insertelement <4 x i16> poison, i16 [[T]], i64 3
23 ; ALL-NEXT: ret <4 x i16> [[R]]
25 %t = trunc i64 %x to i16
26 %r = insertelement <4 x i16> poison, i16 %t, i64 3
30 define <4 x i16> @wrong_index_same_length_poison_basevec(i64 %x) {
31 ; ALL-LABEL: @wrong_index_same_length_poison_basevec(
32 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[X:%.*]] to i16
33 ; ALL-NEXT: [[R:%.*]] = insertelement <4 x i16> poison, i16 [[T]], i64 1
34 ; ALL-NEXT: ret <4 x i16> [[R]]
36 %t = trunc i64 %x to i16
37 %r = insertelement <4 x i16> poison, i16 %t, i64 1
41 define <8 x i16> @low_index_longer_length_poison_basevec(i64 %x) {
42 ; ALL-LABEL: @low_index_longer_length_poison_basevec(
43 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[X:%.*]] to i16
44 ; ALL-NEXT: [[R:%.*]] = insertelement <8 x i16> poison, i16 [[T]], i64 0
45 ; ALL-NEXT: ret <8 x i16> [[R]]
47 %t = trunc i64 %x to i16
48 %r = insertelement <8 x i16> poison, i16 %t, i64 0
52 define <8 x i16> @high_index_longer_length_poison_basevec(i64 %x) {
53 ; ALL-LABEL: @high_index_longer_length_poison_basevec(
54 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[X:%.*]] to i16
55 ; ALL-NEXT: [[R:%.*]] = insertelement <8 x i16> poison, i16 [[T]], i64 3
56 ; ALL-NEXT: ret <8 x i16> [[R]]
58 %t = trunc i64 %x to i16
59 %r = insertelement <8 x i16> poison, i16 %t, i64 3
63 define <8 x i16> @wrong_index_longer_length_poison_basevec(i64 %x) {
64 ; ALL-LABEL: @wrong_index_longer_length_poison_basevec(
65 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[X:%.*]] to i16
66 ; ALL-NEXT: [[R:%.*]] = insertelement <8 x i16> poison, i16 [[T]], i64 7
67 ; ALL-NEXT: ret <8 x i16> [[R]]
69 %t = trunc i64 %x to i16
70 %r = insertelement <8 x i16> poison, i16 %t, i64 7
74 define <2 x i16> @low_index_shorter_length_poison_basevec(i64 %x) {
75 ; ALL-LABEL: @low_index_shorter_length_poison_basevec(
76 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[X:%.*]] to i16
77 ; ALL-NEXT: [[R:%.*]] = insertelement <2 x i16> poison, i16 [[T]], i64 0
78 ; ALL-NEXT: ret <2 x i16> [[R]]
80 %t = trunc i64 %x to i16
81 %r = insertelement <2 x i16> poison, i16 %t, i64 0
85 define <4 x i8> @wrong_index_shorter_length_poison_basevec(i64 %x) {
86 ; ALL-LABEL: @wrong_index_shorter_length_poison_basevec(
87 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[X:%.*]] to i8
88 ; ALL-NEXT: [[R:%.*]] = insertelement <4 x i8> poison, i8 [[T]], i64 3
89 ; ALL-NEXT: ret <4 x i8> [[R]]
91 %t = trunc i64 %x to i8
92 %r = insertelement <4 x i8> poison, i8 %t, i64 3
96 define <4 x i8> @wrong_width_low_index_shorter_length_poison_basevec(i65 %x) {
97 ; ALL-LABEL: @wrong_width_low_index_shorter_length_poison_basevec(
98 ; ALL-NEXT: [[T:%.*]] = trunc i65 [[X:%.*]] to i8
99 ; ALL-NEXT: [[R:%.*]] = insertelement <4 x i8> poison, i8 [[T]], i64 0
100 ; ALL-NEXT: ret <4 x i8> [[R]]
102 %t = trunc i65 %x to i8
103 %r = insertelement <4 x i8> poison, i8 %t, i64 0
107 define <4 x i8> @low_index_shorter_length_poison_basevec_extra_use(i64 %x) {
108 ; ALL-LABEL: @low_index_shorter_length_poison_basevec_extra_use(
109 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[X:%.*]] to i8
110 ; ALL-NEXT: call void @use(i8 [[T]])
111 ; ALL-NEXT: [[R:%.*]] = insertelement <4 x i8> poison, i8 [[T]], i64 0
112 ; ALL-NEXT: ret <4 x i8> [[R]]
114 %t = trunc i64 %x to i8
115 call void @use(i8 %t)
116 %r = insertelement <4 x i8> poison, i8 %t, i64 0
120 define <4 x i16> @lshr_same_length_poison_basevec_le(i64 %x) {
121 ; ALL-LABEL: @lshr_same_length_poison_basevec_le(
122 ; ALL-NEXT: [[S:%.*]] = lshr i64 [[X:%.*]], 32
123 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[S]] to i16
124 ; ALL-NEXT: [[R:%.*]] = insertelement <4 x i16> poison, i16 [[T]], i64 2
125 ; ALL-NEXT: ret <4 x i16> [[R]]
128 %t = trunc i64 %s to i16
129 %r = insertelement <4 x i16> poison, i16 %t, i64 2
133 define <4 x i16> @lshr_same_length_poison_basevec_be(i64 %x) {
134 ; ALL-LABEL: @lshr_same_length_poison_basevec_be(
135 ; ALL-NEXT: [[S:%.*]] = lshr i64 [[X:%.*]], 32
136 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[S]] to i16
137 ; ALL-NEXT: [[R:%.*]] = insertelement <4 x i16> poison, i16 [[T]], i64 1
138 ; ALL-NEXT: ret <4 x i16> [[R]]
141 %t = trunc i64 %s to i16
142 %r = insertelement <4 x i16> poison, i16 %t, i64 1
146 define <4 x i16> @lshr_same_length_poison_basevec_both_endian(i64 %x) {
147 ; ALL-LABEL: @lshr_same_length_poison_basevec_both_endian(
148 ; ALL-NEXT: [[S:%.*]] = lshr i64 [[X:%.*]], 48
149 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[S]] to i16
150 ; ALL-NEXT: [[R:%.*]] = insertelement <4 x i16> poison, i16 [[T]], i64 0
151 ; ALL-NEXT: ret <4 x i16> [[R]]
154 %t = trunc i64 %s to i16
155 %r = insertelement <4 x i16> poison, i16 %t, i64 0
159 define <4 x i16> @lshr_wrong_index_same_length_poison_basevec(i64 %x) {
160 ; ALL-LABEL: @lshr_wrong_index_same_length_poison_basevec(
161 ; ALL-NEXT: [[S:%.*]] = lshr i64 [[X:%.*]], 48
162 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[S]] to i16
163 ; ALL-NEXT: [[R:%.*]] = insertelement <4 x i16> poison, i16 [[T]], i64 1
164 ; ALL-NEXT: ret <4 x i16> [[R]]
167 %t = trunc i64 %s to i16
168 %r = insertelement <4 x i16> poison, i16 %t, i64 1
172 define <8 x i16> @lshr_longer_length_poison_basevec_le(i64 %x) {
173 ; ALL-LABEL: @lshr_longer_length_poison_basevec_le(
174 ; ALL-NEXT: [[S:%.*]] = lshr i64 [[X:%.*]], 48
175 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[S]] to i16
176 ; ALL-NEXT: [[R:%.*]] = insertelement <8 x i16> poison, i16 [[T]], i64 3
177 ; ALL-NEXT: ret <8 x i16> [[R]]
180 %t = trunc i64 %s to i16
181 %r = insertelement <8 x i16> poison, i16 %t, i64 3
185 define <8 x i16> @lshr_longer_length_poison_basevec_be(i64 %x) {
186 ; ALL-LABEL: @lshr_longer_length_poison_basevec_be(
187 ; ALL-NEXT: [[S:%.*]] = lshr i64 [[X:%.*]], 32
188 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[S]] to i16
189 ; ALL-NEXT: [[R:%.*]] = insertelement <8 x i16> poison, i16 [[T]], i64 1
190 ; ALL-NEXT: ret <8 x i16> [[R]]
193 %t = trunc i64 %s to i16
194 %r = insertelement <8 x i16> poison, i16 %t, i64 1
198 define <8 x i16> @lshr_wrong_index_longer_length_poison_basevec(i64 %x) {
199 ; ALL-LABEL: @lshr_wrong_index_longer_length_poison_basevec(
200 ; ALL-NEXT: [[S:%.*]] = lshr i64 [[X:%.*]], 16
201 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[S]] to i16
202 ; ALL-NEXT: [[R:%.*]] = insertelement <8 x i16> poison, i16 [[T]], i64 6
203 ; ALL-NEXT: ret <8 x i16> [[R]]
206 %t = trunc i64 %s to i16
207 %r = insertelement <8 x i16> poison, i16 %t, i64 6
211 define <2 x i16> @lshr_shorter_length_poison_basevec_le(i64 %x) {
212 ; ALL-LABEL: @lshr_shorter_length_poison_basevec_le(
213 ; ALL-NEXT: [[S:%.*]] = lshr i64 [[X:%.*]], 16
214 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[S]] to i16
215 ; ALL-NEXT: [[R:%.*]] = insertelement <2 x i16> poison, i16 [[T]], i64 1
216 ; ALL-NEXT: ret <2 x i16> [[R]]
219 %t = trunc i64 %s to i16
220 %r = insertelement <2 x i16> poison, i16 %t, i64 1
224 define <4 x i8> @lshr_shorter_length_poison_basevec_be(i64 %x) {
225 ; ALL-LABEL: @lshr_shorter_length_poison_basevec_be(
226 ; ALL-NEXT: [[S:%.*]] = lshr i64 [[X:%.*]], 40
227 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[S]] to i8
228 ; ALL-NEXT: [[R:%.*]] = insertelement <4 x i8> poison, i8 [[T]], i64 2
229 ; ALL-NEXT: ret <4 x i8> [[R]]
232 %t = trunc i64 %s to i8
233 %r = insertelement <4 x i8> poison, i8 %t, i64 2
237 define <4 x i8> @lshr_wrong_index_shorter_length_poison_basevec(i64 %x) {
238 ; ALL-LABEL: @lshr_wrong_index_shorter_length_poison_basevec(
239 ; ALL-NEXT: [[S:%.*]] = lshr i64 [[X:%.*]], 40
240 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[S]] to i8
241 ; ALL-NEXT: [[R:%.*]] = insertelement <4 x i8> poison, i8 [[T]], i64 3
242 ; ALL-NEXT: ret <4 x i8> [[R]]
245 %t = trunc i64 %s to i8
246 %r = insertelement <4 x i8> poison, i8 %t, i64 3
250 define <4 x i8> @lshr_wrong_shift_shorter_length_poison_basevec(i64 %x) {
251 ; ALL-LABEL: @lshr_wrong_shift_shorter_length_poison_basevec(
252 ; ALL-NEXT: [[S:%.*]] = lshr i64 [[X:%.*]], 57
253 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[S]] to i8
254 ; ALL-NEXT: [[R:%.*]] = insertelement <4 x i8> poison, i8 [[T]], i64 0
255 ; ALL-NEXT: ret <4 x i8> [[R]]
258 %t = trunc i64 %s to i8
259 %r = insertelement <4 x i8> poison, i8 %t, i64 0
263 define <4 x i8> @lshr_shorter_length_poison_basevec_be_extra_use(i64 %x) {
264 ; ALL-LABEL: @lshr_shorter_length_poison_basevec_be_extra_use(
265 ; ALL-NEXT: [[S:%.*]] = lshr i64 [[X:%.*]], 40
266 ; ALL-NEXT: call void @use64(i64 [[S]])
267 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[S]] to i8
268 ; ALL-NEXT: [[R:%.*]] = insertelement <4 x i8> poison, i8 [[T]], i64 2
269 ; ALL-NEXT: ret <4 x i8> [[R]]
272 call void @use64(i64 %s)
273 %t = trunc i64 %s to i8
274 %r = insertelement <4 x i8> poison, i8 %t, i64 2
278 define <4 x i16> @low_index_same_length_basevec(i64 %x, <4 x i16> %v) {
279 ; ALL-LABEL: @low_index_same_length_basevec(
280 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[X:%.*]] to i16
281 ; ALL-NEXT: [[R:%.*]] = insertelement <4 x i16> [[V:%.*]], i16 [[T]], i64 0
282 ; ALL-NEXT: ret <4 x i16> [[R]]
284 %t = trunc i64 %x to i16
285 %r = insertelement <4 x i16> %v, i16 %t, i64 0
289 define <4 x i16> @high_index_same_length_basevec(i64 %x, <4 x i16> %v) {
290 ; ALL-LABEL: @high_index_same_length_basevec(
291 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[X:%.*]] to i16
292 ; ALL-NEXT: [[R:%.*]] = insertelement <4 x i16> [[V:%.*]], i16 [[T]], i64 3
293 ; ALL-NEXT: ret <4 x i16> [[R]]
295 %t = trunc i64 %x to i16
296 %r = insertelement <4 x i16> %v, i16 %t, i64 3
300 define <4 x i16> @wrong_index_same_length_basevec(i64 %x, <4 x i16> %v) {
301 ; ALL-LABEL: @wrong_index_same_length_basevec(
302 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[X:%.*]] to i16
303 ; ALL-NEXT: [[R:%.*]] = insertelement <4 x i16> [[V:%.*]], i16 [[T]], i64 1
304 ; ALL-NEXT: ret <4 x i16> [[R]]
306 %t = trunc i64 %x to i16
307 %r = insertelement <4 x i16> %v, i16 %t, i64 1
311 define <8 x i16> @low_index_longer_length_basevec(i64 %x, <8 x i16> %v) {
312 ; ALL-LABEL: @low_index_longer_length_basevec(
313 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[X:%.*]] to i16
314 ; ALL-NEXT: [[R:%.*]] = insertelement <8 x i16> [[V:%.*]], i16 [[T]], i64 0
315 ; ALL-NEXT: ret <8 x i16> [[R]]
317 %t = trunc i64 %x to i16
318 %r = insertelement <8 x i16> %v, i16 %t, i64 0
322 define <8 x i16> @high_index_longer_length_basevec(i64 %x, <8 x i16> %v) {
323 ; ALL-LABEL: @high_index_longer_length_basevec(
324 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[X:%.*]] to i16
325 ; ALL-NEXT: [[R:%.*]] = insertelement <8 x i16> [[V:%.*]], i16 [[T]], i64 3
326 ; ALL-NEXT: ret <8 x i16> [[R]]
328 %t = trunc i64 %x to i16
329 %r = insertelement <8 x i16> %v, i16 %t, i64 3
333 define <8 x i16> @wrong_index_longer_length_basevec(i64 %x, <8 x i16> %v) {
334 ; ALL-LABEL: @wrong_index_longer_length_basevec(
335 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[X:%.*]] to i16
336 ; ALL-NEXT: [[R:%.*]] = insertelement <8 x i16> [[V:%.*]], i16 [[T]], i64 7
337 ; ALL-NEXT: ret <8 x i16> [[R]]
339 %t = trunc i64 %x to i16
340 %r = insertelement <8 x i16> %v, i16 %t, i64 7
344 define <2 x i16> @low_index_shorter_length_basevec(i64 %x, <2 x i16> %v) {
345 ; ALL-LABEL: @low_index_shorter_length_basevec(
346 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[X:%.*]] to i16
347 ; ALL-NEXT: [[R:%.*]] = insertelement <2 x i16> [[V:%.*]], i16 [[T]], i64 0
348 ; ALL-NEXT: ret <2 x i16> [[R]]
350 %t = trunc i64 %x to i16
351 %r = insertelement <2 x i16> %v, i16 %t, i64 0
355 define <4 x i8> @wrong_index_shorter_length_basevec(i64 %x, <4 x i8> %v) {
356 ; ALL-LABEL: @wrong_index_shorter_length_basevec(
357 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[X:%.*]] to i8
358 ; ALL-NEXT: [[R:%.*]] = insertelement <4 x i8> [[V:%.*]], i8 [[T]], i64 3
359 ; ALL-NEXT: ret <4 x i8> [[R]]
361 %t = trunc i64 %x to i8
362 %r = insertelement <4 x i8> %v, i8 %t, i64 3
366 define <4 x i16> @lshr_same_length_basevec_le(i64 %x, <4 x i16> %v) {
367 ; ALL-LABEL: @lshr_same_length_basevec_le(
368 ; ALL-NEXT: [[S:%.*]] = lshr i64 [[X:%.*]], 32
369 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[S]] to i16
370 ; ALL-NEXT: [[R:%.*]] = insertelement <4 x i16> [[V:%.*]], i16 [[T]], i64 2
371 ; ALL-NEXT: ret <4 x i16> [[R]]
374 %t = trunc i64 %s to i16
375 %r = insertelement <4 x i16> %v, i16 %t, i64 2
379 define <4 x i16> @lshr_same_length_basevec_be(i64 %x, <4 x i16> %v) {
380 ; ALL-LABEL: @lshr_same_length_basevec_be(
381 ; ALL-NEXT: [[S:%.*]] = lshr i64 [[X:%.*]], 32
382 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[S]] to i16
383 ; ALL-NEXT: [[R:%.*]] = insertelement <4 x i16> [[V:%.*]], i16 [[T]], i64 1
384 ; ALL-NEXT: ret <4 x i16> [[R]]
387 %t = trunc i64 %s to i16
388 %r = insertelement <4 x i16> %v, i16 %t, i64 1
392 define <4 x i16> @lshr_same_length_basevec_both_endian(i64 %x, <4 x i16> %v) {
393 ; ALL-LABEL: @lshr_same_length_basevec_both_endian(
394 ; ALL-NEXT: [[S:%.*]] = lshr i64 [[X:%.*]], 48
395 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[S]] to i16
396 ; ALL-NEXT: [[R:%.*]] = insertelement <4 x i16> [[V:%.*]], i16 [[T]], i64 3
397 ; ALL-NEXT: ret <4 x i16> [[R]]
400 %t = trunc i64 %s to i16
401 %r = insertelement <4 x i16> %v, i16 %t, i64 3
405 define <4 x i16> @lshr_wrong_index_same_length_basevec(i64 %x, <4 x i16> %v) {
406 ; ALL-LABEL: @lshr_wrong_index_same_length_basevec(
407 ; ALL-NEXT: [[S:%.*]] = lshr i64 [[X:%.*]], 48
408 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[S]] to i16
409 ; ALL-NEXT: [[R:%.*]] = insertelement <4 x i16> [[V:%.*]], i16 [[T]], i64 1
410 ; ALL-NEXT: ret <4 x i16> [[R]]
413 %t = trunc i64 %s to i16
414 %r = insertelement <4 x i16> %v, i16 %t, i64 1
418 define <8 x i16> @lshr_longer_length_basevec_le(i64 %x, <8 x i16> %v) {
419 ; ALL-LABEL: @lshr_longer_length_basevec_le(
420 ; ALL-NEXT: [[S:%.*]] = lshr i64 [[X:%.*]], 48
421 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[S]] to i16
422 ; ALL-NEXT: [[R:%.*]] = insertelement <8 x i16> [[V:%.*]], i16 [[T]], i64 3
423 ; ALL-NEXT: ret <8 x i16> [[R]]
426 %t = trunc i64 %s to i16
427 %r = insertelement <8 x i16> %v, i16 %t, i64 3
431 define <8 x i16> @lshr_longer_length_basevec_be(i64 %x, <8 x i16> %v) {
432 ; ALL-LABEL: @lshr_longer_length_basevec_be(
433 ; ALL-NEXT: [[S:%.*]] = lshr i64 [[X:%.*]], 32
434 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[S]] to i16
435 ; ALL-NEXT: [[R:%.*]] = insertelement <8 x i16> [[V:%.*]], i16 [[T]], i64 1
436 ; ALL-NEXT: ret <8 x i16> [[R]]
439 %t = trunc i64 %s to i16
440 %r = insertelement <8 x i16> %v, i16 %t, i64 1
444 define <8 x i16> @lshr_wrong_index_longer_length_basevec(i64 %x, <8 x i16> %v) {
445 ; ALL-LABEL: @lshr_wrong_index_longer_length_basevec(
446 ; ALL-NEXT: [[S:%.*]] = lshr i64 [[X:%.*]], 16
447 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[S]] to i16
448 ; ALL-NEXT: [[R:%.*]] = insertelement <8 x i16> [[V:%.*]], i16 [[T]], i64 6
449 ; ALL-NEXT: ret <8 x i16> [[R]]
452 %t = trunc i64 %s to i16
453 %r = insertelement <8 x i16> %v, i16 %t, i64 6
457 define <2 x i16> @lshr_shorter_length_basevec_le(i64 %x, <2 x i16> %v) {
458 ; ALL-LABEL: @lshr_shorter_length_basevec_le(
459 ; ALL-NEXT: [[S:%.*]] = lshr i64 [[X:%.*]], 16
460 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[S]] to i16
461 ; ALL-NEXT: [[R:%.*]] = insertelement <2 x i16> [[V:%.*]], i16 [[T]], i64 1
462 ; ALL-NEXT: ret <2 x i16> [[R]]
465 %t = trunc i64 %s to i16
466 %r = insertelement <2 x i16> %v, i16 %t, i64 1
470 define <4 x i8> @lshr_shorter_length_basevec_be(i64 %x, <4 x i8> %v) {
471 ; ALL-LABEL: @lshr_shorter_length_basevec_be(
472 ; ALL-NEXT: [[S:%.*]] = lshr i64 [[X:%.*]], 48
473 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[S]] to i8
474 ; ALL-NEXT: [[R:%.*]] = insertelement <4 x i8> [[V:%.*]], i8 [[T]], i64 1
475 ; ALL-NEXT: ret <4 x i8> [[R]]
478 %t = trunc i64 %s to i8
479 %r = insertelement <4 x i8> %v, i8 %t, i64 1
483 define <4 x i8> @lshr_wrong_index_shorter_length_basevec(i64 %x, <4 x i8> %v) {
484 ; ALL-LABEL: @lshr_wrong_index_shorter_length_basevec(
485 ; ALL-NEXT: [[S:%.*]] = lshr i64 [[X:%.*]], 40
486 ; ALL-NEXT: [[T:%.*]] = trunc i64 [[S]] to i8
487 ; ALL-NEXT: [[R:%.*]] = insertelement <4 x i8> [[V:%.*]], i8 [[T]], i64 3
488 ; ALL-NEXT: ret <4 x i8> [[R]]
491 %t = trunc i64 %s to i8
492 %r = insertelement <4 x i8> %v, i8 %t, i64 3