[LLVMdev] struct passing on X86-64

Duncan Sands baldrick at free.fr
Fri Jun 10 01:07:15 PDT 2011


Hi Dave,

>> The frontends (llvm-gcc, clang) appear to do the argument munging
>> themselves in order to compensate.
>
> 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.
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.  In short, it's not always possible to know how a
LLVM type should be passed, because you don't know which of several possible
front-end types it came from.  So you would either have to annotate the IR with
all kinds of front-end type information, or require front-ends to do the ABI
conformance stuff.  The current solution is the latter.

See PR4246 for a plan to have generic helper codes for ABI lowering.

Ciao, Duncan.

>
>> Any plans or suggestions for implementing this properly in the backend?
>
> I don't think anyone has signed up to do the work.
>
>                           -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