previously only done for 32-bit and smaller operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42024
91177308-0d34-0410-b5e6-
96231b3b80d8
def : Pat<(X86tailcall GR64:$dst),
(CALL64r GR64:$dst)>;
+// Comparisons.
+
+// TEST R,R is smaller than CMP R,0
+def : Pat<(X86cmp GR64:$src1, 0),
+ (TEST64rr GR64:$src1, GR64:$src1)>;
+
// {s|z}extload bool -> {s|z}extload byte
def : Pat<(sextloadi64i1 addr:$src), (MOVSX64rm8 addr:$src)>;
def : Pat<(zextloadi64i1 addr:$src), (MOVZX64rm8 addr:$src)>;
--- /dev/null
+; RUN: llvm-as < %s | llc -march=x86-64 | grep -v cmp
+
+define i64 @foo(i64 %x) {
+ %t = icmp eq i64 %x, 0
+ %r = zext i1 %t to i64
+ ret i64 %r
+}