[LLVMbugs] [Bug 9009] New: Cannot select X86ISD::MOVLPS for v4:i32

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jan 20 03:28:23 PST 2011


http://llvm.org/bugs/show_bug.cgi?id=9009

           Summary: Cannot select X86ISD::MOVLPS for v4:i32
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: artiom.myaskouvskey at intel.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=6027)
 --> (http://llvm.org/bugs/attachment.cgi?id=6027)
Test for movlps failure

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)>;

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list