[llvm-commits] [PATCH] optimization of max-like struct for x86
Manman Ren
mren at apple.com
Wed Apr 25 13:52:01 PDT 2012
Hi Sean,
Thanks for providing the feedback.
This patch will generate
xorl %ecx, %ecx
subl %edx, %eax
cmovsl %ecx, %eax
while the proposed sequence has a dependency chain from 1st instruction to 2nd then to 3rd.
-- Manman
On Apr 25, 2012, at 11:01 AM, Sean Silva <silvas at purdue.edu> wrote:
> 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/271e1541/attachment.html>
More information about the llvm-commits
mailing list