From 4783a3ee13a2a63d5618405cf6ae0a4afaa97e63 Mon Sep 17 00:00:00 2001
From: Bruno Cardoso Lopes <bruno.cardoso@gmail.com>
Date: Wed, 1 Sep 2010 22:59:03 +0000
Subject: [PATCH] Revert r112689, avoid those kind of checks cause they mess up
 with mmx

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112760 91177308-0d34-0410-b5e6-96231b3b80d8
---
 lib/Target/X86/X86ISelLowering.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp
index b7307ea1e95..852d339d735 100644
--- a/lib/Target/X86/X86ISelLowering.cpp
+++ b/lib/Target/X86/X86ISelLowering.cpp
@@ -5194,10 +5194,10 @@ X86TargetLowering::LowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG) const {
 
     unsigned TargetMask = X86::getShuffleSHUFImmediate(SVOp);
 
-    if (HasSSE2 && NumElems == 4)
+    if (HasSSE2 && (VT == MVT::v4f32 || VT == MVT::v4i32))
       return getTargetShuffleNode(X86ISD::PSHUFD, dl, VT, V1, TargetMask, DAG);
 
-    if (HasSSE2 && NumElems == 2)
+    if (HasSSE2 && (VT == MVT::v2i64 || VT == MVT::v2f64))
       return getTargetShuffleNode(X86ISD::SHUFPD, dl, VT, V1, V1,
                                   TargetMask, DAG);
 
@@ -5226,10 +5226,10 @@ X86TargetLowering::LowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG) const {
     if (ISD::isBuildVectorAllZeros(V1.getNode()))
       return getVZextMovL(VT, VT, V2, DAG, Subtarget, dl);
     if (!isMMX && !X86::isMOVLPMask(SVOp)) {
-      if (HasSSE2 && NumElems == 2)
+      if (HasSSE2 && (VT == MVT::v2i64 || VT == MVT::v2f64))
         return getTargetShuffleNode(X86ISD::MOVSD, dl, VT, V1, V2, DAG);
 
-      if (NumElems == 4)
+      if (VT == MVT::v4i32 || VT == MVT::v4f32)
         return getTargetShuffleNode(X86ISD::MOVSS, dl, VT, V1, V2, DAG);
     }
   }