[llvm] r179925 - Add CodeGen support for functions that always return arguments via a new parameter attribute 'returned', which is taken advantage of in target-independent tail call opportunity detection and in ARM call lowering (when placed on an integral first parameter).

Stephen Lin stephenwlin at gmail.com
Tue Apr 30 13:34:41 PDT 2013


On Wed, Apr 24, 2013 at 9:37 PM, Stephen Lin <stephenwlin at gmail.com> wrote:
>>> To be clear, the only cases supportable would be:
>>>
>>> 1) no extension at all (i.e the type is the same size as the register
>>> used to pass it)
>>> 2) both the 'returned' parameter and return value are zero-extended
>>> 3) both the 'returned' parameter and return value are sign-extended
>>
>> Hi Stephen,
>>
>> I don't think it is important to enable the optimization for other cases than the ones you list above. Just make sure it gets disabled in other cases so we don't miscompute the code.
>>
>> The 'returned' parameters are usually pointers, AFAICT.
>>
>> /jakob
>>
>
> Agreed, I updated the patch to only whitelist the cases above for
> optimization and FIXME notes about the limitations. Also, it
> blacklists all vector types for now, to be safe.
>
> Please let me know if you have any suggestions or concerns.
>
> -Stephen

OK, I'm going to commit this if there are no objections...there's no
new functionality; just restrictions on recently added but not yet
used functionality to avoid buggy cases.

-Stephen



More information about the llvm-commits mailing list