[LLVMdev] Request for merge: GHC/ARM calling convention.

Duncan Sands baldrick at free.fr
Sat Oct 15 00:31:38 PDT 2011


Hi David,

> The code above is needed as the GHC calling convention redefines what
> registers are considered callee save. No one else rummages in to the
> original function as all the other calling conventions use the same
> set of callee and caller save registers, so GHC is the only one that
> needs to differentiate.

shouldn't the caller also know what registers are callee saved so that it
can avoid saving the contents of those registers to the stack?

>>> Based on knowledge of calling convention we return different set of callee saved
>>> registers. For example on ARM and when GHC CC is used, we return empty set.
>>
>> yeah, but here MF is (presumably) the callee.  The callee shouldn't be relevant
>> to how arguments are marshalled at the call-site.  Especially as there might not
>> even be a callee function (case of an indirect call).  Since calls themselves
>> are annotated with the calling convention to use, I guess the calling convention
>> should be grabbed from the call instruction itself somehow.
>
> This isn't about the call-site.

I see, thanks for explaining.  But then can the MachineFunction really be null?

Ciao, Duncan.



More information about the llvm-dev mailing list