[SDAG] At the suggestion of Hal, switch to an output parameter that
tracks which elements of the build vector are in fact undef.

This should make actually inpsecting them (likely in my next patch)
reasonably pretty. Also makes the output parameter optional as it is
clear now that *most* users are happy with undefs in their splats.

llvm-svn: 212581
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 9aee389..578821a 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -1158,11 +1158,11 @@
       return false;
 
     IsVec = true;
-    bool HasUndefElements;
-    CN = BV->getConstantSplatNode(HasUndefElements);
+    BitVector UndefElements;
+    CN = BV->getConstantSplatNode(&UndefElements);
     // Only interested in constant splats, and we don't try to handle undef
     // elements in identifying boolean constants.
-    if (!CN || HasUndefElements)
+    if (!CN || UndefElements.none())
       return false;
   }
 
@@ -1190,11 +1190,11 @@
       return false;
 
     IsVec = true;
-    bool HasUndefElements;
-    CN = BV->getConstantSplatNode(HasUndefElements);
+    BitVector UndefElements;
+    CN = BV->getConstantSplatNode(&UndefElements);
     // Only interested in constant splats, and we don't try to handle undef
     // elements in identifying boolean constants.
-    if (!CN || HasUndefElements)
+    if (!CN || UndefElements.none())
       return false;
   }