diff options
author | Manman Ren <mren@apple.com> | 2012-07-06 17:36:20 +0000 |
---|---|---|
committer | Manman Ren <mren@apple.com> | 2012-07-06 17:36:20 +0000 |
commit | 2af66dc51a7a0f3490c7e89c636e4015431195cd (patch) | |
tree | 372cc52cf2cabe043a4c9c5937e62f758dd7b197 /lib/Target/X86/X86InstrArithmetic.td | |
parent | fd065bbed1d731b49b1b4a5c4c050ce461be80b4 (diff) |
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
Diffstat (limited to 'lib/Target/X86/X86InstrArithmetic.td')
-rw-r--r-- | lib/Target/X86/X86InstrArithmetic.td | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Target/X86/X86InstrArithmetic.td b/lib/Target/X86/X86InstrArithmetic.td index 0eee083393..c2b59b40ef 100644 --- a/lib/Target/X86/X86InstrArithmetic.td +++ b/lib/Target/X86/X86InstrArithmetic.td @@ -1143,7 +1143,9 @@ let Uses = [EFLAGS] in { 0, 0>; } +let isCompare = 1 in { defm CMP : ArithBinOp_F<0x38, 0x3A, 0x3C, "cmp", MRM7r, MRM7m, X86cmp, 0, 0>; +} //===----------------------------------------------------------------------===// |