[llvm-commits] [PATCH] optimization of max-like struct for x86

Sean Silva silvas at purdue.edu
Wed Apr 25 11:01:46 PDT 2012


Why not turn it into e.g.

cmp ebx, eax
cmovg ebx, eax
sub ebx, eax

?

--Sean Silva



On Wed, Apr 25, 2012 at 12:33 PM, Manman Ren <mren at apple.com> wrote:

>
> This patch is intended to optimize the following cases for x86:
> (b > a) ? (b-a) : 0
> (a < b) ? (b-a) : 0
> It will use cmovs in generated x86 code.
>
> The patch modified one source file: lib/Target/X86/X86ISelLowering.cpp
>
> Please review & provide feedback.
> Thanks,
>
>
> _______________________________________________
> 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/20120425/c08b02a4/attachment.html>


More information about the llvm-commits mailing list