[LLVMdev] struct passing on X86-64

Eli Friedman eli.friedman at gmail.com
Fri Jun 10 10:40:18 PDT 2011


On Fri, Jun 10, 2011 at 10:29 AM, David A. Greene <greened at obbligato.org> wrote:
> Duncan Sands <baldrick at free.fr> writes:
>
>>> Yep.  There are lots of corner cases that the frontend MUST handle
>>> because LLVM does not have the necessary infrastructure.
>>
>> I think it's more like: because LLVM doesn't have the necessary information.
>
> True.
>
>> Due to LLVM using structural equivalence, all kinds of types that are
>> different in the original language end up being the same type in LLVM.
>> Chris once explained to me, IIRC, that the ABI is defined in terms of
>> the original language types, and unfortunately some ABI's require
>> different handling for types that are structurally equivalent.
>
> Just so I understand this better, for which ABIs is this the case?  It's
> not for x86_64.  ARM, perhaps?

Take, for example, _Complex long double on x86-64. Or unions on x86-64. :)

-Eli

>> See PR4246 for a plan to have generic helper codes for ABI lowering.
>
> It seems a bit complicated to me.  Wouldn't it be simpler to just encode
> the language type information in metadata, or, if metadata isn't
> appropriate because it can be dropped, in some language information
> piece within Type?  Then the target ABI stuff can know exactly what to
> do and we won't have various other pieces all trying to figure out the
> same stuff.
>
>                             -Dave
> _______________________________________________
> 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