[LLVMdev] Header in bitcode format 3.0?

Stuart Hastings stuart at apple.com
Thu May 12 07:43:54 PDT 2011


On May 12, 2011, at 12:30 AM, Sandeep Patel wrote:

> On Wed, May 11, 2011 at 11:42 PM, Stuart Hastings <stuart at apple.com> wrote:
>> 
>> On May 9, 2011, at 1:41 PM, Renato Golin wrote:
>> 
>> [snip]
>> 
>>> One example is the struct byval. The ARM back-end still doesn't
>>> support struct byval (maybe now it does, I was away for a while),
>> 
>> The ARM backend now supports struct byval for APCS.  Extending it to support AAPCS shouldn't be too difficult.  Alas, I won't have time to revisit this in the near future.
> 
> It's slightly unclear to me what byval means for an ABI that passes
> some structs in registers, such as AAPCS-VFP.

IIUC, the byval attribute on a pointer to a structure means "this struct should really be passed by value."  If you ignore the byval attribute, the IR mis-represents what the developer wrote.

The target ISel is supposed to notice the byval attribute and replace the pointer argument with a copy of the structure in the generated code.

I'm not familiar with AAPCS-VFP, but I'd assume that any byval struct should be passed by value, as if byval didn't exist.

The ABI should not be aware that byval is in use.

stuart



More information about the llvm-dev mailing list