[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).

Evan Cheng evan.cheng at apple.com
Tue Apr 30 14:28:11 PDT 2013


LGTM. Go for it.

Evan

On Apr 30, 2013, at 1:34 PM, Stephen Lin <stephenwlin at gmail.com> wrote:

> 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