[PATCH] D14941: [x86] remove duplicate movq instruction defs (PR25554)

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 23 15:53:23 PST 2015


spatel created this revision.
spatel added reviewers: ab, delena, craig.topper.
spatel added a subscriber: llvm-commits.

We have 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.

http://reviews.llvm.org/D14941

Files:
  lib/Target/X86/X86InstrInfo.cpp
  lib/Target/X86/X86InstrSSE.td
  test/CodeGen/X86/vmovq.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14941.40994.patch
Type: text/x-patch
Size: 6030 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151123/88badade/attachment.bin>


More information about the llvm-commits mailing list