Remove PPC:isZeroVector, use ISD::isBuildVectorAllZeros instead


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27149 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/PowerPC/PPCISelLowering.cpp b/lib/Target/PowerPC/PPCISelLowering.cpp
index f9d3ad8..01cb343 100644
--- a/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -279,26 +279,6 @@
   return cast<ConstantSDNode>(N->getOperand(0))->getValue();
 }
 
-/// isZeroVector - Return true if this build_vector is an all-zero vector.
-///
-bool PPC::isZeroVector(SDNode *N) {
-  if (MVT::isInteger(N->getOperand(0).getValueType())) {
-    for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i)
-      if (!isa<ConstantSDNode>(N->getOperand(i)) ||
-          cast<ConstantSDNode>(N->getOperand(i))->getValue() != 0)
-        return false;
-  } else {
-    assert(MVT::isFloatingPoint(N->getOperand(0).getValueType()) &&
-           "Vector of non-int, non-float values?");
-    // See if this is all zeros.
-    for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i)
-      if (!isa<ConstantFPSDNode>(N->getOperand(i)) ||
-          !cast<ConstantFPSDNode>(N->getOperand(i))->isExactlyValue(0.0))
-        return false;
-  }
-  return true;
-}
-
 /// isVecSplatImm - Return true if this is a build_vector of constants which
 /// can be formed by using a vspltis[bhw] instruction.  The ByteSize field
 /// indicates the number of bytes of each element [124] -> [bhw].
@@ -347,7 +327,7 @@
   int ShAmt = (4-ByteSize)*8;
   int MaskVal = ((int)Value << ShAmt) >> ShAmt;
   
-  // If this is zero, don't match, zero matches isZeroVector.
+  // If this is zero, don't match, zero matches ISD::isBuildVectorAllZeros.
   if (MaskVal == 0) return false;
 
   if (Val) *Val = MaskVal;
@@ -721,7 +701,7 @@
     
     // See if this is all zeros.
     // FIXME: We should handle splat(-0.0), and other cases here.
-    if (PPC::isZeroVector(Op.Val))
+    if (ISD::isBuildVectorAllZeros(Op.Val))
       return Op;
     
     if (PPC::isVecSplatImm(Op.Val, 1) ||    // vspltisb