[llvm] [RISCV][MRI] Account for fixed registers when determining callee saved regs (PR #115756)

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 14 11:09:08 PST 2024


michaelmaitland wrote:

> The existing AArch64 code that uses setCalleeSavedRegs calls AArch64RegisterInfo::getCalleeSavedRegs and then adds some stuff to it. I guess the code you added to getCalleeSavedRegs will need to be copied into AArch64RegisterInfo::UpdateCustomCalleeSavedRegs to remove the fixed registers?

I'm interpreting the existing code in AArch64 as copying the call of getTargetRegisterInfo->getCalleeSavedRegs out of `MachineRegisterInfo::getCalleeSavedRegs` and putting it into AArch64RegisterInfo::UpdateCustomCalleeSavedRegs. So yes, they would also need to copy the code to copy the code to remove the fixed registers. 

Or they could just call MachineRegisterInfo::getCalleeSavedRegs from the start, add some regs to the result, and call setCalleeSavedRegs. Or they could use getCalleeSavedRegs and add a function addCalleeSavedReg instead of using setCalleeSavedRegs. 


https://github.com/llvm/llvm-project/pull/115756


More information about the llvm-commits mailing list