[llvm-commits] [PATCH] optimization of -(x != 0) to use neg in X86
manman ren
mren at apple.com
Mon Apr 30 11:38:13 PDT 2012
Chad,
Thanks for pointing that out. Updated patch is attached.
I have the "commit after approval" access now.
Thanks for your help,
Manman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sext_ne.patch
Type: application/octet-stream
Size: 1942 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120430/9f448174/attachment.obj>
-------------- next part --------------
On Apr 30, 2012, at 9:58 AM, Chad Rosier wrote:
> Manman,
>
> + if (ConstantSDNode *YC = dyn_cast<ConstantSDNode>(Y))
> + if (YC && YC->isNullValue() &&
> + (isAllOnes(Op1) == (CondCode == X86::COND_NE))) {
>
> The dyn_cast<> operator returns null if the operand is not of the correct type. Thus, the "YC &&" check is not necessary.
>
> Chad
>
> On Apr 27, 2012, at 6:03 PM, manman ren wrote:
>
>>
>> This patch will optimize -(x != 0) on X86
>> FROM
>> cmpl $0x01,%edi
>> sbbl %eax,%eax
>> notl %eax
>> TO
>> negl %edi
>> sbbl %eax %eax
>>
>> Please review & provide feedback,
>> Thanks,
>> Manman
>>
>> <sext_ne.patch>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
More information about the llvm-commits
mailing list