[PATCH] D116424: [ShrinkWrap] check for PPC's non-callee-saved LR

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 6 10:46:09 PST 2022


nickdesaulniers added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/TargetRegisterInfo.h:1108
+      if (*CSR == Reg)
+        return true;
+    return false;
----------------
nickdesaulniers wrote:
> 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.
Thinking about this overnight, I think I should revert back to the previously approved diff (Diff 397682).  Either PPC should make LR/LR8 callee saved, or it should not.  I don't see that changing in the future if it doesn't do so now.


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