llvm-project/llvm/test/CodeGen/AVR/pseudo
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
..
ADCWRdRr.mir
ADDWRdRr.mir
ANDIWRdK.mir
ANDWRdRr.mir
ASRBNRd.mir
ASRWNRd.mir
ASRWRd.mir
COMWRd.mir
COPY.mir [AVR] Fix expanding MOVW for overlapping registers 2022-06-26 17:20:07 +08:00
CPCWRdRr.mir
CPWRdRr.mir
EORWRdRr.mir
FRMIDX.mir
INWRdA.mir
LDDWRdPtrQ.mir
LDDWRdYQ.mir
LDIWRdK.mir
LDSWRdK.mir
LDWRdPtr.mir
LDWRdPtrPd.mir
LDWRdPtrPi.mir
LSLBNRd.mir
LSLWNRd.mir
LSLWRd.mir
LSRBNRd.mir
LSRWNRd.mir
LSRWRd.mir
NEGWRd.mir [AVR] Only push and clear R1 in interrupts when necessary 2022-08-15 14:29:38 +02:00
ORIWRdK.mir
ORWRdRr.mir
OUTWARr.mir
POPWRd.mir
PUSHWRr.mir
ROLBrd.mir [AVR] Only push and clear R1 in interrupts when necessary 2022-08-15 14:29:38 +02:00
SBCIWRdK.mir
SBCWRdRr.mir
SEXT.mir
STDWPtrQRr.mir [AVR] Merge AVRRelaxMemOperations into AVRExpandPseudoInsts 2022-04-11 02:42:13 +00:00
STSWKRr.mir
STWPtrPdRr.mir
STWPtrPiRr.mir
STWPtrRr.mir
SUBIWRdK.mir
SUBWRdRr.mir
ZEXT.mir