llvm-project/llvm/test/CodeGen/AVR
Ayke van Laethem a560e57a7e
[AVR] Only push and clear R1 in interrupts when necessary
R1 is a reserved register, but LLVM gives the APIs to know when it is
used or not. So this patch uses these APIs to only save/clear/restore R1
in interrupts when necessary.

The main issue here was getting inline assembly to work. One could argue
that this is the job of Clang, but for consistency I've made sure that
R1 is always usable in inline assembly even if that means clearing it
when it might not be needed.

Information on inline assembly in AVR can be found here:

https://www.nongnu.org/avr-libc/user-manual/inline_asm.html#asm_code

Essentially, this seems to suggest that r1 can be freely used in avr-gcc
inline assembly, even without specifying it as an input operand.

Differential Revision: https://reviews.llvm.org/D117426
2022-08-15 14:29:38 +02:00
..
atomics [FileCheck] Catch missspelled directives. 2022-05-26 11:37:19 +01:00
calling-conv/c [AVR] Reject/Reserve R0~R15 on AVRTiny. 2022-03-24 02:33:51 +00:00
features
inline-asm [Tests] Add elementtype attribute to indirect inline asm operands (NFC) 2022-01-06 14:23:51 +01:00
integration
intrinsics
pseudo [AVR] Only push and clear R1 in interrupts when necessary 2022-08-15 14:29:38 +02:00
PR31344.ll
PR31345.ll
PR37143.ll
add.ll
alloca.ll
and.ll
avr-rust-issue-123.ll
block-address-is-in-progmem-space.ll
branch-relaxation-long.ll
branch-relaxation.ll
brind.ll
call.ll [AVR] Generate 'rcall' instead of 'call' on avr2 and avr25 2022-03-23 02:00:15 +00:00
clear-bss.ll
cmp.ll
com.ll
copy-data-to-ram.ll
ctlz.ll
ctors.ll
ctpop.ll [TwoAddressInstructionPass] Improve the SrcRegMap and DstRegMap computation 2021-10-11 15:28:31 -07:00
cttz.ll
directmem.ll
div.ll
dynalloca.ll [AVR] Remove redundant dynalloca SP save/restore pass 2022-01-19 14:22:13 +01:00
elpm.ll [AVR] Generate ELPM for loading byte/word from extended program memory 2022-01-20 02:53:10 +00:00
eor.ll
expand-integer-failure.ll
frame.ll
frmidx-iterator-bug.ll
global-aliases.ll [AVR][MC] Emit some aliases for GPRs and IO registers 2022-03-24 02:08:22 +00:00
hardware-mul.ll [TwoAddressInstructionPass] Improve the SrcRegMap and DstRegMap computation 2021-10-11 15:28:31 -07:00
high-pressure-on-ptrregs.ll
icall-func-pointer-correct-addr-space.ll
impossible-reg-to-reg-copy.ll
interrupts.ll [AVR] Only push and clear R1 in interrupts when necessary 2022-08-15 14:29:38 +02:00
io.ll
issue-cannot-select-bswap.ll
issue-regalloc-stackframe-folding-earlyclobber.ll
jmp-long.ll
large-return-size.ll
lit.local.cfg
load.ll
lower-formal-args-struct-return.ll
lower-formal-arguments-assertion.ll
lpmx.ll [AVR] Remove regalloc workaround for LDDWRdPtrQ 2022-01-23 17:08:00 +01:00
neg.ll
no-print-operand-twice.ll
or.ll
pr43443-ctor-alias.ll [AVR] Fix a potential assert failure 2022-02-11 02:25:58 +00:00
pre-schedule.ll
progmem-extended.ll
progmem.ll
rem.ll
return.ll
rot.ll
runtime-trig.ll
rust-avr-bug-37.ll
rust-avr-bug-95.ll
rust-avr-bug-99.ll
rust-avr-bug-112.ll
rust-bug-98167.ll [AVR] Fix expanding MOVW for overlapping registers 2022-06-26 17:20:07 +08:00
rust-trait-object.ll
sections.ll [AVR][MC] Generate section '.progmemX.data' for extended flash banks 2022-01-20 02:53:10 +00:00
select-must-add-unconditional-jump.ll
sext.ll
shift-expand.ll
shift.ll [AVR] Optimize int16 airthmetic right shift for shift amount 7/14/15 2022-03-26 06:53:27 +00:00
sign-extension.ll [AVR] Optimize int16 airthmetic right shift for shift amount 7/14/15 2022-03-26 06:53:27 +00:00
smul-with-overflow.ll [AVR] Make use of the constant value 0 in R1 2022-01-23 17:08:01 +01:00
software-mul.ll
std-ldd-immediate-overflow.ll
stdwstk.ll [AVR] Always expand STDSPQRr & STDWSPQRr 2022-05-05 03:10:59 +00:00
store-undef.ll [AVR] Make use of the constant value 0 in R1 2022-01-23 17:08:01 +01:00
store.ll
struct.ll
sub.ll
trunc.ll
umul-with-overflow.ll [AVR] Make use of the constant value 0 in R1 2022-01-23 17:08:01 +01:00
umul.with.overflow.i16-bug.ll
unaligned-atomic-ops.ll [AVR] Support unaligned store 2022-08-15 14:29:37 +02:00
varargs.ll
xor.ll
zeroreg.ll [AVR] Only push and clear R1 in interrupts when necessary 2022-08-15 14:29:38 +02:00
zext.ll