[PATCH] D116424: [ShrinkWrap] check for PPC's non-callee-saved LR
Nick Desaulniers via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 5 15:14:42 PST 2022
nickdesaulniers added inline comments.
================
Comment at: llvm/include/llvm/CodeGen/TargetRegisterInfo.h:1108
+ if (*CSR == Reg)
+ return true;
+ return false;
----------------
efriedma wrote:
> What's the motivation for making the target-independent function non-trivial?
Two fold;
1. given the method name `isNonallocatableRegisterCalleeSave`, we can actually tell if a given register is allocatable or callee saved. Do work that more closely matches the identifier.
2. The method accepts a `const MachineFunction *` that is only really used to validate the callee saved registers list. Otherwise in `PPCRegisterInfo::isNonallocatableRegisterCalleeSave()` I need to have `(void)MF;` (I think) to silence any unused param warnings (or I could just revert the whole latest change).
Perhaps there's a more concise name than `isNonallocatableRegisterCalleeSave` if it's not actually going to tell you whether a register is BOTH non-allocatable AND callee saved (if we revert back to the target-independent base method just returning false)? I recognize I'm in bikeshed territory here and probably should just get back to work.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116424/new/
https://reviews.llvm.org/D116424
More information about the llvm-commits
mailing list