[LLVMdev] Plans considering first class structs and multiple return values

Devang Patel dpatel at apple.com
Mon Jun 9 07:15:46 PDT 2008


On Jun 9, 2008, at 4:14 AM, Duncan Sands wrote:

> Hi,
>
>> Will sretpromotion still be needed? If the frontends would generate  
>> functions
>> returning a struct directly instead of using an sret argument, sret  
>> could
>> perhaps be removed alltogether? Though I guess there is an ABI  
>> difference
>> between using sret and returning a structure directly?
>
> right, there's an ABI difference.  Also you can't return variable  
> sized structs
> using MRV support (I don't know if gcc really supports this, but  
> some pieces of
> code inside gcc mention functions returning variable sized objects).

Plus it is not a good idea to pass very large structs using MRV.
-
Devang



More information about the llvm-dev mailing list