@@ -6285,7 +6285,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
62856285 Flags.setNonNeg(N1->getFlags().hasNonNeg());
62866286 return getNode(OpOpcode, DL, VT, N1.getOperand(0), Flags);
62876287 }
6288- if (OpOpcode == ISD::UNDEF )
6288+ if (N1.isUndef() )
62896289 // sext(undef) = 0, because the top bits will all be the same.
62906290 return getConstant(0, DL, VT);
62916291 break;
@@ -6305,7 +6305,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
63056305 Flags.setNonNeg(N1->getFlags().hasNonNeg());
63066306 return getNode(ISD::ZERO_EXTEND, DL, VT, N1.getOperand(0), Flags);
63076307 }
6308- if (OpOpcode == ISD::UNDEF )
6308+ if (N1.isUndef() )
63096309 // zext(undef) = 0, because the top bits will be zero.
63106310 return getConstant(0, DL, VT);
63116311
@@ -6347,7 +6347,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
63476347 // (ext (zext x)) -> (zext x) and (ext (sext x)) -> (sext x)
63486348 return getNode(OpOpcode, DL, VT, N1.getOperand(0), Flags);
63496349 }
6350- if (OpOpcode == ISD::UNDEF )
6350+ if (N1.isUndef() )
63516351 return getUNDEF(VT);
63526352
63536353 // (ext (trunc x)) -> x
@@ -6382,7 +6382,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
63826382 return getNode(ISD::TRUNCATE, DL, VT, N1.getOperand(0));
63836383 return N1.getOperand(0);
63846384 }
6385- if (OpOpcode == ISD::UNDEF )
6385+ if (N1.isUndef() )
63866386 return getUNDEF(VT);
63876387 if (OpOpcode == ISD::VSCALE && !NewNodesMustHaveLegalTypes)
63886388 return getVScale(DL, VT,
@@ -6400,22 +6400,22 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
64006400 break;
64016401 case ISD::ABS:
64026402 assert(VT.isInteger() && VT == N1.getValueType() && "Invalid ABS!");
6403- if (OpOpcode == ISD::UNDEF )
6403+ if (N1.isUndef() )
64046404 return getConstant(0, DL, VT);
64056405 break;
64066406 case ISD::BSWAP:
64076407 assert(VT.isInteger() && VT == N1.getValueType() && "Invalid BSWAP!");
64086408 assert((VT.getScalarSizeInBits() % 16 == 0) &&
64096409 "BSWAP types must be a multiple of 16 bits!");
6410- if (OpOpcode == ISD::UNDEF )
6410+ if (N1.isUndef() )
64116411 return getUNDEF(VT);
64126412 // bswap(bswap(X)) -> X.
64136413 if (OpOpcode == ISD::BSWAP)
64146414 return N1.getOperand(0);
64156415 break;
64166416 case ISD::BITREVERSE:
64176417 assert(VT.isInteger() && VT == N1.getValueType() && "Invalid BITREVERSE!");
6418- if (OpOpcode == ISD::UNDEF )
6418+ if (N1.isUndef() )
64196419 return getUNDEF(VT);
64206420 break;
64216421 case ISD::BITCAST:
@@ -6424,7 +6424,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
64246424 if (VT == N1.getValueType()) return N1; // noop conversion.
64256425 if (OpOpcode == ISD::BITCAST) // bitconv(bitconv(x)) -> bitconv(x)
64266426 return getNode(ISD::BITCAST, DL, VT, N1.getOperand(0));
6427- if (OpOpcode == ISD::UNDEF )
6427+ if (N1.isUndef() )
64286428 return getUNDEF(VT);
64296429 break;
64306430 case ISD::SCALAR_TO_VECTOR:
@@ -6434,7 +6434,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
64346434 N1.getValueType().isInteger() &&
64356435 VT.getVectorElementType().bitsLE(N1.getValueType()))) &&
64366436 "Illegal SCALAR_TO_VECTOR node!");
6437- if (OpOpcode == ISD::UNDEF )
6437+ if (N1.isUndef() )
64386438 return getUNDEF(VT);
64396439 // scalar_to_vector(extract_vector_elt V, 0) -> V, top bits are undefined.
64406440 if (OpOpcode == ISD::EXTRACT_VECTOR_ELT &&
@@ -6445,7 +6445,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
64456445 break;
64466446 case ISD::FNEG:
64476447 // Negation of an unknown bag of bits is still completely undefined.
6448- if (OpOpcode == ISD::UNDEF )
6448+ if (N1.isUndef() )
64496449 return getUNDEF(VT);
64506450
64516451 if (OpOpcode == ISD::FNEG) // --X -> X
@@ -13364,7 +13364,7 @@ void BuildVectorSDNode::recastRawBits(bool IsLittleEndian,
1336413364bool BuildVectorSDNode::isConstant() const {
1336513365 for (const SDValue &Op : op_values()) {
1336613366 unsigned Opc = Op.getOpcode();
13367- if (Opc != ISD::UNDEF && Opc != ISD::Constant && Opc != ISD::ConstantFP)
13367+ if (!Op.isUndef() && Opc != ISD::Constant && Opc != ISD::ConstantFP)
1336813368 return false;
1336913369 }
1337013370 return true;
0 commit comments