[llvm-commits] [Patch] Optimize away a cmp instruction on X86

Chandler Carruth chandlerc at google.com
Tue May 29 11:41:42 PDT 2012


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/9c3b92e3/attachment.html>


More information about the llvm-commits mailing list