1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-- -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
5 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
7 define void @store_s64_gpr(i64* %addr) { ret void }
8 define void @store_s32_gpr(i32* %addr) { ret void }
9 define void @store_s16_gpr(i16* %addr) { ret void }
10 define void @store_s8_gpr(i8* %addr) { ret void }
12 define void @store_zero_s64_gpr(i64* %addr) { ret void }
13 define void @store_zero_s32_gpr(i32* %addr) { ret void }
15 define void @store_fi_s64_gpr() {
20 define void @store_gep_128_s64_gpr(i64* %addr) { ret void }
21 define void @store_gep_512_s32_gpr(i32* %addr) { ret void }
22 define void @store_gep_64_s16_gpr(i16* %addr) { ret void }
23 define void @store_gep_1_s8_gpr(i8* %addr) { ret void }
25 define void @store_s64_fpr(i64* %addr) { ret void }
26 define void @store_s32_fpr(i32* %addr) { ret void }
28 define void @store_gep_8_s64_fpr(i64* %addr) { ret void }
29 define void @store_gep_8_s32_fpr(i32* %addr) { ret void }
31 define void @store_v2s32(i64 *%addr) { ret void }
32 define void @store_v2s64(i64 *%addr) { ret void }
34 define void @store_4xi16(<4 x i16> %v, <4 x i16>* %ptr) { ret void }
35 define void @store_4xi32(<4 x i32> %v, <4 x i32>* %ptr) { ret void }
36 define void @store_8xi16(<8 x i16> %v, <8 x i16>* %ptr) { ret void }
37 define void @store_16xi8(<16 x i8> %v, <16 x i8>* %ptr) { ret void }
47 - { id: 0, class: gpr }
48 - { id: 1, class: gpr }
54 ; CHECK-LABEL: name: store_s64_gpr
55 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
56 ; CHECK: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
57 ; CHECK: STRXui [[COPY1]], [[COPY]], 0 :: (store 8 into %ir.addr)
60 G_STORE %1, %0 :: (store 8 into %ir.addr)
70 - { id: 0, class: gpr }
71 - { id: 1, class: gpr }
77 ; CHECK-LABEL: name: store_s32_gpr
78 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
79 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
80 ; CHECK: STRWui [[COPY1]], [[COPY]], 0 :: (store 4 into %ir.addr)
83 G_STORE %1, %0 :: (store 4 into %ir.addr)
93 - { id: 0, class: gpr }
94 - { id: 1, class: gpr }
100 ; CHECK-LABEL: name: store_s16_gpr
101 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
102 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
103 ; CHECK: STRHHui [[COPY1]], [[COPY]], 0 :: (store 2 into %ir.addr)
105 %2:gpr(s32) = COPY $w1
107 G_STORE %1, %0 :: (store 2 into %ir.addr)
114 regBankSelected: true
117 - { id: 0, class: gpr }
118 - { id: 1, class: gpr }
124 ; CHECK-LABEL: name: store_s8_gpr
125 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
126 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
127 ; CHECK: STRBBui [[COPY1]], [[COPY]], 0 :: (store 1 into %ir.addr)
129 %2:gpr(s32) = COPY $w1
131 G_STORE %1, %0 :: (store 1 into %ir.addr)
136 name: store_zero_s64_gpr
138 regBankSelected: true
141 - { id: 0, class: gpr }
142 - { id: 1, class: gpr }
148 ; CHECK-LABEL: name: store_zero_s64_gpr
149 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
150 ; CHECK: STRXui $xzr, [[COPY]], 0 :: (store 8 into %ir.addr)
152 %1(s64) = G_CONSTANT i64 0
153 G_STORE %1, %0 :: (store 8 into %ir.addr)
158 name: store_zero_s32_gpr
160 regBankSelected: true
163 - { id: 0, class: gpr }
164 - { id: 1, class: gpr }
170 ; CHECK-LABEL: name: store_zero_s32_gpr
171 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
172 ; CHECK: STRWui $wzr, [[COPY]], 0 :: (store 4 into %ir.addr)
174 %1(s32) = G_CONSTANT i32 0
175 G_STORE %1, %0 :: (store 4 into %ir.addr)
180 name: store_fi_s64_gpr
182 regBankSelected: true
185 - { id: 0, class: gpr }
186 - { id: 1, class: gpr }
189 - { id: 0, name: ptr0, offset: 0, size: 8, alignment: 8 }
195 ; CHECK-LABEL: name: store_fi_s64_gpr
196 ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
197 ; CHECK: STRXui [[COPY]], %stack.0.ptr0, 0 :: (store 8)
199 %1(p0) = G_FRAME_INDEX %stack.0.ptr0
200 G_STORE %0, %1 :: (store 8)
204 name: store_gep_128_s64_gpr
206 regBankSelected: true
209 - { id: 0, class: gpr }
210 - { id: 1, class: gpr }
211 - { id: 2, class: gpr }
212 - { id: 3, class: gpr }
218 ; CHECK-LABEL: name: store_gep_128_s64_gpr
219 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
220 ; CHECK: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
221 ; CHECK: STRXui [[COPY1]], [[COPY]], 16 :: (store 8 into %ir.addr)
224 %2(s64) = G_CONSTANT i64 128
225 %3(p0) = G_GEP %0, %2
226 G_STORE %1, %3 :: (store 8 into %ir.addr)
230 name: store_gep_512_s32_gpr
232 regBankSelected: true
235 - { id: 0, class: gpr }
236 - { id: 1, class: gpr }
237 - { id: 2, class: gpr }
238 - { id: 3, class: gpr }
244 ; CHECK-LABEL: name: store_gep_512_s32_gpr
245 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
246 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
247 ; CHECK: STRWui [[COPY1]], [[COPY]], 128 :: (store 4 into %ir.addr)
250 %2(s64) = G_CONSTANT i64 512
251 %3(p0) = G_GEP %0, %2
252 G_STORE %1, %3 :: (store 4 into %ir.addr)
256 name: store_gep_64_s16_gpr
258 regBankSelected: true
261 - { id: 0, class: gpr }
262 - { id: 1, class: gpr }
263 - { id: 2, class: gpr }
264 - { id: 3, class: gpr }
270 ; CHECK-LABEL: name: store_gep_64_s16_gpr
271 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
272 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
273 ; CHECK: STRHHui [[COPY1]], [[COPY]], 32 :: (store 2 into %ir.addr)
275 %4:gpr(s32) = COPY $w1
277 %2(s64) = G_CONSTANT i64 64
278 %3(p0) = G_GEP %0, %2
279 G_STORE %1, %3 :: (store 2 into %ir.addr)
283 name: store_gep_1_s8_gpr
285 regBankSelected: true
288 - { id: 0, class: gpr }
289 - { id: 1, class: gpr }
290 - { id: 2, class: gpr }
291 - { id: 3, class: gpr }
297 ; CHECK-LABEL: name: store_gep_1_s8_gpr
298 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
299 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
300 ; CHECK: STRBBui [[COPY1]], [[COPY]], 1 :: (store 1 into %ir.addr)
302 %4:gpr(s32) = COPY $w1
304 %2(s64) = G_CONSTANT i64 1
305 %3(p0) = G_GEP %0, %2
306 G_STORE %1, %3 :: (store 1 into %ir.addr)
312 regBankSelected: true
315 - { id: 0, class: gpr }
316 - { id: 1, class: fpr }
322 ; CHECK-LABEL: name: store_s64_fpr
323 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
324 ; CHECK: [[COPY1:%[0-9]+]]:fpr64 = COPY $d1
325 ; CHECK: STRDui [[COPY1]], [[COPY]], 0 :: (store 8 into %ir.addr)
328 G_STORE %1, %0 :: (store 8 into %ir.addr)
335 regBankSelected: true
338 - { id: 0, class: gpr }
339 - { id: 1, class: fpr }
345 ; CHECK-LABEL: name: store_s32_fpr
346 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
347 ; CHECK: [[COPY1:%[0-9]+]]:fpr32 = COPY $s1
348 ; CHECK: STRSui [[COPY1]], [[COPY]], 0 :: (store 4 into %ir.addr)
351 G_STORE %1, %0 :: (store 4 into %ir.addr)
356 name: store_gep_8_s64_fpr
358 regBankSelected: true
361 - { id: 0, class: gpr }
362 - { id: 1, class: fpr }
363 - { id: 2, class: gpr }
364 - { id: 3, class: gpr }
370 ; CHECK-LABEL: name: store_gep_8_s64_fpr
371 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
372 ; CHECK: [[COPY1:%[0-9]+]]:fpr64 = COPY $d1
373 ; CHECK: STRDui [[COPY1]], [[COPY]], 1 :: (store 8 into %ir.addr)
376 %2(s64) = G_CONSTANT i64 8
377 %3(p0) = G_GEP %0, %2
378 G_STORE %1, %3 :: (store 8 into %ir.addr)
382 name: store_gep_8_s32_fpr
384 regBankSelected: true
387 - { id: 0, class: gpr }
388 - { id: 1, class: fpr }
389 - { id: 2, class: gpr }
390 - { id: 3, class: gpr }
396 ; CHECK-LABEL: name: store_gep_8_s32_fpr
397 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
398 ; CHECK: [[COPY1:%[0-9]+]]:fpr32 = COPY $s1
399 ; CHECK: STRSui [[COPY1]], [[COPY]], 2 :: (store 4 into %ir.addr)
402 %2(s64) = G_CONSTANT i64 8
403 %3(p0) = G_GEP %0, %2
404 G_STORE %1, %3 :: (store 4 into %ir.addr)
409 regBankSelected: true
412 - { id: 0, class: gpr }
413 - { id: 1, class: fpr }
419 ; CHECK-LABEL: name: store_v2s32
420 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
421 ; CHECK: [[COPY1:%[0-9]+]]:fpr64 = COPY $d1
422 ; CHECK: STRDui [[COPY1]], [[COPY]], 0 :: (store 8 into %ir.addr)
424 %1(<2 x s32>) = COPY $d1
425 G_STORE %1, %0 :: (store 8 into %ir.addr)
431 regBankSelected: true
434 - { id: 0, class: gpr }
435 - { id: 1, class: fpr }
440 ; CHECK-LABEL: name: store_v2s64
441 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
442 ; CHECK: [[COPY1:%[0-9]+]]:fpr128 = COPY $q1
443 ; CHECK: STRQui [[COPY1]], [[COPY]], 0 :: (store 16 into %ir.addr, align 8)
445 %1(<2 x s64>) = COPY $q1
446 G_STORE %1, %0 :: (store 16 into %ir.addr, align 8)
453 regBankSelected: true
454 tracksRegLiveness: true
456 - { id: 0, class: fpr }
457 - { id: 1, class: gpr }
458 machineFunctionInfo: {}
463 ; CHECK-LABEL: name: store_4xi16
464 ; CHECK: liveins: $d0, $x0
465 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
466 ; CHECK: [[COPY1:%[0-9]+]]:gpr64sp = COPY $x0
467 ; CHECK: STRDui [[COPY]], [[COPY1]], 0 :: (store 8 into %ir.ptr)
468 ; CHECK: RET_ReallyLR
469 %0:fpr(<4 x s16>) = COPY $d0
470 %1:gpr(p0) = COPY $x0
471 G_STORE %0(<4 x s16>), %1(p0) :: (store 8 into %ir.ptr)
479 regBankSelected: true
480 tracksRegLiveness: true
482 - { id: 0, class: fpr }
483 - { id: 1, class: gpr }
484 machineFunctionInfo: {}
489 ; CHECK-LABEL: name: store_4xi32
490 ; CHECK: liveins: $q0, $x0
491 ; CHECK: [[COPY:%[0-9]+]]:fpr128 = COPY $q0
492 ; CHECK: [[COPY1:%[0-9]+]]:gpr64sp = COPY $x0
493 ; CHECK: STRQui [[COPY]], [[COPY1]], 0 :: (store 16 into %ir.ptr)
494 ; CHECK: RET_ReallyLR
495 %0:fpr(<4 x s32>) = COPY $q0
496 %1:gpr(p0) = COPY $x0
497 G_STORE %0(<4 x s32>), %1(p0) :: (store 16 into %ir.ptr)
505 regBankSelected: true
506 tracksRegLiveness: true
508 - { id: 0, class: fpr }
509 - { id: 1, class: gpr }
510 machineFunctionInfo: {}
515 ; CHECK-LABEL: name: store_8xi16
516 ; CHECK: liveins: $q0, $x0
517 ; CHECK: [[COPY:%[0-9]+]]:fpr128 = COPY $q0
518 ; CHECK: [[COPY1:%[0-9]+]]:gpr64sp = COPY $x0
519 ; CHECK: STRQui [[COPY]], [[COPY1]], 0 :: (store 16 into %ir.ptr)
520 ; CHECK: RET_ReallyLR
521 %0:fpr(<8 x s16>) = COPY $q0
522 %1:gpr(p0) = COPY $x0
523 G_STORE %0(<8 x s16>), %1(p0) :: (store 16 into %ir.ptr)
531 regBankSelected: true
532 tracksRegLiveness: true
534 - { id: 0, class: fpr }
535 - { id: 1, class: gpr }
536 machineFunctionInfo: {}
541 ; CHECK-LABEL: name: store_16xi8
542 ; CHECK: liveins: $q0, $x0
543 ; CHECK: [[COPY:%[0-9]+]]:fpr128 = COPY $q0
544 ; CHECK: [[COPY1:%[0-9]+]]:gpr64sp = COPY $x0
545 ; CHECK: STRQui [[COPY]], [[COPY1]], 0 :: (store 16 into %ir.ptr)
546 ; CHECK: RET_ReallyLR
547 %0:fpr(<16 x s8>) = COPY $q0
548 %1:gpr(p0) = COPY $x0
549 G_STORE %0(<16 x s8>), %1(p0) :: (store 16 into %ir.ptr)