1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple aarch64 -run-pass=loadstore-opt -verify-machineinstrs %s -o - | FileCheck %s
6 tracksRegLiveness: true
14 ; CHECK-LABEL: name: trunc_i16_to_i8
15 ; CHECK: liveins: $w0, $x1
17 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
18 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
19 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
20 ; CHECK-NEXT: G_STORE [[TRUNC]](s16), [[COPY1]](p0) :: (store (s16), align 1)
21 ; CHECK-NEXT: RET_ReallyLR
23 %0:_(s16) = G_TRUNC %2(s32)
25 %4:_(s16) = G_CONSTANT i16 8
26 %3:_(s8) = G_TRUNC %0(s16)
27 %5:_(s16) = G_LSHR %0, %4(s16)
28 %6:_(s8) = G_TRUNC %5(s16)
29 G_STORE %3(s8), %1(p0) :: (store (s8))
30 %7:_(s64) = G_CONSTANT i64 1
31 %8:_(p0) = G_PTR_ADD %1, %7(s64)
32 G_STORE %6(s8), %8(p0) :: (store (s8))
39 tracksRegLiveness: true
47 ; CHECK-LABEL: name: trunc_i32_to_i8
48 ; CHECK: liveins: $w0, $x1
50 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
51 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
52 ; CHECK-NEXT: G_STORE [[COPY]](s32), [[COPY1]](p0) :: (store (s32), align 1)
53 ; CHECK-NEXT: RET_ReallyLR
56 %3:_(s32) = G_CONSTANT i32 8
57 %6:_(s32) = G_CONSTANT i32 16
58 %9:_(s32) = G_CONSTANT i32 24
59 %2:_(s8) = G_TRUNC %0(s32)
60 %4:_(s32) = G_LSHR %0, %3(s32)
61 %5:_(s8) = G_TRUNC %4(s32)
62 %7:_(s32) = G_LSHR %0, %6(s32)
63 %8:_(s8) = G_TRUNC %7(s32)
64 %10:_(s32) = G_LSHR %0, %9(s32)
65 %11:_(s8) = G_TRUNC %10(s32)
66 G_STORE %2(s8), %1(p0) :: (store (s8))
67 %12:_(s64) = G_CONSTANT i64 1
68 %13:_(p0) = G_PTR_ADD %1, %12(s64)
69 G_STORE %5(s8), %13(p0) :: (store (s8))
70 %14:_(s64) = G_CONSTANT i64 2
71 %15:_(p0) = G_PTR_ADD %1, %14(s64)
72 G_STORE %8(s8), %15(p0) :: (store (s8))
73 %16:_(s64) = G_CONSTANT i64 3
74 %17:_(p0) = G_PTR_ADD %1, %16(s64)
75 G_STORE %11(s8), %17(p0) :: (store (s8))
80 name: trunc_i32_to_i16
82 tracksRegLiveness: true
90 ; CHECK-LABEL: name: trunc_i32_to_i16
91 ; CHECK: liveins: $w0, $x1
93 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
94 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
95 ; CHECK-NEXT: G_STORE [[COPY]](s32), [[COPY1]](p0) :: (store (s32), align 2)
96 ; CHECK-NEXT: RET_ReallyLR
99 %3:_(s32) = G_CONSTANT i32 16
100 %2:_(s16) = G_TRUNC %0(s32)
101 %4:_(s32) = G_LSHR %0, %3(s32)
102 %5:_(s16) = G_TRUNC %4(s32)
103 G_STORE %2(s16), %1(p0) :: (store (s16))
104 %6:_(s64) = G_CONSTANT i64 2
105 %7:_(p0) = G_PTR_ADD %1, %6(s64)
106 G_STORE %5(s16), %7(p0) :: (store (s16))
113 tracksRegLiveness: true
121 ; CHECK-LABEL: name: be_i32_to_i16
122 ; CHECK: liveins: $w0, $x1
124 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
125 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
126 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
127 ; CHECK-NEXT: [[ROTR:%[0-9]+]]:_(s32) = G_ROTR [[COPY]], [[C]](s32)
128 ; CHECK-NEXT: G_STORE [[ROTR]](s32), [[COPY1]](p0) :: (store (s32), align 2)
129 ; CHECK-NEXT: RET_ReallyLR
132 %2:_(s32) = G_CONSTANT i32 16
133 %3:_(s32) = G_LSHR %0, %2(s32)
134 %4:_(s16) = G_TRUNC %0(s32)
135 %5:_(s16) = G_TRUNC %3(s32)
136 %6:_(s64) = G_CONSTANT i64 2
137 %7:_(p0) = G_PTR_ADD %1, %6(s64)
138 G_STORE %4(s16), %7(p0) :: (store (s16))
139 G_STORE %5(s16), %1(p0) :: (store (s16))
144 name: be_i32_to_i16_order
146 tracksRegLiveness: true
154 ; CHECK-LABEL: name: be_i32_to_i16_order
155 ; CHECK: liveins: $w0, $x1
157 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
158 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
159 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
160 ; CHECK-NEXT: [[ROTR:%[0-9]+]]:_(s32) = G_ROTR [[COPY]], [[C]](s32)
161 ; CHECK-NEXT: G_STORE [[ROTR]](s32), [[COPY1]](p0) :: (store (s32), align 2)
162 ; CHECK-NEXT: RET_ReallyLR
165 %2:_(s32) = G_CONSTANT i32 16
166 %3:_(s32) = G_LSHR %0, %2(s32)
167 %4:_(s16) = G_TRUNC %0(s32)
168 %5:_(s16) = G_TRUNC %3(s32)
169 %6:_(s64) = G_CONSTANT i64 2
170 %7:_(p0) = G_PTR_ADD %1, %6(s64)
171 G_STORE %5(s16), %1(p0) :: (store (s16))
172 G_STORE %4(s16), %7(p0) :: (store (s16))
177 name: trunc_i64_to_i8
179 tracksRegLiveness: true
187 ; CHECK-LABEL: name: trunc_i64_to_i8
188 ; CHECK: liveins: $x0, $x1
190 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
191 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
192 ; CHECK-NEXT: G_STORE [[COPY]](s64), [[COPY1]](p0) :: (store (s64), align 1)
193 ; CHECK-NEXT: RET_ReallyLR
196 %3:_(s64) = G_CONSTANT i64 8
197 %6:_(s64) = G_CONSTANT i64 16
198 %9:_(s64) = G_CONSTANT i64 24
199 %12:_(s64) = G_CONSTANT i64 32
200 %15:_(s64) = G_CONSTANT i64 40
201 %18:_(s64) = G_CONSTANT i64 48
202 %21:_(s64) = G_CONSTANT i64 56
203 %2:_(s8) = G_TRUNC %0(s64)
204 %4:_(s64) = G_LSHR %0, %3(s64)
205 %5:_(s8) = G_TRUNC %4(s64)
206 %7:_(s64) = G_LSHR %0, %6(s64)
207 %8:_(s8) = G_TRUNC %7(s64)
208 %10:_(s64) = G_LSHR %0, %9(s64)
209 %11:_(s8) = G_TRUNC %10(s64)
210 %13:_(s64) = G_LSHR %0, %12(s64)
211 %14:_(s8) = G_TRUNC %13(s64)
212 %16:_(s64) = G_LSHR %0, %15(s64)
213 %17:_(s8) = G_TRUNC %16(s64)
214 %19:_(s64) = G_LSHR %0, %18(s64)
215 %20:_(s8) = G_TRUNC %19(s64)
216 %22:_(s64) = G_LSHR %0, %21(s64)
217 %23:_(s8) = G_TRUNC %22(s64)
218 G_STORE %2(s8), %1(p0) :: (store (s8))
219 %24:_(s64) = G_CONSTANT i64 1
220 %25:_(p0) = G_PTR_ADD %1, %24(s64)
221 G_STORE %5(s8), %25(p0) :: (store (s8))
222 %26:_(s64) = G_CONSTANT i64 2
223 %27:_(p0) = G_PTR_ADD %1, %26(s64)
224 G_STORE %8(s8), %27(p0) :: (store (s8))
225 %28:_(s64) = G_CONSTANT i64 3
226 %29:_(p0) = G_PTR_ADD %1, %28(s64)
227 G_STORE %11(s8), %29(p0) :: (store (s8))
228 %30:_(s64) = G_CONSTANT i64 4
229 %31:_(p0) = G_PTR_ADD %1, %30(s64)
230 G_STORE %14(s8), %31(p0) :: (store (s8))
231 %32:_(s64) = G_CONSTANT i64 5
232 %33:_(p0) = G_PTR_ADD %1, %32(s64)
233 G_STORE %17(s8), %33(p0) :: (store (s8))
234 %34:_(s64) = G_CONSTANT i64 6
235 %35:_(p0) = G_PTR_ADD %1, %34(s64)
236 G_STORE %20(s8), %35(p0) :: (store (s8))
237 %36:_(s64) = G_CONSTANT i64 7
238 %37:_(p0) = G_PTR_ADD %1, %36(s64)
239 G_STORE %23(s8), %37(p0) :: (store (s8))
244 name: trunc_i64_to_i16
246 tracksRegLiveness: true
254 ; CHECK-LABEL: name: trunc_i64_to_i16
255 ; CHECK: liveins: $x0, $x1
257 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
258 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
259 ; CHECK-NEXT: G_STORE [[COPY]](s64), [[COPY1]](p0) :: (store (s64), align 2)
260 ; CHECK-NEXT: RET_ReallyLR
263 %3:_(s64) = G_CONSTANT i64 16
264 %6:_(s64) = G_CONSTANT i64 32
265 %9:_(s64) = G_CONSTANT i64 48
266 %2:_(s16) = G_TRUNC %0(s64)
267 %4:_(s64) = G_LSHR %0, %3(s64)
268 %5:_(s16) = G_TRUNC %4(s64)
269 %7:_(s64) = G_LSHR %0, %6(s64)
270 %8:_(s16) = G_TRUNC %7(s64)
271 %10:_(s64) = G_LSHR %0, %9(s64)
272 %11:_(s16) = G_TRUNC %10(s64)
273 G_STORE %2(s16), %1(p0) :: (store (s16))
274 %12:_(s64) = G_CONSTANT i64 2
275 %13:_(p0) = G_PTR_ADD %1, %12(s64)
276 G_STORE %5(s16), %13(p0) :: (store (s16))
277 %14:_(s64) = G_CONSTANT i64 4
278 %15:_(p0) = G_PTR_ADD %1, %14(s64)
279 G_STORE %8(s16), %15(p0) :: (store (s16))
280 %16:_(s64) = G_CONSTANT i64 6
281 %17:_(p0) = G_PTR_ADD %1, %16(s64)
282 G_STORE %11(s16), %17(p0) :: (store (s16))
287 name: trunc_i64_to_i32
289 tracksRegLiveness: true
297 ; CHECK-LABEL: name: trunc_i64_to_i32
298 ; CHECK: liveins: $x0, $x1
300 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
301 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
302 ; CHECK-NEXT: G_STORE [[COPY]](s64), [[COPY1]](p0) :: (store (s64), align 4)
303 ; CHECK-NEXT: RET_ReallyLR
306 %3:_(s64) = G_CONSTANT i64 32
307 %2:_(s32) = G_TRUNC %0(s64)
308 %4:_(s64) = G_LSHR %0, %3(s64)
309 %5:_(s32) = G_TRUNC %4(s64)
310 G_STORE %2(s32), %1(p0) :: (store (s32))
311 %6:_(s64) = G_CONSTANT i64 4
312 %7:_(p0) = G_PTR_ADD %1, %6(s64)
313 G_STORE %5(s32), %7(p0) :: (store (s32))
320 tracksRegLiveness: true
328 ; CHECK-LABEL: name: be_i64_to_i32
329 ; CHECK: liveins: $x0, $x1
331 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
332 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
333 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 32
334 ; CHECK-NEXT: [[ROTR:%[0-9]+]]:_(s64) = G_ROTR [[COPY]], [[C]](s64)
335 ; CHECK-NEXT: G_STORE [[ROTR]](s64), [[COPY1]](p0) :: (store (s64), align 4)
336 ; CHECK-NEXT: RET_ReallyLR
339 %2:_(s64) = G_CONSTANT i64 32
340 %3:_(s64) = G_LSHR %0, %2(s64)
341 %4:_(s32) = G_TRUNC %0(s64)
342 %5:_(s32) = G_TRUNC %3(s64)
343 %6:_(s64) = G_CONSTANT i64 4
344 %7:_(p0) = G_PTR_ADD %1, %6(s64)
345 G_STORE %4(s32), %7(p0) :: (store (s32))
346 G_STORE %5(s32), %1(p0) :: (store (s32))
351 name: be_i64_to_i32_order
353 tracksRegLiveness: true
361 ; CHECK-LABEL: name: be_i64_to_i32_order
362 ; CHECK: liveins: $x0, $x1
364 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
365 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
366 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 32
367 ; CHECK-NEXT: [[ROTR:%[0-9]+]]:_(s64) = G_ROTR [[COPY]], [[C]](s64)
368 ; CHECK-NEXT: G_STORE [[ROTR]](s64), [[COPY1]](p0) :: (store (s64), align 4)
369 ; CHECK-NEXT: RET_ReallyLR
372 %2:_(s64) = G_CONSTANT i64 32
373 %3:_(s64) = G_LSHR %0, %2(s64)
374 %4:_(s32) = G_TRUNC %0(s64)
375 %5:_(s32) = G_TRUNC %3(s64)
376 %6:_(s64) = G_CONSTANT i64 4
377 %7:_(p0) = G_PTR_ADD %1, %6(s64)
378 G_STORE %5(s32), %1(p0) :: (store (s32))
379 G_STORE %4(s32), %7(p0) :: (store (s32))
386 tracksRegLiveness: true
394 ; CHECK-LABEL: name: merge_hole
395 ; CHECK: liveins: $w0, $x1
397 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
398 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
399 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
400 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
401 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY1]], [[C1]](s64)
402 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32)
403 ; CHECK-NEXT: G_STORE [[TRUNC]](s8), [[COPY1]](p0) :: (store (s8))
404 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
405 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s32)
406 ; CHECK-NEXT: G_STORE [[TRUNC1]](s16), [[PTR_ADD]](p0) :: (store (s16), align 1)
407 ; CHECK-NEXT: RET_ReallyLR
410 %5:_(s32) = G_CONSTANT i32 16
411 %2:_(s64) = G_CONSTANT i64 2
412 %3:_(p0) = G_PTR_ADD %1, %2(s64)
413 %4:_(s8) = G_TRUNC %0(s32)
414 G_STORE %4(s8), %1(p0) :: (store (s8))
415 %6:_(s32) = G_LSHR %0, %5(s32)
416 %7:_(s16) = G_TRUNC %6(s32)
417 G_STORE %7(s16), %3(p0) :: (store (s16), align 1)
424 tracksRegLiveness: true
432 ; CHECK-LABEL: name: merge_hole2
433 ; CHECK: liveins: $w0, $x1
435 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
436 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
437 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
438 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
439 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY1]], [[C1]](s64)
440 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
441 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s32)
442 ; CHECK-NEXT: G_STORE [[TRUNC]](s16), [[PTR_ADD]](p0) :: (store (s16), align 1)
443 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32)
444 ; CHECK-NEXT: G_STORE [[TRUNC1]](s8), [[COPY1]](p0) :: (store (s8))
445 ; CHECK-NEXT: RET_ReallyLR
448 %4:_(s32) = G_CONSTANT i32 16
449 %2:_(s64) = G_CONSTANT i64 2
450 %3:_(p0) = G_PTR_ADD %1, %2(s64)
451 %5:_(s32) = G_LSHR %0, %4(s32)
452 %6:_(s16) = G_TRUNC %5(s32)
453 G_STORE %6(s16), %3(p0) :: (store (s16), align 1)
454 %7:_(s8) = G_TRUNC %0(s32)
455 G_STORE %7(s8), %1(p0) :: (store (s8))
462 tracksRegLiveness: true
470 ; CHECK-LABEL: name: merge_hole3
471 ; CHECK: liveins: $w0, $x1
473 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
474 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
475 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
476 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
477 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY1]], [[C1]](s64)
478 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
479 ; CHECK-NEXT: [[PTR_ADD1:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY1]], [[C2]](s64)
480 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32)
481 ; CHECK-NEXT: G_STORE [[TRUNC]](s8), [[PTR_ADD]](p0) :: (store (s8))
482 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
483 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s32)
484 ; CHECK-NEXT: G_STORE [[TRUNC1]](s16), [[PTR_ADD1]](p0) :: (store (s16), align 1)
485 ; CHECK-NEXT: RET_ReallyLR
488 %7:_(s32) = G_CONSTANT i32 16
489 %2:_(s64) = G_CONSTANT i64 1
490 %3:_(p0) = G_PTR_ADD %1, %2(s64)
491 %4:_(s64) = G_CONSTANT i64 2
492 %5:_(p0) = G_PTR_ADD %1, %4(s64)
493 %6:_(s8) = G_TRUNC %0(s32)
494 G_STORE %6(s8), %3(p0) :: (store (s8))
495 %8:_(s32) = G_LSHR %0, %7(s32)
496 %9:_(s16) = G_TRUNC %8(s32)
497 G_STORE %9(s16), %5(p0) :: (store (s16), align 1)
504 tracksRegLiveness: true
512 ; CHECK-LABEL: name: merge_hole4
513 ; CHECK: liveins: $w0, $x1
515 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
516 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
517 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
518 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
519 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY1]], [[C1]](s64)
520 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32)
521 ; CHECK-NEXT: G_STORE [[TRUNC]](s8), [[PTR_ADD]](p0) :: (store (s8))
522 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
523 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s32)
524 ; CHECK-NEXT: G_STORE [[TRUNC1]](s16), [[COPY1]](p0) :: (store (s16), align 1)
525 ; CHECK-NEXT: RET_ReallyLR
528 %5:_(s32) = G_CONSTANT i32 16
529 %2:_(s64) = G_CONSTANT i64 2
530 %3:_(p0) = G_PTR_ADD %1, %2(s64)
531 %4:_(s8) = G_TRUNC %0(s32)
532 G_STORE %4(s8), %3(p0) :: (store (s8))
533 %6:_(s32) = G_LSHR %0, %5(s32)
534 %7:_(s16) = G_TRUNC %6(s32)
535 G_STORE %7(s16), %1(p0) :: (store (s16), align 1)
540 name: load_between_stores
542 tracksRegLiveness: true
549 liveins: $w0, $x1, $x2
551 ; CHECK-LABEL: name: load_between_stores
552 ; CHECK: liveins: $w0, $x1, $x2
554 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
555 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
556 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(p0) = COPY $x2
557 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
558 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
559 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
560 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s32)
561 ; CHECK-NEXT: G_STORE [[TRUNC]](s16), [[COPY1]](p0) :: (store (s16))
562 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY2]](p0) :: (load (s32))
563 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
564 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY1]], [[C1]](s64)
565 ; CHECK-NEXT: G_STORE [[TRUNC1]](s16), [[PTR_ADD]](p0) :: (store (s16))
566 ; CHECK-NEXT: $w0 = COPY [[LOAD]](s32)
567 ; CHECK-NEXT: RET_ReallyLR implicit $w0
571 %4:_(s32) = G_CONSTANT i32 16
572 %3:_(s16) = G_TRUNC %0(s32)
573 %5:_(s32) = G_LSHR %0, %4(s32)
574 %6:_(s16) = G_TRUNC %5(s32)
575 G_STORE %3(s16), %1(p0) :: (store (s16))
576 %7:_(s32) = G_LOAD %2(p0) :: (load (s32))
577 %8:_(s64) = G_CONSTANT i64 2
578 %9:_(p0) = G_PTR_ADD %1, %8(s64)
579 G_STORE %6(s16), %9(p0) :: (store (s16))
581 RET_ReallyLR implicit $w0
587 tracksRegLiveness: true
595 ; CHECK-LABEL: name: invalid_shift
596 ; CHECK: liveins: $w0, $x1
598 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
599 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
600 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
601 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 4
602 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC]](s16)
603 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s16) = G_LSHR [[TRUNC]], [[C]](s16)
604 ; CHECK-NEXT: [[TRUNC2:%[0-9]+]]:_(s8) = G_TRUNC [[LSHR]](s16)
605 ; CHECK-NEXT: G_STORE [[TRUNC1]](s8), [[COPY1]](p0) :: (store (s8))
606 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
607 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY1]], [[C1]](s64)
608 ; CHECK-NEXT: G_STORE [[TRUNC2]](s8), [[PTR_ADD]](p0) :: (store (s8))
609 ; CHECK-NEXT: RET_ReallyLR
611 %0:_(s16) = G_TRUNC %2(s32)
613 %4:_(s16) = G_CONSTANT i16 4
614 %3:_(s8) = G_TRUNC %0(s16)
615 %5:_(s16) = G_LSHR %0, %4(s16)
616 %6:_(s8) = G_TRUNC %5(s16)
617 G_STORE %3(s8), %1(p0) :: (store (s8))
618 %7:_(s64) = G_CONSTANT i64 1
619 %8:_(p0) = G_PTR_ADD %1, %7(s64)
620 G_STORE %6(s8), %8(p0) :: (store (s8))
627 tracksRegLiveness: true
635 ; CHECK-LABEL: name: missing_store
636 ; CHECK: liveins: $w0, $x1
638 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
639 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
640 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
641 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
642 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[LSHR]](s32)
643 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
644 ; CHECK-NEXT: G_STORE [[TRUNC1]](s16), [[COPY1]](p0) :: (store (s16), align 1)
645 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 3
646 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY1]], [[C1]](s64)
647 ; CHECK-NEXT: G_STORE [[TRUNC]](s8), [[PTR_ADD]](p0) :: (store (s8))
648 ; CHECK-NEXT: RET_ReallyLR
651 %3:_(s32) = G_CONSTANT i32 8
652 %6:_(s32) = G_CONSTANT i32 24
653 %2:_(s8) = G_TRUNC %0(s32)
654 %4:_(s32) = G_LSHR %0, %3(s32)
655 %5:_(s8) = G_TRUNC %4(s32)
656 %7:_(s32) = G_LSHR %0, %6(s32)
657 %8:_(s8) = G_TRUNC %7(s32)
658 G_STORE %2(s8), %1(p0) :: (store (s8))
659 %9:_(s64) = G_CONSTANT i64 1
660 %10:_(p0) = G_PTR_ADD %1, %9(s64)
661 G_STORE %5(s8), %10(p0) :: (store (s8))
662 %11:_(s64) = G_CONSTANT i64 3
663 %12:_(p0) = G_PTR_ADD %1, %11(s64)
664 G_STORE %8(s8), %12(p0) :: (store (s8))
669 name: different_base_reg
671 tracksRegLiveness: true
678 liveins: $w0, $x1, $x2
680 ; CHECK-LABEL: name: different_base_reg
681 ; CHECK: liveins: $w0, $x1, $x2
683 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
684 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
685 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
686 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(p0) = COPY $x2
687 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 8
688 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC]](s16)
689 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s16) = G_LSHR [[TRUNC]], [[C]](s16)
690 ; CHECK-NEXT: [[TRUNC2:%[0-9]+]]:_(s8) = G_TRUNC [[LSHR]](s16)
691 ; CHECK-NEXT: G_STORE [[TRUNC1]](s8), [[COPY1]](p0) :: (store (s8))
692 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
693 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY2]], [[C1]](s64)
694 ; CHECK-NEXT: G_STORE [[TRUNC2]](s8), [[PTR_ADD]](p0) :: (store (s8))
695 ; CHECK-NEXT: RET_ReallyLR
697 %0:_(s16) = G_TRUNC %3(s32)
700 %5:_(s16) = G_CONSTANT i16 8
701 %4:_(s8) = G_TRUNC %0(s16)
702 %6:_(s16) = G_LSHR %0, %5(s16)
703 %7:_(s8) = G_TRUNC %6(s16)
704 G_STORE %4(s8), %1(p0) :: (store (s8))
705 %8:_(s64) = G_CONSTANT i64 1
706 %9:_(p0) = G_PTR_ADD %2, %8(s64)
707 G_STORE %7(s8), %9(p0) :: (store (s8))
712 name: second_store_is_volatile
714 tracksRegLiveness: true
722 ; CHECK-LABEL: name: second_store_is_volatile
723 ; CHECK: liveins: $w0, $x1
725 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
726 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
727 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
728 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 8
729 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[TRUNC]](s16)
730 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s16) = G_LSHR [[TRUNC]], [[C]](s16)
731 ; CHECK-NEXT: [[TRUNC2:%[0-9]+]]:_(s8) = G_TRUNC [[LSHR]](s16)
732 ; CHECK-NEXT: G_STORE [[TRUNC1]](s8), [[COPY1]](p0) :: (volatile store (s8))
733 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
734 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY1]], [[C1]](s64)
735 ; CHECK-NEXT: G_STORE [[TRUNC2]](s8), [[PTR_ADD]](p0) :: (store (s8))
736 ; CHECK-NEXT: RET_ReallyLR
738 %0:_(s16) = G_TRUNC %2(s32)
740 %4:_(s16) = G_CONSTANT i16 8
741 %3:_(s8) = G_TRUNC %0(s16)
742 %5:_(s16) = G_LSHR %0, %4(s16)
743 %6:_(s8) = G_TRUNC %5(s16)
744 G_STORE %3(s8), %1(p0) :: (volatile store (s8))
745 %7:_(s64) = G_CONSTANT i64 1
746 %8:_(p0) = G_PTR_ADD %1, %7(s64)
747 G_STORE %6(s8), %8(p0) :: (store (s8))
752 name: wide_not_multiple_of_mem_ty
754 tracksRegLiveness: true
762 ; CHECK-LABEL: name: wide_not_multiple_of_mem_ty
763 ; CHECK: liveins: $x0, $x1
765 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
766 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s48) = G_TRUNC [[COPY]](s64)
767 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
768 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 32
769 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s48) = G_LSHR [[TRUNC]], [[C]](s64)
770 ; CHECK-NEXT: %trunc:_(s32) = G_TRUNC [[LSHR]](s48)
771 ; CHECK-NEXT: G_STORE %trunc(s32), [[COPY1]](p0) :: (store (s32))
772 ; CHECK-NEXT: RET_ReallyLR
774 %0:_(s48) = G_TRUNC %2(s64)
776 %4:_(s64) = G_CONSTANT i64 32
777 %5:_(s48) = G_LSHR %0, %4(s64)
778 %trunc:_(s32) = G_TRUNC %5(s48)
779 G_STORE %trunc(s32), %1(p0) :: (store (s32))