[LLVMdev] Troubling promotion of return value to Integer ...

Chris Lattner sabre at nondot.org
Fri May 30 23:13:15 PDT 2008


On May 30, 2008, at 12:45 AM, Matthijs Kooijman wrote:

> Hi,
>
>> 4) There will be 4 new function attributes:
>>   sign_ext_from_i8, sign_ext_from_i16
>>   zero_ext_from_i8, zero_ext_from_i16
>>   These attributes will be placed on the function CALL node by  
>> front-end to
>>   inform the backend about such promotions and enable optimization of
>>   return value. This should be sufficient for direct and indirect  
>> call.
>>   (syntax of these attributes to be defined)
> How will these attributes work with functions returning multiple  
> values? AFAIK
> it is currently not possible to have seperate attributes for each of  
> the
> return values (since multiple return values are actually one struct).
>
> Even though our C frontends will probably not be generated functions  
> that
> return multiple values, a later optimization pass might introduce  
> extra return
> values. In this case, can these attributes be preserved in some way,  
> or
> perhaps just thrown away (causing only slower code, not  
> miscompilation)?


I agree.  As Dan says, I don't think this will impact this work in the  
short term, but I do consider this to be a general weakness of our  
Multiple Return Value support.

-Chris



More information about the llvm-dev mailing list