[llvm-commits] [Please Review] [PATCH] optimization of -(x != 0) to use neg in X86

Duncan Sands baldrick at free.fr
Sat May 5 04:15:55 PDT 2012


Hi Manman,

> PING

why was it failing before, i.e. what did you fix?

Ciao, Duncan.

>
> On May 3, 2012, at 7:14 PM, manman ren wrote:
>
>>
>> X86: optimization for -(x != 0)
>>
>> This patch will optimize -(x != 0) on X86
>> FROM
>> cmpl	$0x01,%edi
>> sbbl	%eax,%eax
>> notl	%eax
>> TO
>> negl %edi
>> sbbl %eax %eax
>>
>> In order to generate negl, I added patterns in Target/X86/X86InstrCompiler.td:
>> def : Pat<(X86sub_flag 0, GR32:$src), (NEG32r GR32:$src)>;
>>
>> This is my first experience with tablegen, please review.
>> The initial version of this patch (r155853) was the root cause of PR12720 and I did verify this patch against PR12720.
>>
>> Thanks,
>> Manman
>>
>> <sext_ne.patch>
>>
>>
>>
>> On Apr 30, 2012, at 11:38 AM, manman ren wrote:
>>
>>>>
>>>>
>>>> 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
>>>>
>>>
>>
>
> _______________________________________________
> 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