[PATCH] D120094: [CallingConv] Generate isCCArgumentReg() predicate via tablegen

Bill Wendling via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 22 10:31:36 PST 2022


void added inline comments.


================
Comment at: llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp:472
+                                             ISD::ArgFlagsTy &ArgFlags,
+                                             CCState &State) {
+  ArrayRef<MCPhysReg> RegList;
----------------
uweigand wrote:
> This whole series of functions still is quite confusing and seems really pointless to me.
> 
> If you want to answer the question: "identify whether a given register can be used for passing arguments when calling a function" on SystemZ, this is very simple: Just look at the existing lists
>   ELFArgGPRs,  ELFArgFPRs  (for the ELF calling convention)
>   XPLINK64ArgGPR,  XPLINK64ArgFPRs, XPLINK64ArgVRs (for the XPLINK calling convention)
> 
> This will correctly answer the above question without any need for TableGen generated routines or any of this additional code (which looks at those lists anyway, so it isn't even that those would be avoided ...).
> 
> 
The point of using TableGen is to make it as generic as possible so that all backends have a ready-made call that will answer the question for them without having to resort to custom code. If one backend (in this case SystemZ) has a simpler way to do this, then we should use that instead. I'll change the code for SystemZ.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120094



More information about the llvm-commits mailing list