1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple arm-- -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
4 define void @test_trunc_and_zext_s1_to_s32() { ret void }
5 define void @test_trunc_and_sext_s1_to_s32() { ret void }
6 define void @test_trunc_and_sext_s8_to_s32() { ret void }
7 define void @test_trunc_and_zext_s16_to_s32() { ret void }
8 define void @test_trunc_and_anyext_s8_to_s32() { ret void }
9 define void @test_trunc_and_anyext_s16_to_s32() { ret void }
11 define void @test_trunc_and_zext_s1_to_s16() { ret void }
12 define void @test_trunc_and_sext_s1_to_s16() { ret void }
13 define void @test_trunc_and_anyext_s1_to_s16() { ret void }
15 define void @test_trunc_and_zext_s8_to_s16() { ret void }
16 define void @test_trunc_and_sext_s8_to_s16() { ret void }
17 define void @test_trunc_and_anyext_s8_to_s16() { ret void }
19 define void @test_trunc_and_zext_s1_to_s8() { ret void }
20 define void @test_trunc_and_sext_s1_to_s8() { ret void }
21 define void @test_trunc_and_anyext_s1_to_s8() { ret void }
23 define void @test_add_s32() { ret void }
24 define void @test_add_fold_imm_s32() { ret void }
25 define void @test_add_no_fold_imm_s32() #2 { ret void }
27 define void @test_sub_s32() { ret void }
28 define void @test_sub_imm_s32() { ret void }
29 define void @test_sub_rev_imm_s32() { ret void }
31 define void @test_mul_s32() #0 { ret void }
32 define void @test_mulv5_s32() { ret void }
34 define void @test_sdiv_s32() #1 { ret void }
35 define void @test_udiv_s32() #1 { ret void }
37 define void @test_lshr_s32() { ret void }
38 define void @test_ashr_s32() { ret void }
39 define void @test_shl_s32() { ret void }
41 define void @test_load_from_stack() { ret void }
43 define void @test_stores() { ret void }
45 define void @test_gep() { ret void }
47 define void @test_MOVi32imm() #2 { ret void }
49 define void @test_constant_imm() { ret void }
50 define void @test_constant_cimm() { ret void }
52 define void @test_pointer_constant_unconstrained() { ret void }
53 define void @test_pointer_constant_constrained() { ret void }
55 define void @test_inttoptr_s32() { ret void }
56 define void @test_ptrtoint_s32() { ret void }
58 define void @test_select_s32() { ret void }
59 define void @test_select_ptr() { ret void }
61 define void @test_br() { ret void }
63 define void @test_phi_s32() { ret void }
65 attributes #0 = { "target-features"="+v6" }
66 attributes #1 = { "target-features"="+hwdiv-arm" }
67 attributes #2 = { "target-features"="+v6t2" }
70 name: test_trunc_and_zext_s1_to_s32
75 - { id: 0, class: gprb }
76 - { id: 1, class: gprb }
77 - { id: 2, class: gprb }
82 ; CHECK-LABEL: name: test_trunc_and_zext_s1_to_s32
83 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
84 ; CHECK: [[ANDri:%[0-9]+]]:gpr = ANDri [[COPY]], 1, 14 /* CC::al */, $noreg, $noreg
85 ; CHECK: $r0 = COPY [[ANDri]]
86 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
89 %1(s1) = G_TRUNC %0(s32)
91 %2(s32) = G_ZEXT %1(s1)
95 BX_RET 14, $noreg, implicit $r0
98 name: test_trunc_and_sext_s1_to_s32
100 regBankSelected: true
103 - { id: 0, class: gprb }
104 - { id: 1, class: gprb }
105 - { id: 2, class: gprb }
110 ; CHECK-LABEL: name: test_trunc_and_sext_s1_to_s32
111 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
112 ; CHECK: [[ANDri:%[0-9]+]]:gpr = ANDri [[COPY]], 1, 14 /* CC::al */, $noreg, $noreg
113 ; CHECK: [[RSBri:%[0-9]+]]:gpr = RSBri [[ANDri]], 0, 14 /* CC::al */, $noreg, $noreg
114 ; CHECK: $r0 = COPY [[RSBri]]
115 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
118 %1(s1) = G_TRUNC %0(s32)
120 %2(s32) = G_SEXT %1(s1)
124 BX_RET 14, $noreg, implicit $r0
127 name: test_trunc_and_sext_s8_to_s32
129 regBankSelected: true
132 - { id: 0, class: gprb }
133 - { id: 1, class: gprb }
134 - { id: 2, class: gprb }
139 ; CHECK-LABEL: name: test_trunc_and_sext_s8_to_s32
140 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
141 ; CHECK: [[COPY1:%[0-9]+]]:gprnopc = COPY [[COPY]]
142 ; CHECK: [[SXTB:%[0-9]+]]:gprnopc = SXTB [[COPY1]], 0, 14 /* CC::al */, $noreg
143 ; CHECK: $r0 = COPY [[SXTB]]
144 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
147 %1(s8) = G_TRUNC %0(s32)
149 %2(s32) = G_SEXT %1(s8)
153 BX_RET 14, $noreg, implicit $r0
156 name: test_trunc_and_zext_s16_to_s32
158 regBankSelected: true
161 - { id: 0, class: gprb }
162 - { id: 1, class: gprb }
163 - { id: 2, class: gprb }
168 ; CHECK-LABEL: name: test_trunc_and_zext_s16_to_s32
169 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
170 ; CHECK: [[COPY1:%[0-9]+]]:gprnopc = COPY [[COPY]]
171 ; CHECK: [[UXTH:%[0-9]+]]:gprnopc = UXTH [[COPY1]], 0, 14 /* CC::al */, $noreg
172 ; CHECK: $r0 = COPY [[UXTH]]
173 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
176 %1(s16) = G_TRUNC %0(s32)
178 %2(s32) = G_ZEXT %1(s16)
182 BX_RET 14, $noreg, implicit $r0
185 name: test_trunc_and_anyext_s8_to_s32
187 regBankSelected: true
190 - { id: 0, class: gprb }
191 - { id: 1, class: gprb }
192 - { id: 2, class: gprb }
197 ; CHECK-LABEL: name: test_trunc_and_anyext_s8_to_s32
198 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
199 ; CHECK: $r0 = COPY [[COPY]]
200 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
203 %1(s8) = G_TRUNC %0(s32)
205 %2(s32) = G_ANYEXT %1(s8)
209 BX_RET 14, $noreg, implicit $r0
212 name: test_trunc_and_anyext_s16_to_s32
214 regBankSelected: true
217 - { id: 0, class: gprb }
218 - { id: 1, class: gprb }
219 - { id: 2, class: gprb }
224 ; CHECK-LABEL: name: test_trunc_and_anyext_s16_to_s32
225 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
226 ; CHECK: $r0 = COPY [[COPY]]
227 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
230 %1(s16) = G_TRUNC %0(s32)
232 %2(s32) = G_ANYEXT %1(s16)
236 BX_RET 14, $noreg, implicit $r0
239 name: test_trunc_and_zext_s1_to_s16
241 regBankSelected: true
243 tracksRegLiveness: true
245 - { id: 0, class: gprb }
246 - { id: 1, class: gprb }
247 - { id: 2, class: gprb }
248 - { id: 3, class: gprb }
253 ; CHECK-LABEL: name: test_trunc_and_zext_s1_to_s16
254 ; CHECK: liveins: $r0, $r1
255 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
256 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
257 ; CHECK: [[ANDri:%[0-9]+]]:gpr = ANDri [[COPY1]], 1, 14 /* CC::al */, $noreg, $noreg
258 ; CHECK: STRH [[ANDri]], [[COPY]], $noreg, 0, 14 /* CC::al */, $noreg :: (store (s16))
259 ; CHECK: BX_RET 14 /* CC::al */, $noreg
264 %2(s1) = G_TRUNC %1(s32)
266 %3(s16) = G_ZEXT %2(s1)
268 G_STORE %3(s16), %0(p0) :: (store (s16))
273 name: test_trunc_and_sext_s1_to_s16
275 regBankSelected: true
277 tracksRegLiveness: true
279 - { id: 0, class: gprb }
280 - { id: 1, class: gprb }
281 - { id: 2, class: gprb }
282 - { id: 3, class: gprb }
287 ; CHECK-LABEL: name: test_trunc_and_sext_s1_to_s16
288 ; CHECK: liveins: $r0, $r1
289 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
290 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
291 ; CHECK: [[ANDri:%[0-9]+]]:gpr = ANDri [[COPY1]], 1, 14 /* CC::al */, $noreg, $noreg
292 ; CHECK: [[RSBri:%[0-9]+]]:gpr = RSBri [[ANDri]], 0, 14 /* CC::al */, $noreg, $noreg
293 ; CHECK: STRH [[RSBri]], [[COPY]], $noreg, 0, 14 /* CC::al */, $noreg :: (store (s16))
294 ; CHECK: BX_RET 14 /* CC::al */, $noreg
299 %2(s1) = G_TRUNC %1(s32)
301 %3(s16) = G_SEXT %2(s1)
303 G_STORE %3(s16), %0(p0) :: (store (s16))
308 name: test_trunc_and_anyext_s1_to_s16
310 regBankSelected: true
312 tracksRegLiveness: true
314 - { id: 0, class: gprb }
315 - { id: 1, class: gprb }
316 - { id: 2, class: gprb }
317 - { id: 3, class: gprb }
322 ; CHECK-LABEL: name: test_trunc_and_anyext_s1_to_s16
323 ; CHECK: liveins: $r0, $r1
324 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
325 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
326 ; CHECK: STRH [[COPY1]], [[COPY]], $noreg, 0, 14 /* CC::al */, $noreg :: (store (s16))
327 ; CHECK: BX_RET 14 /* CC::al */, $noreg
332 %2(s1) = G_TRUNC %1(s32)
334 %3(s16) = G_ANYEXT %2(s1)
336 G_STORE %3(s16), %0(p0) :: (store (s16))
341 name: test_trunc_and_zext_s8_to_s16
343 regBankSelected: true
345 tracksRegLiveness: true
347 - { id: 0, class: gprb }
348 - { id: 1, class: gprb }
349 - { id: 2, class: gprb }
350 - { id: 3, class: gprb }
355 ; CHECK-LABEL: name: test_trunc_and_zext_s8_to_s16
356 ; CHECK: liveins: $r0, $r1
357 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
358 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
359 ; CHECK: [[COPY2:%[0-9]+]]:gprnopc = COPY [[COPY1]]
360 ; CHECK: [[UXTB:%[0-9]+]]:gprnopc = UXTB [[COPY2]], 0, 14 /* CC::al */, $noreg
361 ; CHECK: STRH [[UXTB]], [[COPY]], $noreg, 0, 14 /* CC::al */, $noreg :: (store (s16))
362 ; CHECK: BX_RET 14 /* CC::al */, $noreg
367 %2(s8) = G_TRUNC %1(s32)
369 %3(s16) = G_ZEXT %2(s8)
371 G_STORE %3(s16), %0(p0) :: (store (s16))
376 name: test_trunc_and_sext_s8_to_s16
378 regBankSelected: true
380 tracksRegLiveness: true
382 - { id: 0, class: gprb }
383 - { id: 1, class: gprb }
384 - { id: 2, class: gprb }
385 - { id: 3, class: gprb }
390 ; CHECK-LABEL: name: test_trunc_and_sext_s8_to_s16
391 ; CHECK: liveins: $r0, $r1
392 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
393 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
394 ; CHECK: [[COPY2:%[0-9]+]]:gprnopc = COPY [[COPY1]]
395 ; CHECK: [[SXTB:%[0-9]+]]:gprnopc = SXTB [[COPY2]], 0, 14 /* CC::al */, $noreg
396 ; CHECK: STRH [[SXTB]], [[COPY]], $noreg, 0, 14 /* CC::al */, $noreg :: (store (s16))
397 ; CHECK: BX_RET 14 /* CC::al */, $noreg
402 %2(s8) = G_TRUNC %1(s32)
404 %3(s16) = G_SEXT %2(s8)
406 G_STORE %3(s16), %0(p0) :: (store (s16))
411 name: test_trunc_and_anyext_s8_to_s16
413 regBankSelected: true
415 tracksRegLiveness: true
417 - { id: 0, class: gprb }
418 - { id: 1, class: gprb }
419 - { id: 2, class: gprb }
420 - { id: 3, class: gprb }
425 ; CHECK-LABEL: name: test_trunc_and_anyext_s8_to_s16
426 ; CHECK: liveins: $r0, $r1
427 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
428 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
429 ; CHECK: STRH [[COPY1]], [[COPY]], $noreg, 0, 14 /* CC::al */, $noreg :: (store (s16))
430 ; CHECK: BX_RET 14 /* CC::al */, $noreg
435 %2(s8) = G_TRUNC %1(s32)
437 %3(s16) = G_ANYEXT %2(s8)
439 G_STORE %3(s16), %0(p0) :: (store (s16))
444 name: test_trunc_and_zext_s1_to_s8
446 regBankSelected: true
448 tracksRegLiveness: true
450 - { id: 0, class: gprb }
451 - { id: 1, class: gprb }
452 - { id: 2, class: gprb }
453 - { id: 3, class: gprb }
458 ; CHECK-LABEL: name: test_trunc_and_zext_s1_to_s8
459 ; CHECK: liveins: $r0, $r1
460 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
461 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
462 ; CHECK: [[ANDri:%[0-9]+]]:gprnopc = ANDri [[COPY1]], 1, 14 /* CC::al */, $noreg, $noreg
463 ; CHECK: STRBi12 [[ANDri]], [[COPY]], 0, 14 /* CC::al */, $noreg :: (store (s8))
464 ; CHECK: BX_RET 14 /* CC::al */, $noreg
469 %2(s1) = G_TRUNC %1(s32)
471 %3(s8) = G_ZEXT %2(s1)
473 G_STORE %3(s8), %0(p0) :: (store (s8))
478 name: test_trunc_and_sext_s1_to_s8
480 regBankSelected: true
482 tracksRegLiveness: true
484 - { id: 0, class: gprb }
485 - { id: 1, class: gprb }
486 - { id: 2, class: gprb }
487 - { id: 3, class: gprb }
492 ; CHECK-LABEL: name: test_trunc_and_sext_s1_to_s8
493 ; CHECK: liveins: $r0, $r1
494 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
495 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
496 ; CHECK: [[ANDri:%[0-9]+]]:gpr = ANDri [[COPY1]], 1, 14 /* CC::al */, $noreg, $noreg
497 ; CHECK: [[RSBri:%[0-9]+]]:gprnopc = RSBri [[ANDri]], 0, 14 /* CC::al */, $noreg, $noreg
498 ; CHECK: STRBi12 [[RSBri]], [[COPY]], 0, 14 /* CC::al */, $noreg :: (store (s8))
499 ; CHECK: BX_RET 14 /* CC::al */, $noreg
504 %2(s1) = G_TRUNC %1(s32)
506 %3(s8) = G_SEXT %2(s1)
508 G_STORE %3(s8), %0(p0) :: (store (s8))
513 name: test_trunc_and_anyext_s1_to_s8
515 regBankSelected: true
517 tracksRegLiveness: true
519 - { id: 0, class: gprb }
520 - { id: 1, class: gprb }
521 - { id: 2, class: gprb }
522 - { id: 3, class: gprb }
527 ; CHECK-LABEL: name: test_trunc_and_anyext_s1_to_s8
528 ; CHECK: liveins: $r0, $r1
529 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
530 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
531 ; CHECK: [[COPY2:%[0-9]+]]:gprnopc = COPY [[COPY1]]
532 ; CHECK: STRBi12 [[COPY2]], [[COPY]], 0, 14 /* CC::al */, $noreg :: (store (s8))
533 ; CHECK: BX_RET 14 /* CC::al */, $noreg
538 %2(s1) = G_TRUNC %1(s32)
540 %3(s8) = G_ANYEXT %2(s1)
542 G_STORE %3(s8), %0(p0) :: (store (s8))
549 regBankSelected: true
552 - { id: 0, class: gprb }
553 - { id: 1, class: gprb }
554 - { id: 2, class: gprb }
559 ; CHECK-LABEL: name: test_add_s32
560 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
561 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
562 ; CHECK: [[ADDrr:%[0-9]+]]:gpr = ADDrr [[COPY]], [[COPY1]], 14 /* CC::al */, $noreg, $noreg
563 ; CHECK: $r0 = COPY [[ADDrr]]
564 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
569 %2(s32) = G_ADD %0, %1
573 BX_RET 14, $noreg, implicit $r0
576 name: test_add_fold_imm_s32
578 regBankSelected: true
581 - { id: 0, class: gprb }
582 - { id: 1, class: gprb }
583 - { id: 2, class: gprb }
588 ; CHECK-LABEL: name: test_add_fold_imm_s32
589 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
590 ; CHECK: [[ADDri:%[0-9]+]]:gpr = ADDri [[COPY]], 255, 14 /* CC::al */, $noreg, $noreg
591 ; CHECK: $r0 = COPY [[ADDri]]
592 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
595 %1(s32) = G_CONSTANT i32 255
596 %2(s32) = G_ADD %0, %1
600 BX_RET 14, $noreg, implicit $r0
603 name: test_add_no_fold_imm_s32
605 regBankSelected: true
608 - { id: 0, class: gprb }
609 - { id: 1, class: gprb }
610 - { id: 2, class: gprb }
615 ; CHECK-LABEL: name: test_add_no_fold_imm_s32
616 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
617 ; CHECK: [[MOVi16_:%[0-9]+]]:gpr = MOVi16 65535, 14 /* CC::al */, $noreg
618 ; CHECK: [[ADDrr:%[0-9]+]]:gpr = ADDrr [[COPY]], [[MOVi16_]], 14 /* CC::al */, $noreg, $noreg
619 ; CHECK: $r0 = COPY [[ADDrr]]
620 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
623 %1(s32) = G_CONSTANT i32 65535
625 %2(s32) = G_ADD %0, %1
629 BX_RET 14, $noreg, implicit $r0
634 regBankSelected: true
637 - { id: 0, class: gprb }
638 - { id: 1, class: gprb }
639 - { id: 2, class: gprb }
644 ; CHECK-LABEL: name: test_sub_s32
645 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
646 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
647 ; CHECK: [[SUBrr:%[0-9]+]]:gpr = SUBrr [[COPY]], [[COPY1]], 14 /* CC::al */, $noreg, $noreg
648 ; CHECK: $r0 = COPY [[SUBrr]]
649 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
654 %2(s32) = G_SUB %0, %1
658 BX_RET 14, $noreg, implicit $r0
661 name: test_sub_imm_s32
663 regBankSelected: true
666 - { id: 0, class: gprb }
667 - { id: 1, class: gprb }
668 - { id: 2, class: gprb }
673 ; CHECK-LABEL: name: test_sub_imm_s32
674 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
675 ; CHECK: [[SUBri:%[0-9]+]]:gpr = SUBri [[COPY]], 17, 14 /* CC::al */, $noreg, $noreg
676 ; CHECK: $r0 = COPY [[SUBri]]
677 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
680 %1(s32) = G_CONSTANT i32 17
681 %2(s32) = G_SUB %0, %1
685 BX_RET 14, $noreg, implicit $r0
688 name: test_sub_rev_imm_s32
690 regBankSelected: true
693 - { id: 0, class: gprb }
694 - { id: 1, class: gprb }
695 - { id: 2, class: gprb }
700 ; CHECK-LABEL: name: test_sub_rev_imm_s32
701 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
702 ; CHECK: [[RSBri:%[0-9]+]]:gpr = RSBri [[COPY]], 17, 14 /* CC::al */, $noreg, $noreg
703 ; CHECK: $r0 = COPY [[RSBri]]
704 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
707 %1(s32) = G_CONSTANT i32 17
708 %2(s32) = G_SUB %1, %0
712 BX_RET 14, $noreg, implicit $r0
717 regBankSelected: true
720 - { id: 0, class: gprb }
721 - { id: 1, class: gprb }
722 - { id: 2, class: gprb }
727 ; CHECK-LABEL: name: test_mul_s32
728 ; CHECK: [[COPY:%[0-9]+]]:gprnopc = COPY $r0
729 ; CHECK: [[COPY1:%[0-9]+]]:gprnopc = COPY $r1
730 ; CHECK: [[MUL:%[0-9]+]]:gprnopc = MUL [[COPY]], [[COPY1]], 14 /* CC::al */, $noreg, $noreg
731 ; CHECK: $r0 = COPY [[MUL]]
732 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
737 %2(s32) = G_MUL %0, %1
741 BX_RET 14, $noreg, implicit $r0
746 regBankSelected: true
749 - { id: 0, class: gprb }
750 - { id: 1, class: gprb }
751 - { id: 2, class: gprb }
756 ; CHECK-LABEL: name: test_mulv5_s32
757 ; CHECK: [[COPY:%[0-9]+]]:gprnopc = COPY $r0
758 ; CHECK: [[COPY1:%[0-9]+]]:gprnopc = COPY $r1
759 ; CHECK: early-clobber %2:gprnopc = MULv5 [[COPY]], [[COPY1]], 14 /* CC::al */, $noreg, $noreg
760 ; CHECK: $r0 = COPY %2
761 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
766 %2(s32) = G_MUL %0, %1
770 BX_RET 14, $noreg, implicit $r0
775 regBankSelected: true
778 - { id: 0, class: gprb }
779 - { id: 1, class: gprb }
780 - { id: 2, class: gprb }
785 ; CHECK-LABEL: name: test_sdiv_s32
786 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
787 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
788 ; CHECK: [[SDIV:%[0-9]+]]:gpr = SDIV [[COPY]], [[COPY1]], 14 /* CC::al */, $noreg
789 ; CHECK: $r0 = COPY [[SDIV]]
790 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
795 %2(s32) = G_SDIV %0, %1
799 BX_RET 14, $noreg, implicit $r0
804 regBankSelected: true
807 - { id: 0, class: gprb }
808 - { id: 1, class: gprb }
809 - { id: 2, class: gprb }
814 ; CHECK-LABEL: name: test_udiv_s32
815 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
816 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
817 ; CHECK: [[UDIV:%[0-9]+]]:gpr = UDIV [[COPY]], [[COPY1]], 14 /* CC::al */, $noreg
818 ; CHECK: $r0 = COPY [[UDIV]]
819 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
824 %2(s32) = G_UDIV %0, %1
828 BX_RET 14, $noreg, implicit $r0
833 regBankSelected: true
836 - { id: 0, class: gprb }
837 - { id: 1, class: gprb }
838 - { id: 2, class: gprb }
843 ; CHECK-LABEL: name: test_lshr_s32
844 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
845 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
846 ; CHECK: [[MOVsr:%[0-9]+]]:gprnopc = MOVsr [[COPY]], [[COPY1]], 3, 14 /* CC::al */, $noreg, $noreg
847 ; CHECK: $r0 = COPY [[MOVsr]]
848 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
853 %2(s32) = G_LSHR %0, %1
857 BX_RET 14, $noreg, implicit $r0
862 regBankSelected: true
865 - { id: 0, class: gprb }
866 - { id: 1, class: gprb }
867 - { id: 2, class: gprb }
872 ; CHECK-LABEL: name: test_ashr_s32
873 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
874 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
875 ; CHECK: [[MOVsr:%[0-9]+]]:gprnopc = MOVsr [[COPY]], [[COPY1]], 1, 14 /* CC::al */, $noreg, $noreg
876 ; CHECK: $r0 = COPY [[MOVsr]]
877 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
882 %2(s32) = G_ASHR %0, %1
886 BX_RET 14, $noreg, implicit $r0
891 regBankSelected: true
894 - { id: 0, class: gprb }
895 - { id: 1, class: gprb }
896 - { id: 2, class: gprb }
901 ; CHECK-LABEL: name: test_shl_s32
902 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
903 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
904 ; CHECK: [[MOVsr:%[0-9]+]]:gprnopc = MOVsr [[COPY]], [[COPY1]], 2, 14 /* CC::al */, $noreg, $noreg
905 ; CHECK: $r0 = COPY [[MOVsr]]
906 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
911 %2(s32) = G_SHL %0, %1
915 BX_RET 14, $noreg, implicit $r0
918 name: test_load_from_stack
920 regBankSelected: true
923 - { id: 0, class: gprb }
924 - { id: 1, class: gprb }
925 - { id: 2, class: gprb }
926 - { id: 3, class: gprb }
927 - { id: 4, class: gprb }
929 - { id: 0, offset: 0, size: 1, alignment: 4, isImmutable: true, isAliased: false }
930 - { id: 1, offset: 4, size: 4, alignment: 4, isImmutable: true, isAliased: false }
931 - { id: 2, offset: 8, size: 4, alignment: 4, isImmutable: true, isAliased: false }
934 liveins: $r0, $r1, $r2, $r3
936 ; CHECK-LABEL: name: test_load_from_stack
937 ; CHECK: [[ADDri:%[0-9]+]]:gpr = ADDri %fixed-stack.0, 0, 14 /* CC::al */, $noreg, $noreg
938 ; CHECK: [[LDRi12_:%[0-9]+]]:gpr = LDRi12 [[ADDri]], 0, 14 /* CC::al */, $noreg :: (load (s32))
939 ; CHECK: $r0 = COPY [[LDRi12_]]
940 ; CHECK: [[ADDri1:%[0-9]+]]:gpr = ADDri %fixed-stack.2, 0, 14 /* CC::al */, $noreg, $noreg
941 ; CHECK: [[LDRBi12_:%[0-9]+]]:gprnopc = LDRBi12 [[ADDri1]], 0, 14 /* CC::al */, $noreg :: (load (s8))
942 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY [[LDRBi12_]]
943 ; CHECK: $r0 = COPY [[COPY]]
944 ; CHECK: BX_RET 14 /* CC::al */, $noreg
945 %0(p0) = G_FRAME_INDEX %fixed-stack.2
947 %1(s32) = G_LOAD %0(p0) :: (load (s32))
951 %2(p0) = G_FRAME_INDEX %fixed-stack.0
953 %3(s8) = G_LOAD %2(p0) :: (load (s8))
955 %4(s32) = G_ANYEXT %3(s8)
964 regBankSelected: true
967 - { id: 0, class: gprb }
968 - { id: 1, class: gprb }
969 - { id: 2, class: gprb }
970 - { id: 3, class: gprb }
971 - { id: 4, class: gprb }
976 ; CHECK-LABEL: name: test_stores
977 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
978 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
979 ; CHECK: [[COPY2:%[0-9]+]]:gprnopc = COPY [[COPY1]]
980 ; CHECK: STRBi12 [[COPY2]], [[COPY]], 0, 14 /* CC::al */, $noreg :: (store (s8))
981 ; CHECK: STRH [[COPY1]], [[COPY]], $noreg, 0, 14 /* CC::al */, $noreg :: (store (s16))
982 ; CHECK: STRi12 [[COPY1]], [[COPY]], 0, 14 /* CC::al */, $noreg :: (store (s32))
983 ; CHECK: BX_RET 14 /* CC::al */, $noreg
988 %1(s8) = G_TRUNC %3(s32)
990 %2(s16) = G_TRUNC %3(s32)
992 G_STORE %1(s8), %0(p0) :: (store (s8))
994 G_STORE %2(s16), %0(p0) :: (store (s16))
996 G_STORE %3(s32), %0(p0) :: (store (s32))
1003 regBankSelected: true
1006 - { id: 0, class: gprb }
1007 - { id: 1, class: gprb }
1008 - { id: 2, class: gprb }
1013 ; CHECK-LABEL: name: test_gep
1014 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
1015 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
1016 ; CHECK: [[ADDrr:%[0-9]+]]:gpr = ADDrr [[COPY]], [[COPY1]], 14 /* CC::al */, $noreg, $noreg
1017 ; CHECK: $r0 = COPY [[ADDrr]]
1018 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
1023 %2(p0) = G_PTR_ADD %0, %1(s32)
1026 BX_RET 14, $noreg, implicit $r0
1029 name: test_MOVi32imm
1031 regBankSelected: true
1034 - { id: 0, class: gprb }
1037 ; CHECK-LABEL: name: test_MOVi32imm
1038 ; CHECK: [[MOVi32imm:%[0-9]+]]:gpr = MOVi32imm 65537
1039 ; CHECK: $r0 = COPY [[MOVi32imm]]
1040 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
1041 %0(s32) = G_CONSTANT i32 65537
1044 BX_RET 14, $noreg, implicit $r0
1047 name: test_constant_imm
1049 regBankSelected: true
1052 - { id: 0, class: gprb }
1055 ; CHECK-LABEL: name: test_constant_imm
1056 ; CHECK: [[MOVi:%[0-9]+]]:gpr = MOVi 42, 14 /* CC::al */, $noreg, $noreg
1057 ; CHECK: $r0 = COPY [[MOVi]]
1058 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
1059 %0(s32) = G_CONSTANT i32 42
1062 BX_RET 14, $noreg, implicit $r0
1065 name: test_constant_cimm
1067 regBankSelected: true
1070 - { id: 0, class: gprb }
1073 ; Adding a type on G_CONSTANT changes its operand from an Imm into a CImm.
1074 ; We still want to see the same thing in the output though.
1075 ; CHECK-LABEL: name: test_constant_cimm
1076 ; CHECK: [[MOVi:%[0-9]+]]:gpr = MOVi 42, 14 /* CC::al */, $noreg, $noreg
1077 ; CHECK: $r0 = COPY [[MOVi]]
1078 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
1079 %0(s32) = G_CONSTANT i32 42
1082 BX_RET 14, $noreg, implicit $r0
1085 name: test_pointer_constant_unconstrained
1087 regBankSelected: true
1090 - { id: 0, class: gprb }
1093 ; CHECK-LABEL: name: test_pointer_constant_unconstrained
1094 ; CHECK: [[MOVi:%[0-9]+]]:gpr = MOVi 0, 14 /* CC::al */, $noreg, $noreg
1095 ; CHECK: $r0 = COPY [[MOVi]]
1096 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
1097 %0(p0) = G_CONSTANT i32 0
1099 ; This leaves %0 unconstrained before the G_CONSTANT is selected.
1101 BX_RET 14, $noreg, implicit $r0
1104 name: test_pointer_constant_constrained
1106 regBankSelected: true
1109 - { id: 0, class: gprb }
1112 ; CHECK-LABEL: name: test_pointer_constant_constrained
1113 ; CHECK: [[MOVi:%[0-9]+]]:gpr = MOVi 0, 14 /* CC::al */, $noreg, $noreg
1114 ; CHECK: STRi12 [[MOVi]], [[MOVi]], 0, 14 /* CC::al */, $noreg :: (store (p0))
1115 %0(p0) = G_CONSTANT i32 0
1117 ; This constrains %0 before the G_CONSTANT is selected.
1118 G_STORE %0(p0), %0(p0) :: (store (p0))
1121 name: test_inttoptr_s32
1123 regBankSelected: true
1126 - { id: 0, class: gprb }
1127 - { id: 1, class: gprb }
1132 ; CHECK-LABEL: name: test_inttoptr_s32
1133 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
1134 ; CHECK: $r0 = COPY [[COPY]]
1135 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
1137 %1(p0) = G_INTTOPTR %0(s32)
1141 BX_RET 14, $noreg, implicit $r0
1144 name: test_ptrtoint_s32
1146 regBankSelected: true
1149 - { id: 0, class: gprb }
1150 - { id: 1, class: gprb }
1155 ; CHECK-LABEL: name: test_ptrtoint_s32
1156 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
1157 ; CHECK: $r0 = COPY [[COPY]]
1158 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
1160 %1(s32) = G_PTRTOINT %0(p0)
1164 BX_RET 14, $noreg, implicit $r0
1167 name: test_select_s32
1169 regBankSelected: true
1172 - { id: 0, class: gprb }
1173 - { id: 1, class: gprb }
1174 - { id: 2, class: gprb }
1175 - { id: 3, class: gprb }
1180 ; CHECK-LABEL: name: test_select_s32
1181 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
1182 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
1183 ; CHECK: TSTri [[COPY1]], 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
1184 ; CHECK: [[MOVCCr:%[0-9]+]]:gpr = MOVCCr [[COPY]], [[COPY1]], 0 /* CC::eq */, $cpsr
1185 ; CHECK: $r0 = COPY [[MOVCCr]]
1186 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
1191 %2(s1) = G_TRUNC %1(s32)
1193 %3(s32) = G_SELECT %2(s1), %0, %1
1197 BX_RET 14, $noreg, implicit $r0
1200 name: test_select_ptr
1202 regBankSelected: true
1205 - { id: 0, class: gprb }
1206 - { id: 1, class: gprb }
1207 - { id: 2, class: gprb }
1208 - { id: 3, class: gprb }
1209 - { id: 4, class: gprb }
1212 liveins: $r0, $r1, $r2
1214 ; CHECK-LABEL: name: test_select_ptr
1215 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
1216 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
1217 ; CHECK: [[COPY2:%[0-9]+]]:gpr = COPY $r2
1218 ; CHECK: TSTri [[COPY2]], 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
1219 ; CHECK: [[MOVCCr:%[0-9]+]]:gpr = MOVCCr [[COPY]], [[COPY1]], 0 /* CC::eq */, $cpsr
1220 ; CHECK: $r0 = COPY [[MOVCCr]]
1221 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
1228 %3(s1) = G_TRUNC %2(s32)
1230 %4(p0) = G_SELECT %3(s1), %0, %1
1234 BX_RET 14, $noreg, implicit $r0
1239 regBankSelected: true
1242 - { id: 0, class: gprb }
1243 - { id: 1, class: gprb }
1245 ; CHECK-LABEL: name: test_br
1247 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
1248 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
1249 ; CHECK: TSTri [[COPY]], 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
1250 ; CHECK: Bcc %bb.1, 1 /* CC::ne */, $cpsr
1253 ; CHECK: successors: %bb.2(0x80000000)
1256 ; CHECK: BX_RET 14 /* CC::al */, $noreg
1258 successors: %bb.1(0x40000000), %bb.2(0x40000000)
1262 %1(s1) = G_TRUNC %0(s32)
1264 G_BRCOND %1(s1), %bb.1
1268 successors: %bb.2(0x80000000)
1279 regBankSelected: true
1281 tracksRegLiveness: true
1283 - { id: 0, class: gprb }
1284 - { id: 1, class: gprb }
1285 - { id: 2, class: gprb }
1286 - { id: 3, class: gprb }
1287 - { id: 4, class: gprb }
1289 ; CHECK-LABEL: name: test_phi_s32
1291 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
1292 ; CHECK: liveins: $r0, $r1, $r2
1293 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
1294 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
1295 ; CHECK: [[COPY2:%[0-9]+]]:gpr = COPY $r2
1296 ; CHECK: TSTri [[COPY]], 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
1297 ; CHECK: Bcc %bb.1, 1 /* CC::ne */, $cpsr
1300 ; CHECK: successors: %bb.2(0x80000000)
1303 ; CHECK: [[PHI:%[0-9]+]]:gpr = PHI [[COPY1]], %bb.0, [[COPY2]], %bb.1
1304 ; CHECK: $r0 = COPY [[PHI]]
1305 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
1307 successors: %bb.1(0x40000000), %bb.2(0x40000000)
1308 liveins: $r0, $r1, $r2
1311 %1(s1) = G_TRUNC %0(s32)
1316 G_BRCOND %1(s1), %bb.1
1320 successors: %bb.2(0x80000000)
1325 %4(s32) = G_PHI %2(s32), %bb.0, %3(s32), %bb.1
1328 BX_RET 14, $noreg, implicit $r0