[llvm-commits] [Patch] Optimize away a cmp instruction on X86
Manman Ren
mren at apple.com
Tue May 29 12:27:17 PDT 2012
This patch is to replace sub+cmp with X86ISD::SUB when possible, it does not touch the decision of whether we should use 'cmp+jmp' or 'cmov'.
I don't recall having discussions on performance of 'cmp+jmp' vs. 'cmov' :)
Thanks,
Manman
On May 29, 2012, at 11:41 AM, Chandler Carruth wrote:
> On Tue, May 29, 2012 at 11:33 AM, Manman Ren <mren at apple.com> wrote:
>
> Hi All,
>
> This patch is to generalize an earlier patch (r155919), it will handle the following cases where we can remove a CMP:
>
> Forgive me, but my memory has failed me: did we ever resolve the issue of having a system to predicate this on whether the 'cmp+jmp' is actually faster than cmov? I know we discussed the problems surrounding this with your last patch, but I don't recall seeing any real solutions being put in place.
>
>
> (a >|>=|<|<= b) ? (a-b) : any
> (a >|>=|<|<= b) ? any : (a-b)
> (b >|>=|<|<= a) ? (a-b) : any
> (b >|>=|<|<= a) ? any : (a-b)
>
> A corresponding optimization on ARM was implemented in peephole pass.
>
> Thanks,
> Manman
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120529/81fbec5d/attachment.html>
More information about the llvm-commits
mailing list