[LLVMdev] Problem with stack arguments
Yiannis Tsiouris
yiannis.tsiouris at gmail.com
Sun Sep 4 02:44:40 PDT 2011
On 07/29/2011 02:47 PM, Chris Stavrakakis wrote:
> Hallo!
>
> I use a custom calling convention in which the first 4 arguments are
> promoted to registers and the rest to the stack, and the callee is
> responsible for popping the stack arguments.
>
> So when calling a function with 5 arguments i get this code:
>
> movq ARG_5, (%rsp)
> callq fun_foo_1
> .Ltmp4:
> subq $8, %rsp
>
> I use a garbage collector with postcall safe points (.Ltmp4 is such)
> which needs to know the frame size, for
> each safe point. The problem is that at .Ltmp4 the frame size is
> actually different from what getFrameSize() would return.
>
> So is there a way to force generation of code which pushes arguments ?
>
> For example :
>
> pushq ARG_5
> callq fun_foo_1
> .Ltmp4
>
> Thnks,
> Chris Stavrakakis
>
Hi all,
Let me elaborate more on what Chris wanted to say because this is my
problem too! :-)
Is there a way to force llvm not to reserve argument space for call
frames? The problem is that we use a GC and when it is triggered it
messes up the caller's frame (in the case that the callee has more than
4 arguments), as Chris said. If there is any idea that might help we
would be grateful!
Thanks,
Yiannis
More information about the llvm-dev
mailing list