[LLVMdev] Argument Lowering

dag at cray.com dag at cray.com
Tue Feb 12 15:42:49 PST 2013


Tim Northover <t.p.northover at gmail.com> writes:

>>> At a purely implementation level, the first problem at the moment is
>>> that IR-level types are discarded by the time call lowering happens.
>>> Structures are split up into their constituent fields and those are
>>> all a backend has available for its decisions.
>>
>> When you say, "Structures are split up into their constituent fields,"
>> what do you mean, exactly?
>
> By the time the backend gets to decide where arguments are going,
> instead of seeing a prototype like
>
> declare @foo({i32, i8, i64} %arg)
>
> it gets presented with (essentially)
>
> declare @foo(i32 %arg.1, i8 %arg.2, i64 %arg.3)

Ok, that's what I thought you meant, but wanted to make sure.

> There's no hint that a structure was ever involved, let alone
> information on its layout. I think that would be a fairly simple
> matter to resolve though, if a little risky if not handled carefully.

It's this loss of information I was hoping to avoid by passing the
structs and having CodeGen lower the passing correctly.  But unions are
a problem.

Damnable unions.

                        -David



More information about the llvm-dev mailing list