[llvm] [GISel][RISCV]Implement indirect parameter passing for large scalars (PR #95429)
Gábor Spaits via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 14 15:00:36 PDT 2024
================
@@ -790,6 +805,62 @@ bool CallLowering::handleAssignments(ValueHandler &Handler,
CCValAssign &VA = ArgLocs[j + Idx];
const ISD::ArgFlagsTy Flags = Args[i].Flags[Part];
+ // We found an indirect parameter passing and we are at the first part of
+ // the value being passed. In this case copy the incoming pointer into a
+ // virtual register so later we can load it.
+ if (VA.getLocInfo() == CCValAssign::Indirect && Flags.isSplit()) {
+ IndirectParameterPassingHandled = true;
+ bool IsInStack = false;
+ Register PhysReg;
+ if (VA.isRegLoc()) {
+ PhysReg = VA.getLocReg();
+ } else if (VA.isMemLoc()) {
+ IsInStack = true;
+ LLT MemTy = Handler.getStackValueStoreType(DL, VA, Flags);
+ MachinePointerInfo MPO;
+ PhysReg = Handler.getStackAddress(
----------------
spaits wrote:
The virtual live-in register problem is fixed.
I have tried to do the restructure the code to use the generic parts, instead of re-implementing them.
I had one case, where I could not do, that. That is the case when the pointer to stack is passed in a register, since there is no other branch in the later coming code that would assign the pointer to stack to the register used in parameter passing.
https://github.com/llvm/llvm-project/pull/95429
More information about the llvm-commits
mailing list