Add x86-specific DAG combine to simplify:
authorChad Rosier <mcrosier@apple.com>
Fri, 27 Apr 2012 22:33:25 +0000 (22:33 +0000)
committerChad Rosier <mcrosier@apple.com>
Fri, 27 Apr 2012 22:33:25 +0000 (22:33 +0000)
commita73b6fc51126d40e4b8830a13a9a4e9322c282a2
tree4456d888db159659e7f43371f66257f385c0c804
parent57d61de8580b85ee706dfe1cc11bfba96d46f347
Add x86-specific DAG combine to simplify:

 x == -y --> x+y == 0
 x != -y --> x+y != 0

On x86, the generated code goes from
   negl    %esi
   cmpl    %esi, %edi
   je    .LBB0_2
to
   addl    %esi, %edi
   je    .L4

This case is correctly handled for ARM with "cmn".

Patch by Manman Ren.
rdar://11245199
PR12545

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155739 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/neg_cmp.ll [new file with mode: 0644]