Fix weirdness handling single element vectors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35941 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index f1cd9a5..d72c6eb 100644
--- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -303,12 +303,9 @@
     NumVectorRegs <<= 1;
   }
   
-  MVT::ValueType VT;
-  if (NumElts == 1) {
+  MVT::ValueType VT = getVectorType(EltTy, NumElts);
+  if (!isTypeLegal(VT))
     VT = EltTy;
-  } else {
-    VT = getVectorType(EltTy, NumElts); 
-  }
   PTyElementVT = VT;
 
   MVT::ValueType DestVT = getTypeToTransformTo(VT);