[LLVMdev] Argument Lowering Redux
Vadim Chugunov
vadimcn at gmail.com
Tue Aug 5 17:22:44 PDT 2014
On Tue, Aug 5, 2014 at 11:47 AM, Jonas Maebe <jonas.maebe at elis.ugent.be>
wrote:
> On 04/08/14 21:27, Vadim Chugunov wrote:
>
>> I am not pretending to understand all corner cases in this, but as I was
>> reading that old thread, a question popped up in my mind:
>> Couldn't LLVM provide an early IR transform pass that lowers
>> "high-level" argument definitions into the current target-dependent
>> form, converting by-value structs into sret arguments as needed? It
>> seems to me that, at least for structs, all information that such a pass
>> would require, is representable in the current LLVM IR.
>>
>
> That's not the case. For example, many ABIs specify a specific way to pass
> and return values of the "complex" type, which at the LLVM level just looks
> like a struct with two float or double fields.
>
Huh, I didn't know that. So who treats "complex" differently than struct {
float re, im; }? Fortran?
Would any of the following be feasible then?:
- if this special case is widespread, add a special attribute for "complex"
to LLVM IR,
- ignore this issue, and have Fortran compilers do manual lowering of
"complex" arguments, but at least all "sane" languages could enjoy
automatic lowering.
Vadim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140805/9ea99498/attachment.html>
More information about the llvm-dev
mailing list