Avoid creating BUILD_VECTOR of all zero elements of "non-normalized" type (e.g. v8i16 on x86) after legalizer. Instruction selection does not expect to see them. In all likelihood this can only be an issue in a bugpoint reduced test case.

llvm-svn: 48136
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 963a1fe..1b00855 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -1103,6 +1103,10 @@
   
   // fold (sub x, x) -> 0
   if (N0 == N1)
+    if (ISD::isBuildVectorAllZeros(N0.Val))
+      // Zero vectors might be normalized to a particular vector type to ensure
+      // they are CSE'd. Return it as it is.
+      return N0;
     return DAG.getConstant(0, N->getValueType(0));
   // fold (sub c1, c2) -> c1-c2
   if (N0C && N1C)