[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
Wed Apr 24 18:37:52 PDT 2013


>> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-returned-param-ext.patch
Type: application/octet-stream
Size: 12979 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130424/09e924d4/attachment.obj>


More information about the llvm-commits mailing list