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

Ayke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 22 17:37:10 PDT 2022


aykevl added inline comments.


================
Comment at: llvm/lib/Target/AVR/AVRRegisterInfo.cpp:60-62
   Reserved.set(AVR::R0);
   Reserved.set(AVR::R1);
   Reserved.set(AVR::R1R0);
----------------
aykevl wrote:
> I think it would make sense to change these hardcoded `R0`/`R1`/`R1R0` registers to properties of `AVRSubtarget` (a bit like `getIORegisterOffset` for example). This would make the code below a bit more sensible: it could just reserve `R0`-`R15` instead of `R2`-`R17` which looks a bit strange.
> Such a change should probably need to be done in a separate patch, as a cleanup before this patch. Such a patch could also fix the hardcoded `R0`/`R1` registers in AVRFrameLowering.cpp, AVRExpandPseudoInsts.cpp, etc.
It looks like you already added these getters to `AVRSubtarget` in D119807.


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

https://reviews.llvm.org/D121672



More information about the llvm-commits mailing list