Skip to content

Cannot select X86ISD::MOVLPS for v4:i32 #9381

@llvmbot

Description

@llvmbot
Bugzilla Link 9009
Resolution FIXED
Resolved on Jan 23, 2011 21:43
Version trunk
OS All
Attachments Test for movlps failure
Reporter LLVM Bugzilla Contributor

Extended Description

In code generation there is missing selection for MOVLPS instruction when 2 sources are VREG and destination is V4I32.

To reproduce it run llc from trunk on attached .ll file.

Attached are bugpoint reduced test.

The fix is rather simple and therefore inlined. Please note that it also addresses the same problem for movddup.

Index: lib/Target/X86/X86InstrSSE.td

--- lib/Target/X86/X86InstrSSE.td (revision 2546)
+++ lib/Target/X86/X86InstrSSE.td (working copy)
@@ -5963,6 +5963,9 @@
def : Pat<(v4f32 (X86Movlps VR128:$src1, VR128:$src2)),
(MOVSDrr VR128:$src1, (EXTRACT_SUBREG (v4f32 VR128:$src2), sub_sd))>;

+def : Pat<(v4i32 (X86Movlps VR128:$src1, VR128:$src2)),

  •      (MOVSDrr VR128:$src1, (EXTRACT_SUBREG (v4i32 VR128:$src2), sub_sd))>; 
    

// Shuffle with MOVLPD
def : Pat<(v2f64 (X86Movlpd VR128:$src1, (load addr:$src2))),
(MOVLPDrm VR128:$src1, addr:$src2)>;

Index: lib/Target/X86/X86InstrSSE.td

--- lib/Target/X86/X86InstrSSE.td (revision 2546)
+++ lib/Target/X86/X86InstrSSE.td (working copy)
@@ -5904,6 +5904,8 @@
(MOVLHPSrr VR128:$src, VR128:$src)>;
def : Pat<(v4f32 (X86Movddup VR128:$src)),
(MOVLHPSrr VR128:$src, VR128:$src)>;
+def : Pat<(v4i32 (X86Movddup VR128:$src)),

  •      (MOVLHPSrr VR128:$src, VR128:$src)>;
    

def : Pat<(v2f64 (X86Movddup VR128:$src)),
(UNPCKLPDrr VR128:$src, VR128:$src)>;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions