[llvm-commits] [LLVMdev] ABI: how to let the backend know that an aggregate should be allocated on stack

Chris Lattner clattner at apple.com
Mon Oct 29 21:16:05 PDT 2012


On Oct 29, 2012, at 12:32 PM, Bob Wilson <bob.wilson at apple.com> wrote:

>>>> So, if I understand what you're proposing, "onstack" means that something
>>>> should be passed on the stack, and "byval" means that the compiler inserts
>>>> an invisible copy of the data when performing the function call.  That would
>>>> then mean that something that is both "byval" and "onstack" means that
>>>> something has been copied and is located on the stack.  Is this correct?
>>> Yes.
>> 
>> Okay, so, in other words, something that is labeled as byval now would be marked both byval and onstack in the new design.  Is this correct, or does byval maintain its current meaning (i.e., a pointer points to an addressable copy of an argument)?
> 
> I am not proposing anything specific with regard to "byval" at this point.
> 
> But, there are two changes I think may come from this:
> 
> 1) Some uses of "byval" would be replaced by "onstack".  This would address the i386 code quality issues that Chris mentioned.  
> 
> 2) Doc changes to clarify the meaning of "byval".  Part of that should involve specifying whether it can be used in combination with other attributes like "inreg" or "onstack".
> 
> I don't expect any of this would affect SAFECode, since "byval" would continue to mean pretty much what it does now.

Right.

-Chris



More information about the llvm-commits mailing list