diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 16c3b295426c6..5feff7fe9c68a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -8015,17 +8015,8 @@ static SDValue getMemsetStringVal(EVT VT, const SDLoc &dl, SelectionDAG &DAG, if (Slice.Array == nullptr) { if (VT.isInteger()) return DAG.getConstant(0, dl, VT); - if (VT == MVT::f32 || VT == MVT::f64 || VT == MVT::f128) - return DAG.getConstantFP(0.0, dl, VT); - if (VT.isVector()) { - unsigned NumElts = VT.getVectorNumElements(); - MVT EltVT = (VT.getVectorElementType() == MVT::f32) ? MVT::i32 : MVT::i64; - return DAG.getNode(ISD::BITCAST, dl, VT, - DAG.getConstant(0, dl, - EVT::getVectorVT(*DAG.getContext(), - EltVT, NumElts))); - } - llvm_unreachable("Expected type!"); + return DAG.getNode(ISD::BITCAST, dl, VT, + DAG.getConstant(0, dl, VT.changeTypeToInteger())); } assert(!VT.isVector() && "Can't handle vector type here!");