[PATCH] D121672: [AVR] Reject/Reserve R0~R15 on AVRTiny

Ayke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 23 10:06:05 PDT 2022


aykevl accepted this revision.
aykevl added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/lib/Target/AVR/AVRCallingConv.td:39
 def CSR_Normal : CalleeSavedRegs<(add R29, R28, (sequence "R%u", 17, 2))>;
+def CSR_NormalTiny : CalleeSavedRegs<(add R29, R28, R19, R18)>;
 def CSR_Interrupts : CalleeSavedRegs<(add(sequence "R%u", 31, 2))>;
----------------
benshi001 wrote:
> aykevl wrote:
> > I don't think this is needed. Reserved registers are not part of the regular calling convention anyway.
> Unfortunately this is a must. Since `R19` and `R18` are callee saved registers on avrtiny, according to https://gcc.gnu.org/wiki/avr-gcc#Reduced_Tiny, though they are not so on normal avr.
> 
> So we should explicitly mark `R19`/`R18` as callee saved for avrtiny, and exclude `R17`/`R16` from interrupt/singal_handler saved list.
Ah, I see. You are correct.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121672/new/

https://reviews.llvm.org/D121672



More information about the llvm-commits mailing list