[x86] remove duplicate movq instruction defs (PR25554)
authorSanjay Patel <spatel@rotateright.com>
Tue, 24 Nov 2015 15:44:35 +0000 (15:44 +0000)
committerSanjay Patel <spatel@rotateright.com>
Tue, 24 Nov 2015 15:44:35 +0000 (15:44 +0000)
commit5c2d0848abf3945bd7bf670860d3b85d2937b9bb
treef706ebb19e8c7f16eb991a0a58bfda62b4d39e0d
parent1c9cdef8b9df333b8477ac88f1ee6ca82a83762d
[x86] remove duplicate movq instruction defs (PR25554)

We had duplicated definitions for the same hardware '[v]movq' instructions. For example with SSE:

  def MOVZQI2PQIrr : RS2I<0x6E, MRMSrcReg, (outs VR128:$dst), (ins GR64:$src),
                     "mov{d|q}\t{$src, $dst|$dst, $src}", // X86-64 only
                     [(set VR128:$dst, (v2i64 (X86vzmovl (v2i64 (scalar_to_vector GR64:$src)))))],
                     IIC_SSE_MOVDQ>;

  def MOV64toPQIrr : RS2I<0x6E, MRMSrcReg, (outs VR128:$dst), (ins GR64:$src),
                     "mov{d|q}\t{$src, $dst|$dst, $src}",
                     [(set VR128:$dst, (v2i64 (scalar_to_vector GR64:$src)))],
                     IIC_SSE_MOVDQ>, Sched<[WriteMove]>;

As shown in the test case and PR25554:
https://llvm.org/bugs/show_bug.cgi?id=25554

This causes us to miss reusing an operand because later passes don't know these 'movq' are the same instruction.
This patch deletes one pair of these defs.
Sadly, this won't fix the original test case in the bug report. Something else is still broken.

Differential Revision: http://reviews.llvm.org/D14941

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