Rafael Espíndola
2012-Oct-19 16:27 UTC
[LLVMdev] How to represent __attribute__((fastcall)) functions in the IL
> Don't get me wrong, I don't have any good ideas about how to do this, I'm > just hoping someone does. End result might allow something like: > > declare void @foo(double inreg <eax,edx> %x)Not sure I would go all the way to specifying registers in the IL (although I liked it at some point). What I like most right now is something along the lines of http://llvm.org/pr12193. That makes it explicit if something is on the stack or in registers and that information is correct for both the caller and callee. What is left for codegen is counting the register arguments and computing stack offsets. Implementing that requires way more time than I have right now, but I think this proposal is a small step in the right direction as it makes clang the one responsible for marking an argument as memory or register. Cheers, Rafael
Duncan Sands
2012-Oct-20 07:58 UTC
[LLVMdev] How to represent __attribute__((fastcall)) functions in the IL
Hi Rafael, On 19/10/12 18:27, Rafael Espíndola wrote:>> Don't get me wrong, I don't have any good ideas about how to do this, I'm >> just hoping someone does. End result might allow something like: >> >> declare void @foo(double inreg <eax,edx> %x) > > Not sure I would go all the way to specifying registers in the IL > (although I liked it at some point). What I like most right now is > something along the lines of > http://llvm.org/pr12193. That makes it explicit if something is on the > stack or in registers and that information is correct for both the > caller and callee. What is left for codegen is counting the register > arguments and computing stack offsets.I'm 100% in favour of having "onstack" as a complement to "inreg". I'm not so happy about the more funky changes you suggested in the PR, namely having the callee no longer match the caller, but "onstack" itself makes a lot of sense to me.> Implementing that requires way more time than I have right now, but I > think this proposal is a small step in the right direction as it makes > clang the one responsible for marking an argument as memory or > register.Ciao, Duncan.
Chris Lattner
2012-Oct-20 15:14 UTC
[LLVMdev] How to represent __attribute__((fastcall)) functions in the IL
On Oct 20, 2012, at 12:58 AM, Duncan Sands <baldrick at free.fr> wrote:> Hi Rafael, > > On 19/10/12 18:27, Rafael Espíndola wrote: >>> Don't get me wrong, I don't have any good ideas about how to do this, I'm >>> just hoping someone does. End result might allow something like: >>> >>> declare void @foo(double inreg <eax,edx> %x) >> >> Not sure I would go all the way to specifying registers in the IL >> (although I liked it at some point). What I like most right now is >> something along the lines of >> http://llvm.org/pr12193. That makes it explicit if something is on the >> stack or in registers and that information is correct for both the >> caller and callee. What is left for codegen is counting the register >> arguments and computing stack offsets. > > I'm 100% in favour of having "onstack" as a complement to "inreg". I'm > not so happy about the more funky changes you suggested in the PR, namely > having the callee no longer match the caller, but "onstack" itself makes > a lot of sense to me.Makes a lot of sense to me too. -Chris
Apparently Analagous Threads
- [LLVMdev] How to represent __attribute__((fastcall)) functions in the IL
- [LLVMdev] How to represent __attribute__((fastcall)) functions in the IL
- [LLVMdev] How to represent __attribute__((fastcall)) functions in the IL
- [LLVMdev] How to represent __attribute__((fastcall)) functions in the IL
- [LLVMdev] How to represent __attribute__((fastcall)) functions in the IL