[PATCH] D74794: [X86][ISelLowering] refactor Varargs handling in X86ISelLowering.cpp
Alexey Lapshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 7 04:29:18 PDT 2020
avl marked an inline comment as done.
avl added inline comments.
================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:3380-3393
+struct VarArgRegsDescr {
+ ArrayRef<MCPhysReg> ArgGPRs; // all GPR registers used for passing varargs
+ ArrayRef<MCPhysReg> ArgXMMs; // all XMM registers used for passing varargs
+ unsigned NumIntRegs = 0; // number of allocated GPRs
+ unsigned NumXMMRegs = 0; // number of allocated XMMs
+
+ ArrayRef<MCPhysReg> getAvailableIntRegs() {
----------------
aeubanks wrote:
> this struct and VarArgsLoweringHelper::getVarArgRegsDescriptor seem unnecessary and are only used in the is64Bit() part, can all the variables be inlined?
@aeubanks Thank you, for the comment and Excuse me for a delayed answer. I missed a notification about that comment. This structure is used as a parameter for createVarArgAreaAndStoreRegisters() and later I am going to use it in forwardMustTailParameters(for D69372). If it would be inlined then both of these functions - createVarArgAreaAndStoreRegisters and forwardMustTailParameters will have duplicated code. So the reason of VarArgsLoweringHelper::getVarArgRegsDescriptor is to have single register description and avoid code duplication.
Do you think it is still better to inline VarArgsLoweringHelper::getVarArgRegsDescriptor ?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74794/new/
https://reviews.llvm.org/D74794
More information about the llvm-commits
mailing list