[llvm] [RISCV] Share ArgGPRs array between SelectionDAG and GISel. (PR #74152)

Wang Pengcheng via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 3 22:36:51 PST 2023


================
@@ -986,6 +986,9 @@ bool CC_RISCV_FastCC(const DataLayout &DL, RISCVABI::ABI ABI, unsigned ValNo,
 bool CC_RISCV_GHC(unsigned ValNo, MVT ValVT, MVT LocVT,
                   CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags,
                   CCState &State);
+
+ArrayRef<MCPhysReg> getArgGPRs();
----------------
wangpc-pp wrote:

> > What about putting this function in `RISCVRegisterInfo.h/cpp`, no need to be a class method but a function in `RISCV` namespace.
> 
> It's not a class method in this patch.
I meant if we gonna to move this function to `RISCVRegisterInfo.h/cpp`, it can be just a function in `RISCV` namespace.
> 
> Shouldn't it stay with other calling convention functions that are the primary users? And we should keep it with other register lists that are already in RISCVISelLowering.cpp

There are some other register lists that can be reused in both SelectionDAG ISel and GISel, I tend to move these lists to a more common place like `RISCVRegisterInfo.h/cpp`, which represents register informations I think.

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


More information about the llvm-commits mailing list