X86: peephole optimization to remove cmp instruction
authorManman Ren <mren@apple.com>
Fri, 6 Jul 2012 17:36:20 +0000 (17:36 +0000)
committerManman Ren <mren@apple.com>
Fri, 6 Jul 2012 17:36:20 +0000 (17:36 +0000)
commit2af66dc51a7a0f3490c7e89c636e4015431195cd
tree372cc52cf2cabe043a4c9c5937e62f758dd7b197
parentfd065bbed1d731b49b1b4a5c4c050ce461be80b4
X86: peephole optimization to remove cmp instruction

For each Cmp, we check whether there is an earlier Sub which make Cmp
redundant. We handle the case where SUB operates on the same source operands as
Cmp, including the case where the two source operands are swapped.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159838 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86InstrArithmetic.td
lib/Target/X86/X86InstrInfo.cpp
lib/Target/X86/X86InstrInfo.h
test/CodeGen/X86/jump_sign.ll