aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/X86/X86InstrArithmetic.td
diff options
context:
space:
mode:
authorManman Ren <mren@apple.com>2012-07-06 17:36:20 +0000
committerManman Ren <mren@apple.com>2012-07-06 17:36:20 +0000
commit2af66dc51a7a0f3490c7e89c636e4015431195cd (patch)
tree372cc52cf2cabe043a4c9c5937e62f758dd7b197 /lib/Target/X86/X86InstrArithmetic.td
parentfd065bbed1d731b49b1b4a5c4c050ce461be80b4 (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.td2
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>;
+}
//===----------------------------------------------------------------------===//