Displaying 5 results from an estimated 5 matches for "ccifbyval".
2013 Jul 04
2
[LLVMdev] making a copy of a byval aggregate on the callee's frame
...on::EmitFunctionProlog() and it works - but it is not nice.
BUT it seems most believe that it should be done within llvm using 'byVal'.
I have tried to follow the the 'byval' flag but am too ignorant to make any meaningful headway viz:
I tried adding to the XCoreCallingConv.td:
CCIfByVal<CCPassByVal<0,4>> // pushes pointer to the stack
and
CCIfByVal<CCCustom<"XCoreCC_CustomByVal">>
But Have got stuck knowing if I can add the copy at this stage.
Is the pointee's details available or only the pointer's?
(Sorry if I have not dug dee...
2013 Jul 04
0
[LLVMdev] making a copy of a byval aggregate on the callee's frame
Hi Robert,
> I tried adding to the XCoreCallingConv.td:
> CCIfByVal<CCPassByVal<0,4>> // pushes pointer to the stack
This looks sensible to me. After that it comes down to cooperation
between XCoreISelLowering's LowerFormalArguments and LowerCall
functions. LowerFormalArguments is at the beginning of a function and
is responsible for taking...
2013 Jul 04
2
[LLVMdev] making a copy of a byval aggregate on the callee's frame
...I believe the LowerCall is doing what it needs to do - passing pointer either on the stack or in register as per ABI.
The LowerFormalArguments() is where I am stuck.
LowerFormalArguments () calls CCInfo.AnalyzeFormalArguments(Ins, CC_XCore), which calls the CC_XCore().
This is where I placed the CCIfByVal<CCPassByVal<0,4>> which only pushed the pointer to the stack.
However, I don't want to push the pointer to the stack but COPY the pointee.
Indeed, I want to keep the pointer where it is BUT re-point it to a new object copied onto the callee's stack.
Hmmm
What I really want it so...
2013 Jul 04
0
[LLVMdev] making a copy of a byval aggregate on the callee's frame
...to do - passing pointer either on the stack or in register as per ABI.
>From very quick test-cases with no understanding of XCore, that looks plausible.
> LowerFormalArguments () calls CCInfo.AnalyzeFormalArguments(Ins, CC_XCore), which calls the CC_XCore().
> This is where I placed the CCIfByVal<CCPassByVal<0,4>> which only pushed the pointer to the stack.
Really, all it did was ask LowerCall and LowerFormalArguments to pass
the pointer on the stack (well, strictly "ByVal") as they see fit.
> static bool CC_XCore(...) {
> <does weird and wonderful stuff...
2013 Jul 04
2
[LLVMdev] making a copy of a byval aggregate on the callee's frame
...to do - passing pointer either on the stack or in register as per ABI.
>From very quick test-cases with no understanding of XCore, that looks plausible.
> LowerFormalArguments () calls CCInfo.AnalyzeFormalArguments(Ins, CC_XCore), which calls the CC_XCore().
> This is where I placed the CCIfByVal<CCPassByVal<0,4>> which only pushed the pointer to the stack.
Really, all it did was ask LowerCall and LowerFormalArguments to pass
the pointer on the stack (well, strictly "ByVal") as they see fit.
> static bool CC_XCore(...) {
> <does weird and wonderful stuff...