[LLVMdev] structured types as function arguments

David Meyer pdox at google.com
Mon Aug 15 13:04:55 PDT 2011


Nicolas,

Did you implement your example directly in llvm assembly?

If so, you may find that the way structures are passed doesn't match
the calling convention of the target system. This is definitely true
on X86-64, where the complicated AMD64 ABI has not been implemented in
the X86 backend.

- pdox

On Mon, Aug 15, 2011 at 9:46 AM, Eli Friedman <eli.friedman at gmail.com> wrote:
> On Mon, Aug 15, 2011 at 9:01 AM, Nicolas Ojeda Bar
> <nojb at math.harvard.edu> wrote:
>> Hi,
>>
>> When calling a function, does the llvm code generator support passing structured types (arrays, structs, etc.) by _value_? I wrote some small examples, and it seemed
>> to work, but I was wondering if anything can go wrong if the structured types are very large...
>
> It should work; the generated code for passing a large struct value
> (as opposed to using the byval attribute) gets to be rather
> inefficient, but I don't know of any correctness bugs.
>
> -Eli
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>




More information about the llvm-dev mailing list