1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -verify-machineinstrs -no-integrated-as < %s \
3 ; RUN: | FileCheck -check-prefix=RV32I %s
4 ; RUN: llc -mtriple=riscv64 -verify-machineinstrs -no-integrated-as < %s \
5 ; RUN: | FileCheck -check-prefix=RV64I %s
7 ; These test that we can use both the architectural names (x*) and the ABI names
8 ; (a*, s*, t* etc) to refer to registers in inline asm constraint lists. In each
9 ; case, the named register should be used for the source register of the `addi`.
10 ; It is very likely that `a0` will be chosen as the designation register, but
11 ; this is left to the compiler to choose.
13 ; The inline assembly will, by default, contain the ABI names for the registers.
15 ; Parenthesised registers in comments are the other aliases for this register.
17 ; NOTE: This test has to pass in 0 to the inline asm, because that's the only
18 ; value `x0` (`zero`) can take.
19 define i32 @explicit_register_x0() nounwind {
20 ; RV32I-LABEL: explicit_register_x0:
23 ; RV32I-NEXT: addi a0, zero, 0
27 ; RV64I-LABEL: explicit_register_x0:
30 ; RV64I-NEXT: addi a0, zero, 0
33 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x0}"(i32 0)
37 ; NOTE: This test has to pass in 0 to the inline asm, because that's the only
38 ; value that `zero` (`x0`) can take.
39 define i32 @explicit_register_zero() nounwind {
40 ; RV32I-LABEL: explicit_register_zero:
43 ; RV32I-NEXT: addi a0, zero, 0
47 ; RV64I-LABEL: explicit_register_zero:
50 ; RV64I-NEXT: addi a0, zero, 0
53 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{zero}"(i32 0)
57 ; NOTE: This test uses `x1` (`ra`) as an input, so it should be saved.
58 define i32 @explicit_register_x1(i32 %a) nounwind {
59 ; RV32I-LABEL: explicit_register_x1:
61 ; RV32I-NEXT: addi sp, sp, -16
62 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
63 ; RV32I-NEXT: mv ra, a0
65 ; RV32I-NEXT: addi a0, ra, 0
67 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
68 ; RV32I-NEXT: addi sp, sp, 16
71 ; RV64I-LABEL: explicit_register_x1:
73 ; RV64I-NEXT: addi sp, sp, -16
74 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
75 ; RV64I-NEXT: mv ra, a0
77 ; RV64I-NEXT: addi a0, ra, 0
79 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
80 ; RV64I-NEXT: addi sp, sp, 16
82 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x1}"(i32 %a)
86 ; NOTE: This test uses `ra` (`x1`) as an input, so it should be saved.
87 define i32 @explicit_register_ra(i32 %a) nounwind {
88 ; RV32I-LABEL: explicit_register_ra:
90 ; RV32I-NEXT: addi sp, sp, -16
91 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
92 ; RV32I-NEXT: mv ra, a0
94 ; RV32I-NEXT: addi a0, ra, 0
96 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
97 ; RV32I-NEXT: addi sp, sp, 16
100 ; RV64I-LABEL: explicit_register_ra:
102 ; RV64I-NEXT: addi sp, sp, -16
103 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
104 ; RV64I-NEXT: mv ra, a0
106 ; RV64I-NEXT: addi a0, ra, 0
107 ; RV64I-NEXT: #NO_APP
108 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
109 ; RV64I-NEXT: addi sp, sp, 16
111 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{ra}"(i32 %a)
115 define i32 @explicit_register_x2(i32 %a) nounwind {
116 ; RV32I-LABEL: explicit_register_x2:
118 ; RV32I-NEXT: mv sp, a0
120 ; RV32I-NEXT: addi a0, sp, 0
121 ; RV32I-NEXT: #NO_APP
124 ; RV64I-LABEL: explicit_register_x2:
126 ; RV64I-NEXT: mv sp, a0
128 ; RV64I-NEXT: addi a0, sp, 0
129 ; RV64I-NEXT: #NO_APP
131 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x2}"(i32 %a)
135 define i32 @explicit_register_sp(i32 %a) nounwind {
136 ; RV32I-LABEL: explicit_register_sp:
138 ; RV32I-NEXT: mv sp, a0
140 ; RV32I-NEXT: addi a0, sp, 0
141 ; RV32I-NEXT: #NO_APP
144 ; RV64I-LABEL: explicit_register_sp:
146 ; RV64I-NEXT: mv sp, a0
148 ; RV64I-NEXT: addi a0, sp, 0
149 ; RV64I-NEXT: #NO_APP
151 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{sp}"(i32 %a)
155 ; NOTE: This test uses `x3` (`gp`) as an input, so it should be saved.
156 define i32 @explicit_register_x3(i32 %a) nounwind {
157 ; RV32I-LABEL: explicit_register_x3:
159 ; RV32I-NEXT: mv gp, a0
161 ; RV32I-NEXT: addi a0, gp, 0
162 ; RV32I-NEXT: #NO_APP
165 ; RV64I-LABEL: explicit_register_x3:
167 ; RV64I-NEXT: mv gp, a0
169 ; RV64I-NEXT: addi a0, gp, 0
170 ; RV64I-NEXT: #NO_APP
172 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x3}"(i32 %a)
176 ; NOTE: This test uses `gp` (`x3`) as an input, so it should be saved.
177 define i32 @explicit_register_gp(i32 %a) nounwind {
178 ; RV32I-LABEL: explicit_register_gp:
180 ; RV32I-NEXT: mv gp, a0
182 ; RV32I-NEXT: addi a0, gp, 0
183 ; RV32I-NEXT: #NO_APP
186 ; RV64I-LABEL: explicit_register_gp:
188 ; RV64I-NEXT: mv gp, a0
190 ; RV64I-NEXT: addi a0, gp, 0
191 ; RV64I-NEXT: #NO_APP
193 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{gp}"(i32 %a)
197 ; NOTE: This test uses `x4` (`tp`) as an input, so it should be saved.
198 define i32 @explicit_register_x4(i32 %a) nounwind {
199 ; RV32I-LABEL: explicit_register_x4:
201 ; RV32I-NEXT: mv tp, a0
203 ; RV32I-NEXT: addi a0, tp, 0
204 ; RV32I-NEXT: #NO_APP
207 ; RV64I-LABEL: explicit_register_x4:
209 ; RV64I-NEXT: mv tp, a0
211 ; RV64I-NEXT: addi a0, tp, 0
212 ; RV64I-NEXT: #NO_APP
214 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x4}"(i32 %a)
218 ; NOTE: This test uses `tp` (`x4`) as an input, so it should be saved.
219 define i32 @explicit_register_tp(i32 %a) nounwind {
220 ; RV32I-LABEL: explicit_register_tp:
222 ; RV32I-NEXT: mv tp, a0
224 ; RV32I-NEXT: addi a0, tp, 0
225 ; RV32I-NEXT: #NO_APP
228 ; RV64I-LABEL: explicit_register_tp:
230 ; RV64I-NEXT: mv tp, a0
232 ; RV64I-NEXT: addi a0, tp, 0
233 ; RV64I-NEXT: #NO_APP
235 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{tp}"(i32 %a)
239 define i32 @explicit_register_x5(i32 %a) nounwind {
240 ; RV32I-LABEL: explicit_register_x5:
242 ; RV32I-NEXT: mv t0, a0
244 ; RV32I-NEXT: addi a0, t0, 0
245 ; RV32I-NEXT: #NO_APP
248 ; RV64I-LABEL: explicit_register_x5:
250 ; RV64I-NEXT: mv t0, a0
252 ; RV64I-NEXT: addi a0, t0, 0
253 ; RV64I-NEXT: #NO_APP
255 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x5}"(i32 %a)
259 define i32 @explicit_register_t0(i32 %a) nounwind {
260 ; RV32I-LABEL: explicit_register_t0:
262 ; RV32I-NEXT: mv t0, a0
264 ; RV32I-NEXT: addi a0, t0, 0
265 ; RV32I-NEXT: #NO_APP
268 ; RV64I-LABEL: explicit_register_t0:
270 ; RV64I-NEXT: mv t0, a0
272 ; RV64I-NEXT: addi a0, t0, 0
273 ; RV64I-NEXT: #NO_APP
275 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{t0}"(i32 %a)
279 define i32 @explicit_register_x6(i32 %a) nounwind {
280 ; RV32I-LABEL: explicit_register_x6:
282 ; RV32I-NEXT: mv t1, a0
284 ; RV32I-NEXT: addi a0, t1, 0
285 ; RV32I-NEXT: #NO_APP
288 ; RV64I-LABEL: explicit_register_x6:
290 ; RV64I-NEXT: mv t1, a0
292 ; RV64I-NEXT: addi a0, t1, 0
293 ; RV64I-NEXT: #NO_APP
295 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x6}"(i32 %a)
299 define i32 @explicit_register_t1(i32 %a) nounwind {
300 ; RV32I-LABEL: explicit_register_t1:
302 ; RV32I-NEXT: mv t1, a0
304 ; RV32I-NEXT: addi a0, t1, 0
305 ; RV32I-NEXT: #NO_APP
308 ; RV64I-LABEL: explicit_register_t1:
310 ; RV64I-NEXT: mv t1, a0
312 ; RV64I-NEXT: addi a0, t1, 0
313 ; RV64I-NEXT: #NO_APP
315 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{t1}"(i32 %a)
319 define i32 @explicit_register_x7(i32 %a) nounwind {
320 ; RV32I-LABEL: explicit_register_x7:
322 ; RV32I-NEXT: mv t2, a0
324 ; RV32I-NEXT: addi a0, t2, 0
325 ; RV32I-NEXT: #NO_APP
328 ; RV64I-LABEL: explicit_register_x7:
330 ; RV64I-NEXT: mv t2, a0
332 ; RV64I-NEXT: addi a0, t2, 0
333 ; RV64I-NEXT: #NO_APP
335 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x7}"(i32 %a)
339 define i32 @explicit_register_t2(i32 %a) nounwind {
340 ; RV32I-LABEL: explicit_register_t2:
342 ; RV32I-NEXT: mv t2, a0
344 ; RV32I-NEXT: addi a0, t2, 0
345 ; RV32I-NEXT: #NO_APP
348 ; RV64I-LABEL: explicit_register_t2:
350 ; RV64I-NEXT: mv t2, a0
352 ; RV64I-NEXT: addi a0, t2, 0
353 ; RV64I-NEXT: #NO_APP
355 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{t2}"(i32 %a)
359 ; NOTE: This test uses `x8` (`s0`, `fp`) as an input, so it should be saved.
360 define i32 @explicit_register_x8(i32 %a) nounwind {
361 ; RV32I-LABEL: explicit_register_x8:
363 ; RV32I-NEXT: addi sp, sp, -16
364 ; RV32I-NEXT: sw s0, 12(sp) # 4-byte Folded Spill
365 ; RV32I-NEXT: mv s0, a0
367 ; RV32I-NEXT: addi a0, s0, 0
368 ; RV32I-NEXT: #NO_APP
369 ; RV32I-NEXT: lw s0, 12(sp) # 4-byte Folded Reload
370 ; RV32I-NEXT: addi sp, sp, 16
373 ; RV64I-LABEL: explicit_register_x8:
375 ; RV64I-NEXT: addi sp, sp, -16
376 ; RV64I-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
377 ; RV64I-NEXT: mv s0, a0
379 ; RV64I-NEXT: addi a0, s0, 0
380 ; RV64I-NEXT: #NO_APP
381 ; RV64I-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
382 ; RV64I-NEXT: addi sp, sp, 16
384 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x8}"(i32 %a)
388 ; NOTE: This test uses `s0` (`x8`, `fp`) as an input, so it should be saved.
389 define i32 @explicit_register_s0(i32 %a) nounwind {
390 ; RV32I-LABEL: explicit_register_s0:
392 ; RV32I-NEXT: addi sp, sp, -16
393 ; RV32I-NEXT: sw s0, 12(sp) # 4-byte Folded Spill
394 ; RV32I-NEXT: mv s0, a0
396 ; RV32I-NEXT: addi a0, s0, 0
397 ; RV32I-NEXT: #NO_APP
398 ; RV32I-NEXT: lw s0, 12(sp) # 4-byte Folded Reload
399 ; RV32I-NEXT: addi sp, sp, 16
402 ; RV64I-LABEL: explicit_register_s0:
404 ; RV64I-NEXT: addi sp, sp, -16
405 ; RV64I-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
406 ; RV64I-NEXT: mv s0, a0
408 ; RV64I-NEXT: addi a0, s0, 0
409 ; RV64I-NEXT: #NO_APP
410 ; RV64I-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
411 ; RV64I-NEXT: addi sp, sp, 16
413 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{s0}"(i32 %a)
417 ; NOTE: This test uses `fp` (`x8`, `s0`) as an input, so it should be saved.
418 define i32 @explicit_register_fp(i32 %a) nounwind {
419 ; RV32I-LABEL: explicit_register_fp:
421 ; RV32I-NEXT: addi sp, sp, -16
422 ; RV32I-NEXT: sw s0, 12(sp) # 4-byte Folded Spill
423 ; RV32I-NEXT: mv s0, a0
425 ; RV32I-NEXT: addi a0, s0, 0
426 ; RV32I-NEXT: #NO_APP
427 ; RV32I-NEXT: lw s0, 12(sp) # 4-byte Folded Reload
428 ; RV32I-NEXT: addi sp, sp, 16
431 ; RV64I-LABEL: explicit_register_fp:
433 ; RV64I-NEXT: addi sp, sp, -16
434 ; RV64I-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
435 ; RV64I-NEXT: mv s0, a0
437 ; RV64I-NEXT: addi a0, s0, 0
438 ; RV64I-NEXT: #NO_APP
439 ; RV64I-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
440 ; RV64I-NEXT: addi sp, sp, 16
442 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{fp}"(i32 %a)
446 ; NOTE: This test uses `x9` (`s1`) as an input, so it should be saved.
447 define i32 @explicit_register_x9(i32 %a) nounwind {
448 ; RV32I-LABEL: explicit_register_x9:
450 ; RV32I-NEXT: addi sp, sp, -16
451 ; RV32I-NEXT: sw s1, 12(sp) # 4-byte Folded Spill
452 ; RV32I-NEXT: mv s1, a0
454 ; RV32I-NEXT: addi a0, s1, 0
455 ; RV32I-NEXT: #NO_APP
456 ; RV32I-NEXT: lw s1, 12(sp) # 4-byte Folded Reload
457 ; RV32I-NEXT: addi sp, sp, 16
460 ; RV64I-LABEL: explicit_register_x9:
462 ; RV64I-NEXT: addi sp, sp, -16
463 ; RV64I-NEXT: sd s1, 8(sp) # 8-byte Folded Spill
464 ; RV64I-NEXT: mv s1, a0
466 ; RV64I-NEXT: addi a0, s1, 0
467 ; RV64I-NEXT: #NO_APP
468 ; RV64I-NEXT: ld s1, 8(sp) # 8-byte Folded Reload
469 ; RV64I-NEXT: addi sp, sp, 16
471 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x9}"(i32 %a)
475 ; NOTE: This test uses `s1` (`x9`) as an input, so it should be saved.
476 define i32 @explicit_register_s1(i32 %a) nounwind {
477 ; RV32I-LABEL: explicit_register_s1:
479 ; RV32I-NEXT: addi sp, sp, -16
480 ; RV32I-NEXT: sw s1, 12(sp) # 4-byte Folded Spill
481 ; RV32I-NEXT: mv s1, a0
483 ; RV32I-NEXT: addi a0, s1, 0
484 ; RV32I-NEXT: #NO_APP
485 ; RV32I-NEXT: lw s1, 12(sp) # 4-byte Folded Reload
486 ; RV32I-NEXT: addi sp, sp, 16
489 ; RV64I-LABEL: explicit_register_s1:
491 ; RV64I-NEXT: addi sp, sp, -16
492 ; RV64I-NEXT: sd s1, 8(sp) # 8-byte Folded Spill
493 ; RV64I-NEXT: mv s1, a0
495 ; RV64I-NEXT: addi a0, s1, 0
496 ; RV64I-NEXT: #NO_APP
497 ; RV64I-NEXT: ld s1, 8(sp) # 8-byte Folded Reload
498 ; RV64I-NEXT: addi sp, sp, 16
500 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{s1}"(i32 %a)
504 define i32 @explicit_register_x10(i32 %a) nounwind {
505 ; RV32I-LABEL: explicit_register_x10:
508 ; RV32I-NEXT: addi a0, a0, 0
509 ; RV32I-NEXT: #NO_APP
512 ; RV64I-LABEL: explicit_register_x10:
515 ; RV64I-NEXT: addi a0, a0, 0
516 ; RV64I-NEXT: #NO_APP
518 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x10}"(i32 %a)
522 define i32 @explicit_register_a0(i32 %a) nounwind {
523 ; RV32I-LABEL: explicit_register_a0:
526 ; RV32I-NEXT: addi a0, a0, 0
527 ; RV32I-NEXT: #NO_APP
530 ; RV64I-LABEL: explicit_register_a0:
533 ; RV64I-NEXT: addi a0, a0, 0
534 ; RV64I-NEXT: #NO_APP
536 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{a0}"(i32 %a)
540 define i32 @explicit_register_x11(i32 %a) nounwind {
541 ; RV32I-LABEL: explicit_register_x11:
543 ; RV32I-NEXT: mv a1, a0
545 ; RV32I-NEXT: addi a0, a1, 0
546 ; RV32I-NEXT: #NO_APP
549 ; RV64I-LABEL: explicit_register_x11:
551 ; RV64I-NEXT: mv a1, a0
553 ; RV64I-NEXT: addi a0, a1, 0
554 ; RV64I-NEXT: #NO_APP
556 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x11}"(i32 %a)
560 define i32 @explicit_register_a1(i32 %a) nounwind {
561 ; RV32I-LABEL: explicit_register_a1:
563 ; RV32I-NEXT: mv a1, a0
565 ; RV32I-NEXT: addi a0, a1, 0
566 ; RV32I-NEXT: #NO_APP
569 ; RV64I-LABEL: explicit_register_a1:
571 ; RV64I-NEXT: mv a1, a0
573 ; RV64I-NEXT: addi a0, a1, 0
574 ; RV64I-NEXT: #NO_APP
576 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{a1}"(i32 %a)
580 define i32 @explicit_register_x12(i32 %a) nounwind {
581 ; RV32I-LABEL: explicit_register_x12:
583 ; RV32I-NEXT: mv a2, a0
585 ; RV32I-NEXT: addi a0, a2, 0
586 ; RV32I-NEXT: #NO_APP
589 ; RV64I-LABEL: explicit_register_x12:
591 ; RV64I-NEXT: mv a2, a0
593 ; RV64I-NEXT: addi a0, a2, 0
594 ; RV64I-NEXT: #NO_APP
596 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x12}"(i32 %a)
600 define i32 @explicit_register_a2(i32 %a) nounwind {
601 ; RV32I-LABEL: explicit_register_a2:
603 ; RV32I-NEXT: mv a2, a0
605 ; RV32I-NEXT: addi a0, a2, 0
606 ; RV32I-NEXT: #NO_APP
609 ; RV64I-LABEL: explicit_register_a2:
611 ; RV64I-NEXT: mv a2, a0
613 ; RV64I-NEXT: addi a0, a2, 0
614 ; RV64I-NEXT: #NO_APP
616 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{a2}"(i32 %a)
620 define i32 @explicit_register_x13(i32 %a) nounwind {
621 ; RV32I-LABEL: explicit_register_x13:
623 ; RV32I-NEXT: mv a3, a0
625 ; RV32I-NEXT: addi a0, a3, 0
626 ; RV32I-NEXT: #NO_APP
629 ; RV64I-LABEL: explicit_register_x13:
631 ; RV64I-NEXT: mv a3, a0
633 ; RV64I-NEXT: addi a0, a3, 0
634 ; RV64I-NEXT: #NO_APP
636 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x13}"(i32 %a)
640 define i32 @explicit_register_a3(i32 %a) nounwind {
641 ; RV32I-LABEL: explicit_register_a3:
643 ; RV32I-NEXT: mv a3, a0
645 ; RV32I-NEXT: addi a0, a3, 0
646 ; RV32I-NEXT: #NO_APP
649 ; RV64I-LABEL: explicit_register_a3:
651 ; RV64I-NEXT: mv a3, a0
653 ; RV64I-NEXT: addi a0, a3, 0
654 ; RV64I-NEXT: #NO_APP
656 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{a3}"(i32 %a)
660 define i32 @explicit_register_x14(i32 %a) nounwind {
661 ; RV32I-LABEL: explicit_register_x14:
663 ; RV32I-NEXT: mv a4, a0
665 ; RV32I-NEXT: addi a0, a4, 0
666 ; RV32I-NEXT: #NO_APP
669 ; RV64I-LABEL: explicit_register_x14:
671 ; RV64I-NEXT: mv a4, a0
673 ; RV64I-NEXT: addi a0, a4, 0
674 ; RV64I-NEXT: #NO_APP
676 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x14}"(i32 %a)
680 define i32 @explicit_register_a4(i32 %a) nounwind {
681 ; RV32I-LABEL: explicit_register_a4:
683 ; RV32I-NEXT: mv a4, a0
685 ; RV32I-NEXT: addi a0, a4, 0
686 ; RV32I-NEXT: #NO_APP
689 ; RV64I-LABEL: explicit_register_a4:
691 ; RV64I-NEXT: mv a4, a0
693 ; RV64I-NEXT: addi a0, a4, 0
694 ; RV64I-NEXT: #NO_APP
696 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{a4}"(i32 %a)
700 define i32 @explicit_register_x15(i32 %a) nounwind {
701 ; RV32I-LABEL: explicit_register_x15:
703 ; RV32I-NEXT: mv a5, a0
705 ; RV32I-NEXT: addi a0, a5, 0
706 ; RV32I-NEXT: #NO_APP
709 ; RV64I-LABEL: explicit_register_x15:
711 ; RV64I-NEXT: mv a5, a0
713 ; RV64I-NEXT: addi a0, a5, 0
714 ; RV64I-NEXT: #NO_APP
716 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x15}"(i32 %a)
720 define i32 @explicit_register_a5(i32 %a) nounwind {
721 ; RV32I-LABEL: explicit_register_a5:
723 ; RV32I-NEXT: mv a5, a0
725 ; RV32I-NEXT: addi a0, a5, 0
726 ; RV32I-NEXT: #NO_APP
729 ; RV64I-LABEL: explicit_register_a5:
731 ; RV64I-NEXT: mv a5, a0
733 ; RV64I-NEXT: addi a0, a5, 0
734 ; RV64I-NEXT: #NO_APP
736 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{a5}"(i32 %a)
740 define i32 @explicit_register_x16(i32 %a) nounwind {
741 ; RV32I-LABEL: explicit_register_x16:
743 ; RV32I-NEXT: mv a6, a0
745 ; RV32I-NEXT: addi a0, a6, 0
746 ; RV32I-NEXT: #NO_APP
749 ; RV64I-LABEL: explicit_register_x16:
751 ; RV64I-NEXT: mv a6, a0
753 ; RV64I-NEXT: addi a0, a6, 0
754 ; RV64I-NEXT: #NO_APP
756 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x16}"(i32 %a)
760 define i32 @explicit_register_a6(i32 %a) nounwind {
761 ; RV32I-LABEL: explicit_register_a6:
763 ; RV32I-NEXT: mv a6, a0
765 ; RV32I-NEXT: addi a0, a6, 0
766 ; RV32I-NEXT: #NO_APP
769 ; RV64I-LABEL: explicit_register_a6:
771 ; RV64I-NEXT: mv a6, a0
773 ; RV64I-NEXT: addi a0, a6, 0
774 ; RV64I-NEXT: #NO_APP
776 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{a6}"(i32 %a)
780 define i32 @explicit_register_x17(i32 %a) nounwind {
781 ; RV32I-LABEL: explicit_register_x17:
783 ; RV32I-NEXT: mv a7, a0
785 ; RV32I-NEXT: addi a0, a7, 0
786 ; RV32I-NEXT: #NO_APP
789 ; RV64I-LABEL: explicit_register_x17:
791 ; RV64I-NEXT: mv a7, a0
793 ; RV64I-NEXT: addi a0, a7, 0
794 ; RV64I-NEXT: #NO_APP
796 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x17}"(i32 %a)
800 define i32 @explicit_register_a7(i32 %a) nounwind {
801 ; RV32I-LABEL: explicit_register_a7:
803 ; RV32I-NEXT: mv a7, a0
805 ; RV32I-NEXT: addi a0, a7, 0
806 ; RV32I-NEXT: #NO_APP
809 ; RV64I-LABEL: explicit_register_a7:
811 ; RV64I-NEXT: mv a7, a0
813 ; RV64I-NEXT: addi a0, a7, 0
814 ; RV64I-NEXT: #NO_APP
816 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{a7}"(i32 %a)
820 ; NOTE: This test uses `x18` (`s2`) as an input, so it should be saved.
821 define i32 @explicit_register_x18(i32 %a) nounwind {
822 ; RV32I-LABEL: explicit_register_x18:
824 ; RV32I-NEXT: addi sp, sp, -16
825 ; RV32I-NEXT: sw s2, 12(sp) # 4-byte Folded Spill
826 ; RV32I-NEXT: mv s2, a0
828 ; RV32I-NEXT: addi a0, s2, 0
829 ; RV32I-NEXT: #NO_APP
830 ; RV32I-NEXT: lw s2, 12(sp) # 4-byte Folded Reload
831 ; RV32I-NEXT: addi sp, sp, 16
834 ; RV64I-LABEL: explicit_register_x18:
836 ; RV64I-NEXT: addi sp, sp, -16
837 ; RV64I-NEXT: sd s2, 8(sp) # 8-byte Folded Spill
838 ; RV64I-NEXT: mv s2, a0
840 ; RV64I-NEXT: addi a0, s2, 0
841 ; RV64I-NEXT: #NO_APP
842 ; RV64I-NEXT: ld s2, 8(sp) # 8-byte Folded Reload
843 ; RV64I-NEXT: addi sp, sp, 16
845 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x18}"(i32 %a)
849 ; NOTE: This test uses `s2` (`x18`) as an input, so it should be saved.
850 define i32 @explicit_register_s2(i32 %a) nounwind {
851 ; RV32I-LABEL: explicit_register_s2:
853 ; RV32I-NEXT: addi sp, sp, -16
854 ; RV32I-NEXT: sw s2, 12(sp) # 4-byte Folded Spill
855 ; RV32I-NEXT: mv s2, a0
857 ; RV32I-NEXT: addi a0, s2, 0
858 ; RV32I-NEXT: #NO_APP
859 ; RV32I-NEXT: lw s2, 12(sp) # 4-byte Folded Reload
860 ; RV32I-NEXT: addi sp, sp, 16
863 ; RV64I-LABEL: explicit_register_s2:
865 ; RV64I-NEXT: addi sp, sp, -16
866 ; RV64I-NEXT: sd s2, 8(sp) # 8-byte Folded Spill
867 ; RV64I-NEXT: mv s2, a0
869 ; RV64I-NEXT: addi a0, s2, 0
870 ; RV64I-NEXT: #NO_APP
871 ; RV64I-NEXT: ld s2, 8(sp) # 8-byte Folded Reload
872 ; RV64I-NEXT: addi sp, sp, 16
874 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{s2}"(i32 %a)
878 ; NOTE: This test uses `x19` (`s3`) as an input, so it should be saved.
879 define i32 @explicit_register_x19(i32 %a) nounwind {
880 ; RV32I-LABEL: explicit_register_x19:
882 ; RV32I-NEXT: addi sp, sp, -16
883 ; RV32I-NEXT: sw s3, 12(sp) # 4-byte Folded Spill
884 ; RV32I-NEXT: mv s3, a0
886 ; RV32I-NEXT: addi a0, s3, 0
887 ; RV32I-NEXT: #NO_APP
888 ; RV32I-NEXT: lw s3, 12(sp) # 4-byte Folded Reload
889 ; RV32I-NEXT: addi sp, sp, 16
892 ; RV64I-LABEL: explicit_register_x19:
894 ; RV64I-NEXT: addi sp, sp, -16
895 ; RV64I-NEXT: sd s3, 8(sp) # 8-byte Folded Spill
896 ; RV64I-NEXT: mv s3, a0
898 ; RV64I-NEXT: addi a0, s3, 0
899 ; RV64I-NEXT: #NO_APP
900 ; RV64I-NEXT: ld s3, 8(sp) # 8-byte Folded Reload
901 ; RV64I-NEXT: addi sp, sp, 16
903 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x19}"(i32 %a)
907 ; NOTE: This test uses `s3` (`x19`) as an input, so it should be saved.
908 define i32 @explicit_register_s3(i32 %a) nounwind {
909 ; RV32I-LABEL: explicit_register_s3:
911 ; RV32I-NEXT: addi sp, sp, -16
912 ; RV32I-NEXT: sw s3, 12(sp) # 4-byte Folded Spill
913 ; RV32I-NEXT: mv s3, a0
915 ; RV32I-NEXT: addi a0, s3, 0
916 ; RV32I-NEXT: #NO_APP
917 ; RV32I-NEXT: lw s3, 12(sp) # 4-byte Folded Reload
918 ; RV32I-NEXT: addi sp, sp, 16
921 ; RV64I-LABEL: explicit_register_s3:
923 ; RV64I-NEXT: addi sp, sp, -16
924 ; RV64I-NEXT: sd s3, 8(sp) # 8-byte Folded Spill
925 ; RV64I-NEXT: mv s3, a0
927 ; RV64I-NEXT: addi a0, s3, 0
928 ; RV64I-NEXT: #NO_APP
929 ; RV64I-NEXT: ld s3, 8(sp) # 8-byte Folded Reload
930 ; RV64I-NEXT: addi sp, sp, 16
932 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{s3}"(i32 %a)
936 ; NOTE: This test uses `x20` (`s4`) as an input, so it should be saved.
937 define i32 @explicit_register_x20(i32 %a) nounwind {
938 ; RV32I-LABEL: explicit_register_x20:
940 ; RV32I-NEXT: addi sp, sp, -16
941 ; RV32I-NEXT: sw s4, 12(sp) # 4-byte Folded Spill
942 ; RV32I-NEXT: mv s4, a0
944 ; RV32I-NEXT: addi a0, s4, 0
945 ; RV32I-NEXT: #NO_APP
946 ; RV32I-NEXT: lw s4, 12(sp) # 4-byte Folded Reload
947 ; RV32I-NEXT: addi sp, sp, 16
950 ; RV64I-LABEL: explicit_register_x20:
952 ; RV64I-NEXT: addi sp, sp, -16
953 ; RV64I-NEXT: sd s4, 8(sp) # 8-byte Folded Spill
954 ; RV64I-NEXT: mv s4, a0
956 ; RV64I-NEXT: addi a0, s4, 0
957 ; RV64I-NEXT: #NO_APP
958 ; RV64I-NEXT: ld s4, 8(sp) # 8-byte Folded Reload
959 ; RV64I-NEXT: addi sp, sp, 16
961 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x20}"(i32 %a)
965 ; NOTE: This test uses `s4` (`x20`) as an input, so it should be saved.
966 define i32 @explicit_register_s4(i32 %a) nounwind {
967 ; RV32I-LABEL: explicit_register_s4:
969 ; RV32I-NEXT: addi sp, sp, -16
970 ; RV32I-NEXT: sw s4, 12(sp) # 4-byte Folded Spill
971 ; RV32I-NEXT: mv s4, a0
973 ; RV32I-NEXT: addi a0, s4, 0
974 ; RV32I-NEXT: #NO_APP
975 ; RV32I-NEXT: lw s4, 12(sp) # 4-byte Folded Reload
976 ; RV32I-NEXT: addi sp, sp, 16
979 ; RV64I-LABEL: explicit_register_s4:
981 ; RV64I-NEXT: addi sp, sp, -16
982 ; RV64I-NEXT: sd s4, 8(sp) # 8-byte Folded Spill
983 ; RV64I-NEXT: mv s4, a0
985 ; RV64I-NEXT: addi a0, s4, 0
986 ; RV64I-NEXT: #NO_APP
987 ; RV64I-NEXT: ld s4, 8(sp) # 8-byte Folded Reload
988 ; RV64I-NEXT: addi sp, sp, 16
990 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{s4}"(i32 %a)
994 ; NOTE: This test uses `x21` (`s5`) as an input, so it should be saved.
995 define i32 @explicit_register_x21(i32 %a) nounwind {
996 ; RV32I-LABEL: explicit_register_x21:
998 ; RV32I-NEXT: addi sp, sp, -16
999 ; RV32I-NEXT: sw s5, 12(sp) # 4-byte Folded Spill
1000 ; RV32I-NEXT: mv s5, a0
1002 ; RV32I-NEXT: addi a0, s5, 0
1003 ; RV32I-NEXT: #NO_APP
1004 ; RV32I-NEXT: lw s5, 12(sp) # 4-byte Folded Reload
1005 ; RV32I-NEXT: addi sp, sp, 16
1008 ; RV64I-LABEL: explicit_register_x21:
1010 ; RV64I-NEXT: addi sp, sp, -16
1011 ; RV64I-NEXT: sd s5, 8(sp) # 8-byte Folded Spill
1012 ; RV64I-NEXT: mv s5, a0
1014 ; RV64I-NEXT: addi a0, s5, 0
1015 ; RV64I-NEXT: #NO_APP
1016 ; RV64I-NEXT: ld s5, 8(sp) # 8-byte Folded Reload
1017 ; RV64I-NEXT: addi sp, sp, 16
1019 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x21}"(i32 %a)
1023 ; NOTE: This test uses `s5` (`x21`) as an input, so it should be saved.
1024 define i32 @explicit_register_s5(i32 %a) nounwind {
1025 ; RV32I-LABEL: explicit_register_s5:
1027 ; RV32I-NEXT: addi sp, sp, -16
1028 ; RV32I-NEXT: sw s5, 12(sp) # 4-byte Folded Spill
1029 ; RV32I-NEXT: mv s5, a0
1031 ; RV32I-NEXT: addi a0, s5, 0
1032 ; RV32I-NEXT: #NO_APP
1033 ; RV32I-NEXT: lw s5, 12(sp) # 4-byte Folded Reload
1034 ; RV32I-NEXT: addi sp, sp, 16
1037 ; RV64I-LABEL: explicit_register_s5:
1039 ; RV64I-NEXT: addi sp, sp, -16
1040 ; RV64I-NEXT: sd s5, 8(sp) # 8-byte Folded Spill
1041 ; RV64I-NEXT: mv s5, a0
1043 ; RV64I-NEXT: addi a0, s5, 0
1044 ; RV64I-NEXT: #NO_APP
1045 ; RV64I-NEXT: ld s5, 8(sp) # 8-byte Folded Reload
1046 ; RV64I-NEXT: addi sp, sp, 16
1048 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{s5}"(i32 %a)
1052 ; NOTE: This test uses `x22` (`s6`) as an input, so it should be saved.
1053 define i32 @explicit_register_x22(i32 %a) nounwind {
1054 ; RV32I-LABEL: explicit_register_x22:
1056 ; RV32I-NEXT: addi sp, sp, -16
1057 ; RV32I-NEXT: sw s6, 12(sp) # 4-byte Folded Spill
1058 ; RV32I-NEXT: mv s6, a0
1060 ; RV32I-NEXT: addi a0, s6, 0
1061 ; RV32I-NEXT: #NO_APP
1062 ; RV32I-NEXT: lw s6, 12(sp) # 4-byte Folded Reload
1063 ; RV32I-NEXT: addi sp, sp, 16
1066 ; RV64I-LABEL: explicit_register_x22:
1068 ; RV64I-NEXT: addi sp, sp, -16
1069 ; RV64I-NEXT: sd s6, 8(sp) # 8-byte Folded Spill
1070 ; RV64I-NEXT: mv s6, a0
1072 ; RV64I-NEXT: addi a0, s6, 0
1073 ; RV64I-NEXT: #NO_APP
1074 ; RV64I-NEXT: ld s6, 8(sp) # 8-byte Folded Reload
1075 ; RV64I-NEXT: addi sp, sp, 16
1077 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x22}"(i32 %a)
1081 ; NOTE: This test uses `s6` (`x22`) as an input, so it should be saved.
1082 define i32 @explicit_register_s6(i32 %a) nounwind {
1083 ; RV32I-LABEL: explicit_register_s6:
1085 ; RV32I-NEXT: addi sp, sp, -16
1086 ; RV32I-NEXT: sw s6, 12(sp) # 4-byte Folded Spill
1087 ; RV32I-NEXT: mv s6, a0
1089 ; RV32I-NEXT: addi a0, s6, 0
1090 ; RV32I-NEXT: #NO_APP
1091 ; RV32I-NEXT: lw s6, 12(sp) # 4-byte Folded Reload
1092 ; RV32I-NEXT: addi sp, sp, 16
1095 ; RV64I-LABEL: explicit_register_s6:
1097 ; RV64I-NEXT: addi sp, sp, -16
1098 ; RV64I-NEXT: sd s6, 8(sp) # 8-byte Folded Spill
1099 ; RV64I-NEXT: mv s6, a0
1101 ; RV64I-NEXT: addi a0, s6, 0
1102 ; RV64I-NEXT: #NO_APP
1103 ; RV64I-NEXT: ld s6, 8(sp) # 8-byte Folded Reload
1104 ; RV64I-NEXT: addi sp, sp, 16
1106 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{s6}"(i32 %a)
1110 ; NOTE: This test uses `x23` (`s7`) as an input, so it should be saved.
1111 define i32 @explicit_register_x23(i32 %a) nounwind {
1112 ; RV32I-LABEL: explicit_register_x23:
1114 ; RV32I-NEXT: addi sp, sp, -16
1115 ; RV32I-NEXT: sw s7, 12(sp) # 4-byte Folded Spill
1116 ; RV32I-NEXT: mv s7, a0
1118 ; RV32I-NEXT: addi a0, s7, 0
1119 ; RV32I-NEXT: #NO_APP
1120 ; RV32I-NEXT: lw s7, 12(sp) # 4-byte Folded Reload
1121 ; RV32I-NEXT: addi sp, sp, 16
1124 ; RV64I-LABEL: explicit_register_x23:
1126 ; RV64I-NEXT: addi sp, sp, -16
1127 ; RV64I-NEXT: sd s7, 8(sp) # 8-byte Folded Spill
1128 ; RV64I-NEXT: mv s7, a0
1130 ; RV64I-NEXT: addi a0, s7, 0
1131 ; RV64I-NEXT: #NO_APP
1132 ; RV64I-NEXT: ld s7, 8(sp) # 8-byte Folded Reload
1133 ; RV64I-NEXT: addi sp, sp, 16
1135 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x23}"(i32 %a)
1139 ; NOTE: This test uses `s7` (`x23`) as an input, so it should be saved.
1140 define i32 @explicit_register_s7(i32 %a) nounwind {
1141 ; RV32I-LABEL: explicit_register_s7:
1143 ; RV32I-NEXT: addi sp, sp, -16
1144 ; RV32I-NEXT: sw s7, 12(sp) # 4-byte Folded Spill
1145 ; RV32I-NEXT: mv s7, a0
1147 ; RV32I-NEXT: addi a0, s7, 0
1148 ; RV32I-NEXT: #NO_APP
1149 ; RV32I-NEXT: lw s7, 12(sp) # 4-byte Folded Reload
1150 ; RV32I-NEXT: addi sp, sp, 16
1153 ; RV64I-LABEL: explicit_register_s7:
1155 ; RV64I-NEXT: addi sp, sp, -16
1156 ; RV64I-NEXT: sd s7, 8(sp) # 8-byte Folded Spill
1157 ; RV64I-NEXT: mv s7, a0
1159 ; RV64I-NEXT: addi a0, s7, 0
1160 ; RV64I-NEXT: #NO_APP
1161 ; RV64I-NEXT: ld s7, 8(sp) # 8-byte Folded Reload
1162 ; RV64I-NEXT: addi sp, sp, 16
1164 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{s7}"(i32 %a)
1168 ; NOTE: This test uses `x24` (`s8`) as an input, so it should be saved.
1169 define i32 @explicit_register_x24(i32 %a) nounwind {
1170 ; RV32I-LABEL: explicit_register_x24:
1172 ; RV32I-NEXT: addi sp, sp, -16
1173 ; RV32I-NEXT: sw s8, 12(sp) # 4-byte Folded Spill
1174 ; RV32I-NEXT: mv s8, a0
1176 ; RV32I-NEXT: addi a0, s8, 0
1177 ; RV32I-NEXT: #NO_APP
1178 ; RV32I-NEXT: lw s8, 12(sp) # 4-byte Folded Reload
1179 ; RV32I-NEXT: addi sp, sp, 16
1182 ; RV64I-LABEL: explicit_register_x24:
1184 ; RV64I-NEXT: addi sp, sp, -16
1185 ; RV64I-NEXT: sd s8, 8(sp) # 8-byte Folded Spill
1186 ; RV64I-NEXT: mv s8, a0
1188 ; RV64I-NEXT: addi a0, s8, 0
1189 ; RV64I-NEXT: #NO_APP
1190 ; RV64I-NEXT: ld s8, 8(sp) # 8-byte Folded Reload
1191 ; RV64I-NEXT: addi sp, sp, 16
1193 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x24}"(i32 %a)
1197 ; NOTE: This test uses `s8` (`x24`) as an input, so it should be saved.
1198 define i32 @explicit_register_s8(i32 %a) nounwind {
1199 ; RV32I-LABEL: explicit_register_s8:
1201 ; RV32I-NEXT: addi sp, sp, -16
1202 ; RV32I-NEXT: sw s8, 12(sp) # 4-byte Folded Spill
1203 ; RV32I-NEXT: mv s8, a0
1205 ; RV32I-NEXT: addi a0, s8, 0
1206 ; RV32I-NEXT: #NO_APP
1207 ; RV32I-NEXT: lw s8, 12(sp) # 4-byte Folded Reload
1208 ; RV32I-NEXT: addi sp, sp, 16
1211 ; RV64I-LABEL: explicit_register_s8:
1213 ; RV64I-NEXT: addi sp, sp, -16
1214 ; RV64I-NEXT: sd s8, 8(sp) # 8-byte Folded Spill
1215 ; RV64I-NEXT: mv s8, a0
1217 ; RV64I-NEXT: addi a0, s8, 0
1218 ; RV64I-NEXT: #NO_APP
1219 ; RV64I-NEXT: ld s8, 8(sp) # 8-byte Folded Reload
1220 ; RV64I-NEXT: addi sp, sp, 16
1222 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{s8}"(i32 %a)
1226 ; NOTE: This test uses `x25` (`s9`) as an input, so it should be saved.
1227 define i32 @explicit_register_x25(i32 %a) nounwind {
1228 ; RV32I-LABEL: explicit_register_x25:
1230 ; RV32I-NEXT: addi sp, sp, -16
1231 ; RV32I-NEXT: sw s9, 12(sp) # 4-byte Folded Spill
1232 ; RV32I-NEXT: mv s9, a0
1234 ; RV32I-NEXT: addi a0, s9, 0
1235 ; RV32I-NEXT: #NO_APP
1236 ; RV32I-NEXT: lw s9, 12(sp) # 4-byte Folded Reload
1237 ; RV32I-NEXT: addi sp, sp, 16
1240 ; RV64I-LABEL: explicit_register_x25:
1242 ; RV64I-NEXT: addi sp, sp, -16
1243 ; RV64I-NEXT: sd s9, 8(sp) # 8-byte Folded Spill
1244 ; RV64I-NEXT: mv s9, a0
1246 ; RV64I-NEXT: addi a0, s9, 0
1247 ; RV64I-NEXT: #NO_APP
1248 ; RV64I-NEXT: ld s9, 8(sp) # 8-byte Folded Reload
1249 ; RV64I-NEXT: addi sp, sp, 16
1251 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x25}"(i32 %a)
1255 ; NOTE: This test uses `s9` (`x25`) as an input, so it should be saved.
1256 define i32 @explicit_register_s9(i32 %a) nounwind {
1257 ; RV32I-LABEL: explicit_register_s9:
1259 ; RV32I-NEXT: addi sp, sp, -16
1260 ; RV32I-NEXT: sw s9, 12(sp) # 4-byte Folded Spill
1261 ; RV32I-NEXT: mv s9, a0
1263 ; RV32I-NEXT: addi a0, s9, 0
1264 ; RV32I-NEXT: #NO_APP
1265 ; RV32I-NEXT: lw s9, 12(sp) # 4-byte Folded Reload
1266 ; RV32I-NEXT: addi sp, sp, 16
1269 ; RV64I-LABEL: explicit_register_s9:
1271 ; RV64I-NEXT: addi sp, sp, -16
1272 ; RV64I-NEXT: sd s9, 8(sp) # 8-byte Folded Spill
1273 ; RV64I-NEXT: mv s9, a0
1275 ; RV64I-NEXT: addi a0, s9, 0
1276 ; RV64I-NEXT: #NO_APP
1277 ; RV64I-NEXT: ld s9, 8(sp) # 8-byte Folded Reload
1278 ; RV64I-NEXT: addi sp, sp, 16
1280 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{s9}"(i32 %a)
1284 ; NOTE: This test uses `x26` (`s10`) as an input, so it should be saved.
1285 define i32 @explicit_register_x26(i32 %a) nounwind {
1286 ; RV32I-LABEL: explicit_register_x26:
1288 ; RV32I-NEXT: addi sp, sp, -16
1289 ; RV32I-NEXT: sw s10, 12(sp) # 4-byte Folded Spill
1290 ; RV32I-NEXT: mv s10, a0
1292 ; RV32I-NEXT: addi a0, s10, 0
1293 ; RV32I-NEXT: #NO_APP
1294 ; RV32I-NEXT: lw s10, 12(sp) # 4-byte Folded Reload
1295 ; RV32I-NEXT: addi sp, sp, 16
1298 ; RV64I-LABEL: explicit_register_x26:
1300 ; RV64I-NEXT: addi sp, sp, -16
1301 ; RV64I-NEXT: sd s10, 8(sp) # 8-byte Folded Spill
1302 ; RV64I-NEXT: mv s10, a0
1304 ; RV64I-NEXT: addi a0, s10, 0
1305 ; RV64I-NEXT: #NO_APP
1306 ; RV64I-NEXT: ld s10, 8(sp) # 8-byte Folded Reload
1307 ; RV64I-NEXT: addi sp, sp, 16
1309 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x26}"(i32 %a)
1313 ; NOTE: This test uses `s10` (`x28`) as an input, so it should be saved.
1314 define i32 @explicit_register_s10(i32 %a) nounwind {
1315 ; RV32I-LABEL: explicit_register_s10:
1317 ; RV32I-NEXT: addi sp, sp, -16
1318 ; RV32I-NEXT: sw s10, 12(sp) # 4-byte Folded Spill
1319 ; RV32I-NEXT: mv s10, a0
1321 ; RV32I-NEXT: addi a0, s10, 0
1322 ; RV32I-NEXT: #NO_APP
1323 ; RV32I-NEXT: lw s10, 12(sp) # 4-byte Folded Reload
1324 ; RV32I-NEXT: addi sp, sp, 16
1327 ; RV64I-LABEL: explicit_register_s10:
1329 ; RV64I-NEXT: addi sp, sp, -16
1330 ; RV64I-NEXT: sd s10, 8(sp) # 8-byte Folded Spill
1331 ; RV64I-NEXT: mv s10, a0
1333 ; RV64I-NEXT: addi a0, s10, 0
1334 ; RV64I-NEXT: #NO_APP
1335 ; RV64I-NEXT: ld s10, 8(sp) # 8-byte Folded Reload
1336 ; RV64I-NEXT: addi sp, sp, 16
1338 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{s10}"(i32 %a)
1342 ; NOTE: This test uses `x27` (`s11`) as an input, so it should be saved.
1343 define i32 @explicit_register_x27(i32 %a) nounwind {
1344 ; RV32I-LABEL: explicit_register_x27:
1346 ; RV32I-NEXT: addi sp, sp, -16
1347 ; RV32I-NEXT: sw s11, 12(sp) # 4-byte Folded Spill
1348 ; RV32I-NEXT: mv s11, a0
1350 ; RV32I-NEXT: addi a0, s11, 0
1351 ; RV32I-NEXT: #NO_APP
1352 ; RV32I-NEXT: lw s11, 12(sp) # 4-byte Folded Reload
1353 ; RV32I-NEXT: addi sp, sp, 16
1356 ; RV64I-LABEL: explicit_register_x27:
1358 ; RV64I-NEXT: addi sp, sp, -16
1359 ; RV64I-NEXT: sd s11, 8(sp) # 8-byte Folded Spill
1360 ; RV64I-NEXT: mv s11, a0
1362 ; RV64I-NEXT: addi a0, s11, 0
1363 ; RV64I-NEXT: #NO_APP
1364 ; RV64I-NEXT: ld s11, 8(sp) # 8-byte Folded Reload
1365 ; RV64I-NEXT: addi sp, sp, 16
1367 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x27}"(i32 %a)
1371 ; NOTE: This test uses `s11` (`x27`) as an input, so it should be saved.
1372 define i32 @explicit_register_s11(i32 %a) nounwind {
1373 ; RV32I-LABEL: explicit_register_s11:
1375 ; RV32I-NEXT: addi sp, sp, -16
1376 ; RV32I-NEXT: sw s11, 12(sp) # 4-byte Folded Spill
1377 ; RV32I-NEXT: mv s11, a0
1379 ; RV32I-NEXT: addi a0, s11, 0
1380 ; RV32I-NEXT: #NO_APP
1381 ; RV32I-NEXT: lw s11, 12(sp) # 4-byte Folded Reload
1382 ; RV32I-NEXT: addi sp, sp, 16
1385 ; RV64I-LABEL: explicit_register_s11:
1387 ; RV64I-NEXT: addi sp, sp, -16
1388 ; RV64I-NEXT: sd s11, 8(sp) # 8-byte Folded Spill
1389 ; RV64I-NEXT: mv s11, a0
1391 ; RV64I-NEXT: addi a0, s11, 0
1392 ; RV64I-NEXT: #NO_APP
1393 ; RV64I-NEXT: ld s11, 8(sp) # 8-byte Folded Reload
1394 ; RV64I-NEXT: addi sp, sp, 16
1396 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{s11}"(i32 %a)
1400 define i32 @explicit_register_x28(i32 %a) nounwind {
1401 ; RV32I-LABEL: explicit_register_x28:
1403 ; RV32I-NEXT: mv t3, a0
1405 ; RV32I-NEXT: addi a0, t3, 0
1406 ; RV32I-NEXT: #NO_APP
1409 ; RV64I-LABEL: explicit_register_x28:
1411 ; RV64I-NEXT: mv t3, a0
1413 ; RV64I-NEXT: addi a0, t3, 0
1414 ; RV64I-NEXT: #NO_APP
1416 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x28}"(i32 %a)
1420 define i32 @explicit_register_t3(i32 %a) nounwind {
1421 ; RV32I-LABEL: explicit_register_t3:
1423 ; RV32I-NEXT: mv t3, a0
1425 ; RV32I-NEXT: addi a0, t3, 0
1426 ; RV32I-NEXT: #NO_APP
1429 ; RV64I-LABEL: explicit_register_t3:
1431 ; RV64I-NEXT: mv t3, a0
1433 ; RV64I-NEXT: addi a0, t3, 0
1434 ; RV64I-NEXT: #NO_APP
1436 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{t3}"(i32 %a)
1440 define i32 @explicit_register_x29(i32 %a) nounwind {
1441 ; RV32I-LABEL: explicit_register_x29:
1443 ; RV32I-NEXT: mv t4, a0
1445 ; RV32I-NEXT: addi a0, t4, 0
1446 ; RV32I-NEXT: #NO_APP
1449 ; RV64I-LABEL: explicit_register_x29:
1451 ; RV64I-NEXT: mv t4, a0
1453 ; RV64I-NEXT: addi a0, t4, 0
1454 ; RV64I-NEXT: #NO_APP
1456 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x29}"(i32 %a)
1460 define i32 @explicit_register_t4(i32 %a) nounwind {
1461 ; RV32I-LABEL: explicit_register_t4:
1463 ; RV32I-NEXT: mv t4, a0
1465 ; RV32I-NEXT: addi a0, t4, 0
1466 ; RV32I-NEXT: #NO_APP
1469 ; RV64I-LABEL: explicit_register_t4:
1471 ; RV64I-NEXT: mv t4, a0
1473 ; RV64I-NEXT: addi a0, t4, 0
1474 ; RV64I-NEXT: #NO_APP
1476 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{t4}"(i32 %a)
1480 define i32 @explicit_register_x30(i32 %a) nounwind {
1481 ; RV32I-LABEL: explicit_register_x30:
1483 ; RV32I-NEXT: mv t5, a0
1485 ; RV32I-NEXT: addi a0, t5, 0
1486 ; RV32I-NEXT: #NO_APP
1489 ; RV64I-LABEL: explicit_register_x30:
1491 ; RV64I-NEXT: mv t5, a0
1493 ; RV64I-NEXT: addi a0, t5, 0
1494 ; RV64I-NEXT: #NO_APP
1496 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x30}"(i32 %a)
1500 define i32 @explicit_register_t5(i32 %a) nounwind {
1501 ; RV32I-LABEL: explicit_register_t5:
1503 ; RV32I-NEXT: mv t5, a0
1505 ; RV32I-NEXT: addi a0, t5, 0
1506 ; RV32I-NEXT: #NO_APP
1509 ; RV64I-LABEL: explicit_register_t5:
1511 ; RV64I-NEXT: mv t5, a0
1513 ; RV64I-NEXT: addi a0, t5, 0
1514 ; RV64I-NEXT: #NO_APP
1516 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{t5}"(i32 %a)
1520 define i32 @explicit_register_x31(i32 %a) nounwind {
1521 ; RV32I-LABEL: explicit_register_x31:
1523 ; RV32I-NEXT: mv t6, a0
1525 ; RV32I-NEXT: addi a0, t6, 0
1526 ; RV32I-NEXT: #NO_APP
1529 ; RV64I-LABEL: explicit_register_x31:
1531 ; RV64I-NEXT: mv t6, a0
1533 ; RV64I-NEXT: addi a0, t6, 0
1534 ; RV64I-NEXT: #NO_APP
1536 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{x31}"(i32 %a)
1540 define i32 @explicit_register_t6(i32 %a) nounwind {
1541 ; RV32I-LABEL: explicit_register_t6:
1543 ; RV32I-NEXT: mv t6, a0
1545 ; RV32I-NEXT: addi a0, t6, 0
1546 ; RV32I-NEXT: #NO_APP
1549 ; RV64I-LABEL: explicit_register_t6:
1551 ; RV64I-NEXT: mv t6, a0
1553 ; RV64I-NEXT: addi a0, t6, 0
1554 ; RV64I-NEXT: #NO_APP
1556 %1 = tail call i32 asm "addi $0, $1, 0", "=r,{t6}"(i32 %a)