[PATCH] D117425: [AVR] Make use of the constant value 0 in R1

Ben Shi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 21 06:15:39 PST 2022


benshi001 added inline comments.


================
Comment at: llvm/lib/Target/AVR/AVRISelLowering.cpp:1699
+// Insert a read from R1, which almost always contains the value 0.
+MachineBasicBlock *
+AVRTargetLowering::insertCopyR1(MachineInstr &MI, MachineBasicBlock *BB) const {
----------------
benshi001 wrote:
> I think we need to check the device family, AFAIK, r17 is used as zero_reg on avr-tiny family.
do we need to make a helper function `int getRegZero(void)` in `AVRSubtarget.h`, just like I have done as `getIORegRAMPZ(void)` ? The new helper function will return r17 for avr-tiny devices.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117425



More information about the llvm-commits mailing list