This is an archive of the discontinued LLVM Phabricator instance.

[x86] remove duplicate movq instruction defs (PR25554)
ClosedPublic

Authored by spatel on Nov 23 2015, 3:53 PM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

spatel updated this revision to Diff 40994.Nov 23 2015, 3:53 PM
spatel retitled this revision from to [x86] remove duplicate movq instruction defs (PR25554).
spatel updated this object.
spatel added reviewers: ab, delena, craig.topper.
spatel added a subscriber: llvm-commits.
spatel updated this revision to Diff 40996.Nov 23 2015, 4:18 PM

Patch updated:
Minimized the test case.

delena added a subscriber: igorb.Nov 23 2015, 11:07 PM
igorb accepted this revision.Nov 24 2015, 12:02 AM
igorb added a reviewer: igorb.

LGTM

This revision is now accepted and ready to land.Nov 24 2015, 12:02 AM
This revision was automatically updated to reflect the committed changes.

Thanks, Igor! Checked in at r253988.