Lines Matching refs:VT
124 bool ConstantFPSDNode::isValueValidForType(EVT VT, in isValueValidForType() argument
126 assert(VT.isFloatingPoint() && "Can only convert between FP types"); in isValueValidForType()
131 (void) Val2.convert(SelectionDAG::EVTToAPFloatSemantics(VT), in isValueValidForType()
932 EVT VT = N->getValueType(0); in VerifySDNode() local
934 assert(!VT.isVector() && (VT.isInteger() || VT.isFloatingPoint()) && in VerifySDNode()
939 assert(N->getOperand(0).getValueType().isInteger() == VT.isInteger() && in VerifySDNode()
941 assert(VT.getSizeInBits() == 2 * N->getOperand(0).getValueSizeInBits() && in VerifySDNode()
1008 EVT VT = cast<VTSDNode>(N)->getVT(); in RemoveNodeFromCSEMaps() local
1009 if (VT.isExtended()) { in RemoveNodeFromCSEMaps()
1010 Erased = ExtendedValueTypeNodes.erase(VT); in RemoveNodeFromCSEMaps()
1012 Erased = ValueTypeNodes[VT.getSimpleVT().SimpleTy] != nullptr; in RemoveNodeFromCSEMaps()
1013 ValueTypeNodes[VT.getSimpleVT().SimpleTy] = nullptr; in RemoveNodeFromCSEMaps()
1124 Align SelectionDAG::getEVTAlign(EVT VT) const { in getEVTAlign()
1125 Type *Ty = VT == MVT::iPTR ? in getEVTAlign()
1127 VT.getTypeForEVT(*getContext()); in getEVTAlign()
1243 SDValue SelectionDAG::getFPExtendOrRound(SDValue Op, const SDLoc &DL, EVT VT) { in getFPExtendOrRound() argument
1244 return VT.bitsGT(Op.getValueType()) in getFPExtendOrRound()
1245 ? getNode(ISD::FP_EXTEND, DL, VT, Op) in getFPExtendOrRound()
1246 : getNode(ISD::FP_ROUND, DL, VT, Op, getIntPtrConstant(0, DL)); in getFPExtendOrRound()
1251 const SDLoc &DL, EVT VT) { in getStrictFPExtendOrRound() argument
1252 assert(!VT.bitsEq(Op.getValueType()) && in getStrictFPExtendOrRound()
1255 VT.bitsGT(Op.getValueType()) in getStrictFPExtendOrRound()
1256 ? getNode(ISD::STRICT_FP_EXTEND, DL, {VT, MVT::Other}, {Chain, Op}) in getStrictFPExtendOrRound()
1257 : getNode(ISD::STRICT_FP_ROUND, DL, {VT, MVT::Other}, in getStrictFPExtendOrRound()
1263 SDValue SelectionDAG::getAnyExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT) { in getAnyExtOrTrunc() argument
1264 return VT.bitsGT(Op.getValueType()) ? in getAnyExtOrTrunc()
1265 getNode(ISD::ANY_EXTEND, DL, VT, Op) : in getAnyExtOrTrunc()
1266 getNode(ISD::TRUNCATE, DL, VT, Op); in getAnyExtOrTrunc()
1269 SDValue SelectionDAG::getSExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT) { in getSExtOrTrunc() argument
1270 return VT.bitsGT(Op.getValueType()) ? in getSExtOrTrunc()
1271 getNode(ISD::SIGN_EXTEND, DL, VT, Op) : in getSExtOrTrunc()
1272 getNode(ISD::TRUNCATE, DL, VT, Op); in getSExtOrTrunc()
1275 SDValue SelectionDAG::getZExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT) { in getZExtOrTrunc() argument
1276 return VT.bitsGT(Op.getValueType()) ? in getZExtOrTrunc()
1277 getNode(ISD::ZERO_EXTEND, DL, VT, Op) : in getZExtOrTrunc()
1278 getNode(ISD::TRUNCATE, DL, VT, Op); in getZExtOrTrunc()
1281 SDValue SelectionDAG::getBoolExtOrTrunc(SDValue Op, const SDLoc &SL, EVT VT, in getBoolExtOrTrunc() argument
1283 if (VT.bitsLE(Op.getValueType())) in getBoolExtOrTrunc()
1284 return getNode(ISD::TRUNCATE, SL, VT, Op); in getBoolExtOrTrunc()
1287 return getNode(TLI->getExtendForContent(BType), SL, VT, Op); in getBoolExtOrTrunc()
1290 SDValue SelectionDAG::getZeroExtendInReg(SDValue Op, const SDLoc &DL, EVT VT) { in getZeroExtendInReg() argument
1292 assert(VT.isInteger() && OpVT.isInteger() && in getZeroExtendInReg()
1294 assert(VT.isVector() == OpVT.isVector() && in getZeroExtendInReg()
1297 assert((!VT.isVector() || in getZeroExtendInReg()
1298 VT.getVectorElementCount() == OpVT.getVectorElementCount()) && in getZeroExtendInReg()
1300 assert(VT.bitsLE(OpVT) && "Not extending!"); in getZeroExtendInReg()
1301 if (OpVT == VT) in getZeroExtendInReg()
1304 VT.getScalarSizeInBits()); in getZeroExtendInReg()
1308 SDValue SelectionDAG::getPtrExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT) { in getPtrExtOrTrunc() argument
1311 return getZExtOrTrunc(Op, DL, VT); in getPtrExtOrTrunc()
1314 SDValue SelectionDAG::getPtrExtendInReg(SDValue Op, const SDLoc &DL, EVT VT) { in getPtrExtendInReg() argument
1317 return getZeroExtendInReg(Op, DL, VT); in getPtrExtendInReg()
1321 SDValue SelectionDAG::getNOT(const SDLoc &DL, SDValue Val, EVT VT) { in getNOT() argument
1322 EVT EltVT = VT.getScalarType(); in getNOT()
1324 getConstant(APInt::getAllOnesValue(EltVT.getSizeInBits()), DL, VT); in getNOT()
1325 return getNode(ISD::XOR, DL, VT, Val, NegOne); in getNOT()
1328 SDValue SelectionDAG::getLogicalNOT(const SDLoc &DL, SDValue Val, EVT VT) { in getLogicalNOT() argument
1329 SDValue TrueValue = getBoolConstant(true, DL, VT, VT); in getLogicalNOT()
1330 return getNode(ISD::XOR, DL, VT, Val, TrueValue); in getLogicalNOT()
1333 SDValue SelectionDAG::getBoolConstant(bool V, const SDLoc &DL, EVT VT, in getBoolConstant() argument
1336 return getConstant(0, DL, VT); in getBoolConstant()
1341 return getConstant(1, DL, VT); in getBoolConstant()
1343 return getAllOnesConstant(DL, VT); in getBoolConstant()
1348 SDValue SelectionDAG::getConstant(uint64_t Val, const SDLoc &DL, EVT VT, in getConstant() argument
1350 EVT EltVT = VT.getScalarType(); in getConstant()
1354 return getConstant(APInt(EltVT.getSizeInBits(), Val), DL, VT, isT, isO); in getConstant()
1357 SDValue SelectionDAG::getConstant(const APInt &Val, const SDLoc &DL, EVT VT, in getConstant() argument
1359 return getConstant(*ConstantInt::get(*Context, Val), DL, VT, isT, isO); in getConstant()
1363 EVT VT, bool isT, bool isO) { in getConstant() argument
1364 assert(VT.isInteger() && "Cannot create FP integer constant!"); in getConstant()
1366 EVT EltVT = VT.getScalarType(); in getConstant()
1373 if (VT.isVector() && TLI->getTypeAction(*getContext(), EltVT) == in getConstant()
1385 else if (NewNodesMustHaveLegalTypes && VT.isVector() && in getConstant()
1393 if (VT.isScalableVector()) { in getConstant()
1404 return getNode(ISD::SPLAT_VECTOR_PARTS, DL, VT, ScalarParts); in getConstant()
1407 unsigned ViaVecNumElts = VT.getSizeInBits() / ViaEltSizeInBits; in getConstant()
1413 assert(ViaVecVT.getSizeInBits() == VT.getSizeInBits()); in getConstant()
1416 for (unsigned i = 0; i < ViaVecNumElts / VT.getVectorNumElements(); ++i) in getConstant()
1434 for (unsigned i = 0, e = VT.getVectorNumElements(); i != e; ++i) in getConstant()
1438 getNode(ISD::BITCAST, DL, VT, getBuildVector(ViaVecVT, DL, Ops)); in getConstant()
1452 if (!VT.isVector()) in getConstant()
1463 if (VT.isScalableVector()) in getConstant()
1464 Result = getSplatVector(VT, DL, Result); in getConstant()
1465 else if (VT.isVector()) in getConstant()
1466 Result = getSplatBuildVector(VT, DL, Result); in getConstant()
1476 SDValue SelectionDAG::getShiftAmountConstant(uint64_t Val, EVT VT, in getShiftAmountConstant() argument
1478 assert(VT.isInteger() && "Shift amount is not an integer type!"); in getShiftAmountConstant()
1479 EVT ShiftVT = TLI->getShiftAmountTy(VT, getDataLayout(), LegalTypes); in getShiftAmountConstant()
1488 SDValue SelectionDAG::getConstantFP(const APFloat &V, const SDLoc &DL, EVT VT, in getConstantFP() argument
1490 return getConstantFP(*ConstantFP::get(*getContext(), V), DL, VT, isTarget); in getConstantFP()
1494 EVT VT, bool isTarget) { in getConstantFP() argument
1495 assert(VT.isFloatingPoint() && "Cannot create integer FP constant!"); in getConstantFP()
1497 EVT EltVT = VT.getScalarType(); in getConstantFP()
1509 if (!VT.isVector()) in getConstantFP()
1519 if (VT.isScalableVector()) in getConstantFP()
1520 Result = getSplatVector(VT, DL, Result); in getConstantFP()
1521 else if (VT.isVector()) in getConstantFP()
1522 Result = getSplatBuildVector(VT, DL, Result); in getConstantFP()
1527 SDValue SelectionDAG::getConstantFP(double Val, const SDLoc &DL, EVT VT, in getConstantFP() argument
1529 EVT EltVT = VT.getScalarType(); in getConstantFP()
1531 return getConstantFP(APFloat((float)Val), DL, VT, isTarget); in getConstantFP()
1533 return getConstantFP(APFloat(Val), DL, VT, isTarget); in getConstantFP()
1540 return getConstantFP(APF, DL, VT, isTarget); in getConstantFP()
1546 EVT VT, int64_t Offset, bool isTargetGA, in getGlobalAddress() argument
1563 AddNodeIDNode(ID, Opc, getVTList(VT), None); in getGlobalAddress()
1572 Opc, DL.getIROrder(), DL.getDebugLoc(), GV, VT, Offset, TargetFlags); in getGlobalAddress()
1578 SDValue SelectionDAG::getFrameIndex(int FI, EVT VT, bool isTarget) { in getFrameIndex() argument
1581 AddNodeIDNode(ID, Opc, getVTList(VT), None); in getFrameIndex()
1587 auto *N = newSDNode<FrameIndexSDNode>(FI, VT, isTarget); in getFrameIndex()
1593 SDValue SelectionDAG::getJumpTable(int JTI, EVT VT, bool isTarget, in getJumpTable() argument
1599 AddNodeIDNode(ID, Opc, getVTList(VT), None); in getJumpTable()
1606 auto *N = newSDNode<JumpTableSDNode>(JTI, VT, isTarget, TargetFlags); in getJumpTable()
1612 SDValue SelectionDAG::getConstantPool(const Constant *C, EVT VT, in getConstantPool() argument
1623 AddNodeIDNode(ID, Opc, getVTList(VT), None); in getConstantPool()
1632 auto *N = newSDNode<ConstantPoolSDNode>(isTarget, C, VT, Offset, *Alignment, in getConstantPool()
1641 SDValue SelectionDAG::getConstantPool(MachineConstantPoolValue *C, EVT VT, in getConstantPool() argument
1650 AddNodeIDNode(ID, Opc, getVTList(VT), None); in getConstantPool()
1659 auto *N = newSDNode<ConstantPoolSDNode>(isTarget, C, VT, Offset, *Alignment, in getConstantPool()
1666 SDValue SelectionDAG::getTargetIndex(int Index, EVT VT, int64_t Offset, in getTargetIndex() argument
1669 AddNodeIDNode(ID, ISD::TargetIndex, getVTList(VT), None); in getTargetIndex()
1677 auto *N = newSDNode<TargetIndexSDNode>(Index, VT, Offset, TargetFlags); in getTargetIndex()
1697 SDValue SelectionDAG::getValueType(EVT VT) { in getValueType() argument
1698 if (VT.isSimple() && (unsigned)VT.getSimpleVT().SimpleTy >= in getValueType()
1700 ValueTypeNodes.resize(VT.getSimpleVT().SimpleTy+1); in getValueType()
1702 SDNode *&N = VT.isExtended() ? in getValueType()
1703 ExtendedValueTypeNodes[VT] : ValueTypeNodes[VT.getSimpleVT().SimpleTy]; in getValueType()
1706 N = newSDNode<VTSDNode>(VT); in getValueType()
1711 SDValue SelectionDAG::getExternalSymbol(const char *Sym, EVT VT) { in getExternalSymbol() argument
1714 N = newSDNode<ExternalSymbolSDNode>(false, Sym, 0, VT); in getExternalSymbol()
1719 SDValue SelectionDAG::getMCSymbol(MCSymbol *Sym, EVT VT) { in getMCSymbol() argument
1723 N = newSDNode<MCSymbolSDNode>(Sym, VT); in getMCSymbol()
1728 SDValue SelectionDAG::getTargetExternalSymbol(const char *Sym, EVT VT, in getTargetExternalSymbol() argument
1733 N = newSDNode<ExternalSymbolSDNode>(true, Sym, TargetFlags, VT); in getTargetExternalSymbol()
1777 SDValue SelectionDAG::getVectorShuffle(EVT VT, const SDLoc &dl, SDValue N1, in getVectorShuffle() argument
1779 assert(VT.getVectorNumElements() == Mask.size() && in getVectorShuffle()
1781 assert(VT == N1.getValueType() && VT == N2.getValueType() && in getVectorShuffle()
1786 return getUNDEF(VT); in getVectorShuffle()
1800 N2 = getUNDEF(VT); in getVectorShuffle()
1854 return getUNDEF(VT); in getVectorShuffle()
1856 N2 = getUNDEF(VT); in getVectorShuffle()
1858 N1 = getUNDEF(VT); in getVectorShuffle()
1865 return getUNDEF(VT); in getVectorShuffle()
1891 return getUNDEF(VT); in getVectorShuffle()
1894 V.getValueType().getVectorNumElements() == VT.getVectorNumElements(); in getVectorShuffle()
1916 if (BuildVT != VT) in getVectorShuffle()
1917 NewBV = getNode(ISD::BITCAST, dl, VT, NewBV); in getVectorShuffle()
1925 AddNodeIDNode(ID, ISD::VECTOR_SHUFFLE, getVTList(VT), Ops); in getVectorShuffle()
1939 auto *N = newSDNode<ShuffleVectorSDNode>(VT, dl.getIROrder(), in getVectorShuffle()
1951 EVT VT = SV.getValueType(0); in getCommutedVectorShuffle() local
1957 return getVectorShuffle(VT, SDLoc(&SV), Op1, Op0, MaskVec); in getCommutedVectorShuffle()
1960 SDValue SelectionDAG::getRegister(unsigned RegNo, EVT VT) { in getRegister() argument
1962 AddNodeIDNode(ID, ISD::Register, getVTList(VT), None); in getRegister()
1968 auto *N = newSDNode<RegisterSDNode>(RegNo, VT); in getRegister()
2013 SDValue SelectionDAG::getBlockAddress(const BlockAddress *BA, EVT VT, in getBlockAddress() argument
2019 AddNodeIDNode(ID, Opc, getVTList(VT), None); in getBlockAddress()
2027 auto *N = newSDNode<BlockAddressSDNode>(Opc, VT, BA, Offset, TargetFlags); in getBlockAddress()
2063 SDValue SelectionDAG::getBitcast(EVT VT, SDValue V) { in getBitcast() argument
2064 if (VT == V.getValueType()) in getBitcast()
2067 return getNode(ISD::BITCAST, SDLoc(V), VT, V); in getBitcast()
2070 SDValue SelectionDAG::getAddrSpaceCast(const SDLoc &dl, EVT VT, SDValue Ptr, in getAddrSpaceCast() argument
2074 AddNodeIDNode(ID, ISD::ADDRSPACECAST, getVTList(VT), Ops); in getAddrSpaceCast()
2083 VT, SrcAS, DestAS); in getAddrSpaceCast()
2109 EVT VT = Node->getValueType(0); in expandVAArg() local
2130 VT.getTypeForEVT(*getContext())), in expandVAArg()
2136 return getLoad(VT, dl, Tmp1, VAList, MachinePointerInfo()); in expandVAArg()
2153 Align SelectionDAG::getReducedAlign(EVT VT, bool UseABI) { in getReducedAlign() argument
2155 Type *Ty = VT.getTypeForEVT(*getContext()); in getReducedAlign()
2158 if (TLI->isTypeLegal(VT) || !VT.isVector()) in getReducedAlign()
2170 TLI->getVectorTypeBreakdown(*getContext(), VT, IntermediateVT, in getReducedAlign()
2194 SDValue SelectionDAG::CreateStackTemporary(EVT VT, unsigned minAlign) { in CreateStackTemporary() argument
2195 Type *Ty = VT.getTypeForEVT(*getContext()); in CreateStackTemporary()
2198 return CreateStackTemporary(VT.getStoreSize(), StackAlign); in CreateStackTemporary()
2217 SDValue SelectionDAG::FoldSetCC(EVT VT, SDValue N1, SDValue N2, in FoldSetCC() argument
2225 case ISD::SETFALSE2: return getBoolConstant(false, dl, VT, OpVT); in FoldSetCC()
2227 case ISD::SETTRUE2: return getBoolConstant(true, dl, VT, OpVT); in FoldSetCC()
2250 return getUNDEF(VT); in FoldSetCC()
2255 return getUNDEF(VT); in FoldSetCC()
2260 return getBoolConstant(ISD::isTrueWhenEqual(Cond), dl, VT, OpVT); in FoldSetCC()
2270 case ISD::SETEQ: return getBoolConstant(C1 == C2, dl, VT, OpVT); in FoldSetCC()
2271 case ISD::SETNE: return getBoolConstant(C1 != C2, dl, VT, OpVT); in FoldSetCC()
2272 case ISD::SETULT: return getBoolConstant(C1.ult(C2), dl, VT, OpVT); in FoldSetCC()
2273 case ISD::SETUGT: return getBoolConstant(C1.ugt(C2), dl, VT, OpVT); in FoldSetCC()
2274 case ISD::SETULE: return getBoolConstant(C1.ule(C2), dl, VT, OpVT); in FoldSetCC()
2275 case ISD::SETUGE: return getBoolConstant(C1.uge(C2), dl, VT, OpVT); in FoldSetCC()
2276 case ISD::SETLT: return getBoolConstant(C1.slt(C2), dl, VT, OpVT); in FoldSetCC()
2277 case ISD::SETGT: return getBoolConstant(C1.sgt(C2), dl, VT, OpVT); in FoldSetCC()
2278 case ISD::SETLE: return getBoolConstant(C1.sle(C2), dl, VT, OpVT); in FoldSetCC()
2279 case ISD::SETGE: return getBoolConstant(C1.sge(C2), dl, VT, OpVT); in FoldSetCC()
2292 return getUNDEF(VT); in FoldSetCC()
2294 case ISD::SETOEQ: return getBoolConstant(R==APFloat::cmpEqual, dl, VT, in FoldSetCC()
2297 return getUNDEF(VT); in FoldSetCC()
2300 R==APFloat::cmpLessThan, dl, VT, in FoldSetCC()
2303 return getUNDEF(VT); in FoldSetCC()
2305 case ISD::SETOLT: return getBoolConstant(R==APFloat::cmpLessThan, dl, VT, in FoldSetCC()
2308 return getUNDEF(VT); in FoldSetCC()
2311 VT, OpVT); in FoldSetCC()
2313 return getUNDEF(VT); in FoldSetCC()
2316 R==APFloat::cmpEqual, dl, VT, in FoldSetCC()
2319 return getUNDEF(VT); in FoldSetCC()
2322 R==APFloat::cmpEqual, dl, VT, OpVT); in FoldSetCC()
2323 case ISD::SETO: return getBoolConstant(R!=APFloat::cmpUnordered, dl, VT, in FoldSetCC()
2325 case ISD::SETUO: return getBoolConstant(R==APFloat::cmpUnordered, dl, VT, in FoldSetCC()
2328 R==APFloat::cmpEqual, dl, VT, in FoldSetCC()
2330 case ISD::SETUNE: return getBoolConstant(R!=APFloat::cmpEqual, dl, VT, in FoldSetCC()
2333 R==APFloat::cmpLessThan, dl, VT, in FoldSetCC()
2336 R==APFloat::cmpUnordered, dl, VT, in FoldSetCC()
2339 VT, OpVT); in FoldSetCC()
2340 case ISD::SETUGE: return getBoolConstant(R!=APFloat::cmpLessThan, dl, VT, in FoldSetCC()
2348 return getSetCC(dl, VT, N2, N1, SwappedCond); in FoldSetCC()
2360 return getBoolConstant(false, dl, VT, OpVT); in FoldSetCC()
2362 return getBoolConstant(true, dl, VT, OpVT); in FoldSetCC()
2364 return getUNDEF(VT); in FoldSetCC()
2377 EVT VT = V.getValueType(); in GetDemandedBits() local
2379 if (VT.isScalableVector()) in GetDemandedBits()
2382 APInt DemandedElts = VT.isVector() in GetDemandedBits()
2383 ? APInt::getAllOnesValue(VT.getVectorNumElements()) in GetDemandedBits()
2464 EVT VT = V.getValueType(); in isSplatValue() local
2465 assert(VT.isVector() && "Vector type expected"); in isSplatValue()
2467 if (!VT.isScalableVector() && !DemandedElts) in isSplatValue()
2505 if (VT.isScalableVector()) in isSplatValue()
2508 unsigned NumElts = VT.getVectorNumElements(); in isSplatValue()
2571 EVT VT = V.getValueType(); in isSplatValue() local
2572 assert(VT.isVector() && "Vector type expected"); in isSplatValue()
2578 if (!VT.isScalableVector()) in isSplatValue()
2579 DemandedElts = APInt::getAllOnesValue(VT.getVectorNumElements()); in isSplatValue()
2587 EVT VT = V.getValueType(); in getSplatSourceVector() local
2594 if (!VT.isScalableVector()) in getSplatSourceVector()
2595 DemandedElts = APInt::getAllOnesValue(VT.getVectorNumElements()); in getSplatSourceVector()
2598 if (VT.isScalableVector()) { in getSplatSourceVector()
2606 return getUNDEF(VT); in getSplatSourceVector()
2618 if (VT.isScalableVector()) in getSplatSourceVector()
2733 EVT VT = Op.getValueType(); in computeKnownBits() local
2742 APInt DemandedElts = VT.isVector() in computeKnownBits()
2743 ? APInt::getAllOnesValue(VT.getVectorNumElements()) in computeKnownBits()
3242 EVT VT = LD->getMemoryVT(); in computeKnownBits() local
3243 unsigned MemBits = VT.getScalarSizeInBits(); in computeKnownBits()
3297 EVT VT = cast<VTSDNode>(Op.getOperand(1))->getVT(); in computeKnownBits() local
3298 APInt InMask = APInt::getLowBitsSet(BitWidth, VT.getSizeInBits()); in computeKnownBits()
3659 EVT VT = Op.getValueType(); in ComputeNumSignBits() local
3662 if (VT.isScalableVector()) in ComputeNumSignBits()
3665 APInt DemandedElts = VT.isVector() in ComputeNumSignBits()
3666 ? APInt::getAllOnesValue(VT.getVectorNumElements()) in ComputeNumSignBits()
3673 EVT VT = Op.getValueType(); in ComputeNumSignBits() local
3674 assert((VT.isInteger() || VT.isFloatingPoint()) && "Invalid VT!"); in ComputeNumSignBits()
3675 unsigned VTBits = VT.getScalarSizeInBits(); in ComputeNumSignBits()
3688 if (!DemandedElts || VT.isScalableVector()) in ComputeNumSignBits()
3771 assert(VT.isVector() && "Expected bitcast to vector"); in ComputeNumSignBits()
3904 if (TLI->getBooleanContents(VT.isVector(), false) == in ComputeNumSignBits()
4258 EVT VT = Op.getValueType(); in isGuaranteedNotToBeUndefOrPoison() local
4259 if (VT.isScalableVector()) in isGuaranteedNotToBeUndefOrPoison()
4262 APInt DemandedElts = VT.isVector() in isGuaranteedNotToBeUndefOrPoison()
4263 ? APInt::getAllOnesValue(VT.getVectorNumElements()) in isGuaranteedNotToBeUndefOrPoison()
4491 static SDValue FoldSTEP_VECTOR(const SDLoc &DL, EVT VT, SDValue Step, in FoldSTEP_VECTOR() argument
4494 return DAG.getConstant(0, DL, VT); in FoldSTEP_VECTOR()
4499 static SDValue FoldBUILD_VECTOR(const SDLoc &DL, EVT VT, in FoldBUILD_VECTOR() argument
4504 assert(!VT.isScalableVector() && in FoldBUILD_VECTOR()
4506 assert(VT.getVectorNumElements() == (unsigned)NumOps && in FoldBUILD_VECTOR()
4511 return DAG.getUNDEF(VT); in FoldBUILD_VECTOR()
4518 Ops[i].getOperand(0).getValueType() != VT || in FoldBUILD_VECTOR()
4535 static SDValue foldCONCAT_VECTORS(const SDLoc &DL, EVT VT, in foldCONCAT_VECTORS() argument
4545 VT.getVectorElementCount() && in foldCONCAT_VECTORS()
4553 return DAG.getUNDEF(VT); in foldCONCAT_VECTORS()
4564 Op.getOperand(0).getValueType() != VT || in foldCONCAT_VECTORS()
4581 if (VT.isScalableVector()) in foldCONCAT_VECTORS()
4587 EVT SVT = VT.getScalarType(); in foldCONCAT_VECTORS()
4604 if (SVT.bitsGT(VT.getScalarType())) { in foldCONCAT_VECTORS()
4615 SDValue V = DAG.getBuildVector(VT, DL, Elts); in foldCONCAT_VECTORS()
4621 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT) { in getNode() argument
4623 AddNodeIDNode(ID, Opcode, getVTList(VT), None); in getNode()
4629 getVTList(VT)); in getNode()
4638 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, in getNode() argument
4643 return getNode(Opcode, DL, VT, Operand, Flags); in getNode()
4646 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, in getNode() argument
4660 return getConstant(Val.sextOrTrunc(VT.getSizeInBits()), DL, VT, in getNode()
4667 return getConstant(Val.zextOrTrunc(VT.getSizeInBits()), DL, VT, in getNode()
4671 if (TLI->isSExtCheaperThanZExt(Operand.getValueType(), VT)) in getNode()
4672 return getConstant(Val.sextOrTrunc(VT.getSizeInBits()), DL, VT, in getNode()
4674 return getConstant(Val.zextOrTrunc(VT.getSizeInBits()), DL, VT, in getNode()
4678 APFloat apf(EVTToAPFloatSemantics(VT), in getNode()
4679 APInt::getNullValue(VT.getSizeInBits())); in getNode()
4683 return getConstantFP(apf, DL, VT); in getNode()
4686 if (VT == MVT::f16 && C->getValueType(0) == MVT::i16) in getNode()
4687 return getConstantFP(APFloat(APFloat::IEEEhalf(), Val), DL, VT); in getNode()
4688 if (VT == MVT::f32 && C->getValueType(0) == MVT::i32) in getNode()
4689 return getConstantFP(APFloat(APFloat::IEEEsingle(), Val), DL, VT); in getNode()
4690 if (VT == MVT::f64 && C->getValueType(0) == MVT::i64) in getNode()
4691 return getConstantFP(APFloat(APFloat::IEEEdouble(), Val), DL, VT); in getNode()
4692 if (VT == MVT::f128 && C->getValueType(0) == MVT::i128) in getNode()
4693 return getConstantFP(APFloat(APFloat::IEEEquad(), Val), DL, VT); in getNode()
4696 return getConstant(Val.abs(), DL, VT, C->isTargetOpcode(), in getNode()
4699 return getConstant(Val.reverseBits(), DL, VT, C->isTargetOpcode(), in getNode()
4702 return getConstant(Val.byteSwap(), DL, VT, C->isTargetOpcode(), in getNode()
4705 return getConstant(Val.countPopulation(), DL, VT, C->isTargetOpcode(), in getNode()
4709 return getConstant(Val.countLeadingZeros(), DL, VT, C->isTargetOpcode(), in getNode()
4713 return getConstant(Val.countTrailingZeros(), DL, VT, C->isTargetOpcode(), in getNode()
4722 (void)FPV.convert(EVTToAPFloatSemantics(VT), in getNode()
4724 return getConstantFP(FPV, DL, VT); in getNode()
4727 if (SDValue V = FoldSTEP_VECTOR(DL, VT, Operand, *this)) in getNode()
4740 return getConstantFP(V, DL, VT); in getNode()
4743 return getConstantFP(V, DL, VT); in getNode()
4747 return getConstantFP(V, DL, VT); in getNode()
4753 return getConstantFP(V, DL, VT); in getNode()
4759 return getConstantFP(V, DL, VT); in getNode()
4766 (void)V.convert(EVTToAPFloatSemantics(VT), in getNode()
4768 return getConstantFP(V, DL, VT); in getNode()
4773 APSInt IntVal(VT.getSizeInBits(), Opcode == ISD::FP_TO_UINT); in getNode()
4779 return getConstant(IntVal, DL, VT); in getNode()
4782 if (VT == MVT::i16 && C->getValueType(0) == MVT::f16) in getNode()
4783 return getConstant((uint16_t)V.bitcastToAPInt().getZExtValue(), DL, VT); in getNode()
4784 if (VT == MVT::i16 && C->getValueType(0) == MVT::bf16) in getNode()
4785 return getConstant((uint16_t)V.bitcastToAPInt().getZExtValue(), DL, VT); in getNode()
4786 if (VT == MVT::i32 && C->getValueType(0) == MVT::f32) in getNode()
4787 return getConstant((uint32_t)V.bitcastToAPInt().getZExtValue(), DL, VT); in getNode()
4788 if (VT == MVT::i64 && C->getValueType(0) == MVT::f64) in getNode()
4789 return getConstant(V.bitcastToAPInt().getZExtValue(), DL, VT); in getNode()
4797 return getConstant(V.bitcastToAPInt().getZExtValue(), DL, VT); in getNode()
4831 if (SDValue Fold = FoldConstantVectorArithmetic(Opcode, DL, VT, Ops)) in getNode()
4839 assert(VT.isScalableVector() && in getNode()
4842 VT.getVectorElementType() == Operand.getValueType() && in getNode()
4846 assert(VT == Operand.getValueType() && "Unexpected VT!"); in getNode()
4855 if (SDValue V = FoldBUILD_VECTOR(DL, VT, Ops, *this)) in getNode()
4861 assert(VT.isFloatingPoint() && in getNode()
4863 if (Operand.getValueType() == VT) return Operand; // noop conversion. in getNode()
4864 assert((!VT.isVector() || in getNode()
4865 VT.getVectorElementCount() == in getNode()
4868 assert(Operand.getValueType().bitsLT(VT) && in getNode()
4871 return getUNDEF(VT); in getNode()
4876 return getUNDEF(VT); in getNode()
4882 return getConstantFP(0.0, DL, VT); in getNode()
4885 assert(VT.isInteger() && Operand.getValueType().isInteger() && in getNode()
4887 assert(VT.isVector() == Operand.getValueType().isVector() && in getNode()
4890 if (Operand.getValueType() == VT) return Operand; // noop extension in getNode()
4891 assert((!VT.isVector() || in getNode()
4892 VT.getVectorElementCount() == in getNode()
4895 assert(Operand.getValueType().bitsLT(VT) && in getNode()
4898 return getNode(OpOpcode, DL, VT, Operand.getOperand(0)); in getNode()
4901 return getConstant(0, DL, VT); in getNode()
4904 assert(VT.isInteger() && Operand.getValueType().isInteger() && in getNode()
4906 assert(VT.isVector() == Operand.getValueType().isVector() && in getNode()
4909 if (Operand.getValueType() == VT) return Operand; // noop extension in getNode()
4910 assert((!VT.isVector() || in getNode()
4911 VT.getVectorElementCount() == in getNode()
4914 assert(Operand.getValueType().bitsLT(VT) && in getNode()
4917 return getNode(ISD::ZERO_EXTEND, DL, VT, Operand.getOperand(0)); in getNode()
4920 return getConstant(0, DL, VT); in getNode()
4923 assert(VT.isInteger() && Operand.getValueType().isInteger() && in getNode()
4925 assert(VT.isVector() == Operand.getValueType().isVector() && in getNode()
4928 if (Operand.getValueType() == VT) return Operand; // noop extension in getNode()
4929 assert((!VT.isVector() || in getNode()
4930 VT.getVectorElementCount() == in getNode()
4933 assert(Operand.getValueType().bitsLT(VT) && in getNode()
4939 return getNode(OpOpcode, DL, VT, Operand.getOperand(0)); in getNode()
4941 return getUNDEF(VT); in getNode()
4946 if (OpOp.getValueType() == VT) { in getNode()
4953 assert(VT.isInteger() && Operand.getValueType().isInteger() && in getNode()
4955 assert(VT.isVector() == Operand.getValueType().isVector() && in getNode()
4958 if (Operand.getValueType() == VT) return Operand; // noop truncate in getNode()
4959 assert((!VT.isVector() || in getNode()
4960 VT.getVectorElementCount() == in getNode()
4963 assert(Operand.getValueType().bitsGT(VT) && in getNode()
4966 return getNode(ISD::TRUNCATE, DL, VT, Operand.getOperand(0)); in getNode()
4971 .bitsLT(VT.getScalarType())) in getNode()
4972 return getNode(OpOpcode, DL, VT, Operand.getOperand(0)); in getNode()
4973 if (Operand.getOperand(0).getValueType().bitsGT(VT)) in getNode()
4974 return getNode(ISD::TRUNCATE, DL, VT, Operand.getOperand(0)); in getNode()
4978 return getUNDEF(VT); in getNode()
4983 assert(VT.isVector() && "This DAG node is restricted to vector types."); in getNode()
4984 assert(Operand.getValueType().bitsLE(VT) && in getNode()
4986 assert(VT.getVectorMinNumElements() < in getNode()
4991 assert(VT.isInteger() && VT == Operand.getValueType() && in getNode()
4994 return getUNDEF(VT); in getNode()
4997 assert(VT.isInteger() && VT == Operand.getValueType() && in getNode()
4999 assert((VT.getScalarSizeInBits() % 16 == 0) && in getNode()
5002 return getUNDEF(VT); in getNode()
5005 assert(VT.isInteger() && VT == Operand.getValueType() && in getNode()
5008 return getUNDEF(VT); in getNode()
5012 assert(VT.getSizeInBits() == Operand.getValueSizeInBits() && in getNode()
5014 if (VT == Operand.getValueType()) return Operand; // noop conversion. in getNode()
5016 return getNode(ISD::BITCAST, DL, VT, Operand.getOperand(0)); in getNode()
5018 return getUNDEF(VT); in getNode()
5021 assert(VT.isVector() && !Operand.getValueType().isVector() && in getNode()
5022 (VT.getVectorElementType() == Operand.getValueType() || in getNode()
5023 (VT.getVectorElementType().isInteger() && in getNode()
5025 VT.getVectorElementType().bitsLE(Operand.getValueType()))) && in getNode()
5028 return getUNDEF(VT); in getNode()
5033 Operand.getOperand(0).getValueType() == VT) in getNode()
5039 return getUNDEF(VT); in getNode()
5046 return getNode(ISD::FABS, DL, VT, Operand.getOperand(0)); in getNode()
5049 assert(VT == Operand.getValueType() && "Unexpected VT!"); in getNode()
5063 return getNode(ISD::VECREDUCE_OR, DL, VT, Operand); in getNode()
5068 return getNode(ISD::VECREDUCE_AND, DL, VT, Operand); in getNode()
5073 SDVTList VTs = getVTList(VT); in getNode()
5075 if (VT != MVT::Glue) { // Don't CSE flag producing nodes in getNode()
5153 SDValue SelectionDAG::FoldSymbolOffset(unsigned Opcode, EVT VT, in FoldSymbolOffset() argument
5169 return getGlobalAddress(GA->getGlobal(), SDLoc(C2), VT, in FoldSymbolOffset()
5199 EVT VT, ArrayRef<SDValue> Ops) { in FoldConstantArithmetic() argument
5216 return getUNDEF(VT); in FoldConstantArithmetic()
5232 SDValue Folded = getConstant(FoldAttempt.getValue(), DL, VT); in FoldConstantArithmetic()
5233 assert((!Folded || !VT.isVector()) && in FoldConstantArithmetic()
5241 return FoldSymbolOffset(Opcode, VT, GA, N2); in FoldConstantArithmetic()
5244 return FoldSymbolOffset(Opcode, VT, GA, N1); in FoldConstantArithmetic()
5260 EVT SVT = VT.getScalarType(); in FoldConstantArithmetic()
5277 assert((!VT.isScalableVector() || NumOps == 1) && in FoldConstantArithmetic()
5323 assert(VT.getVectorNumElements() == Outputs.size() && in FoldConstantArithmetic()
5327 return getBuildVector(VT, SDLoc(), Outputs); in FoldConstantArithmetic()
5335 return getSplatVector(VT, SDLoc(), Outputs[0]); in FoldConstantArithmetic()
5340 const SDLoc &DL, EVT VT, in FoldConstantVectorArithmetic() argument
5350 return getUNDEF(VT); in FoldConstantVectorArithmetic()
5353 if (!VT.isVector()) in FoldConstantVectorArithmetic()
5356 ElementCount NumElts = VT.getVectorElementCount(); in FoldConstantVectorArithmetic()
5381 EVT SVT = (Opcode == ISD::SETCC ? MVT::i1 : VT.getScalarType()); in FoldConstantVectorArithmetic()
5385 EVT LegalSVT = VT.getScalarType(); in FoldConstantVectorArithmetic()
5388 if (LegalSVT.bitsLT(VT.getScalarType())) in FoldConstantVectorArithmetic()
5439 SDValue V = NumElts.isScalable() ? getSplatVector(VT, DL, ScalarResults[0]) in FoldConstantVectorArithmetic()
5440 : getBuildVector(VT, DL, ScalarResults); in FoldConstantVectorArithmetic()
5446 EVT VT, SDValue N1, SDValue N2) { in foldConstantFPMath() argument
5458 return getConstantFP(C1, DL, VT); in foldConstantFPMath()
5461 return getConstantFP(C1, DL, VT); in foldConstantFPMath()
5464 return getConstantFP(C1, DL, VT); in foldConstantFPMath()
5467 return getConstantFP(C1, DL, VT); in foldConstantFPMath()
5470 return getConstantFP(C1, DL, VT); in foldConstantFPMath()
5473 return getConstantFP(C1, DL, VT); in foldConstantFPMath()
5482 (void) C1.convert(EVTToAPFloatSemantics(VT), APFloat::rmNearestTiesToEven, in foldConstantFPMath()
5484 return getConstantFP(C1, DL, VT); in foldConstantFPMath()
5491 return getUNDEF(VT); in foldConstantFPMath()
5501 return getUNDEF(VT); in foldConstantFPMath()
5503 return getConstantFP(APFloat::getNaN(EVTToAPFloatSemantics(VT)), DL, VT); in foldConstantFPMath()
5536 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, in getNode() argument
5541 return getNode(Opcode, DL, VT, N1, N2, Flags); in getNode()
5544 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, in getNode() argument
5568 assert(VT == MVT::Other && N1.getValueType() == MVT::Other && in getNode()
5578 if (SDValue V = FoldBUILD_VECTOR(DL, VT, Ops, *this)) in getNode()
5584 if (SDValue V = foldCONCAT_VECTORS(DL, VT, Ops, *this)) in getNode()
5589 assert(VT.isInteger() && "This operator does not apply to FP types!"); in getNode()
5591 N1.getValueType() == VT && "Binary operator types must match!"); in getNode()
5603 assert(VT.isInteger() && "This operator does not apply to FP types!"); in getNode()
5605 N1.getValueType() == VT && "Binary operator types must match!"); in getNode()
5610 if ((Opcode == ISD::ADD || Opcode == ISD::SUB) && VT.isVector() && in getNode()
5611 VT.getVectorElementType() == MVT::i1) in getNode()
5612 return getNode(ISD::XOR, DL, VT, N1, N2); in getNode()
5615 assert(VT.isInteger() && "This operator does not apply to FP types!"); in getNode()
5617 N1.getValueType() == VT && "Binary operator types must match!"); in getNode()
5618 if (VT.isVector() && VT.getVectorElementType() == MVT::i1) in getNode()
5619 return getNode(ISD::AND, DL, VT, N1, N2); in getNode()
5623 return getVScale(DL, VT, MulImm * N2CImm); in getNode()
5636 assert(VT.isInteger() && "This operator does not apply to FP types!"); in getNode()
5638 N1.getValueType() == VT && "Binary operator types must match!"); in getNode()
5639 if (VT.isVector() && VT.getVectorElementType() == MVT::i1) { in getNode()
5642 return getNode(ISD::OR, DL, VT, N1, N2); in getNode()
5645 return getNode(ISD::AND, DL, VT, N1, getNOT(DL, N2, VT)); in getNode()
5650 assert(VT.isInteger() && "This operator does not apply to FP types!"); in getNode()
5652 N1.getValueType() == VT && "Binary operator types must match!"); in getNode()
5653 if (VT.isVector() && VT.getVectorElementType() == MVT::i1) in getNode()
5654 return getNode(ISD::OR, DL, VT, N1, N2); in getNode()
5658 assert(VT.isInteger() && "This operator does not apply to FP types!"); in getNode()
5660 N1.getValueType() == VT && "Binary operator types must match!"); in getNode()
5661 if (VT.isVector() && VT.getVectorElementType() == MVT::i1) in getNode()
5662 return getNode(ISD::AND, DL, VT, N1, N2); in getNode()
5669 assert(VT.isFloatingPoint() && "This operator only applies to FP types!"); in getNode()
5671 N1.getValueType() == VT && "Binary operator types must match!"); in getNode()
5676 assert(N1.getValueType() == VT && in getNode()
5685 return getVScale(DL, VT, MulImm << ShiftImm); in getNode()
5695 assert(VT == N1.getValueType() && in getNode()
5697 assert(VT.isInteger() && N2.getValueType().isInteger() && in getNode()
5699 assert((!VT.isVector() || VT == N2.getValueType()) && in getNode()
5706 Log2_32_Ceil(VT.getScalarSizeInBits()) && in getNode()
5712 if (VT == MVT::i1) in getNode()
5718 assert(VT.isFloatingPoint() && in getNode()
5720 VT.bitsLE(N1.getValueType()) && in getNode()
5723 if (N1.getValueType() == VT) return N1; // noop conversion. in getNode()
5728 assert(VT == N1.getValueType() && "Not an inreg extend!"); in getNode()
5729 assert(VT.isInteger() && EVT.isInteger() && in getNode()
5734 assert(EVT.bitsLE(VT.getScalarType()) && "Not extending!"); in getNode()
5735 if (VT.getScalarType() == EVT) return N1; // noop assertion. in getNode()
5740 assert(VT == N1.getValueType() && "Not an inreg extend!"); in getNode()
5741 assert(VT.isInteger() && EVT.isInteger() && in getNode()
5743 assert(EVT.isVector() == VT.isVector() && in getNode()
5747 EVT.getVectorElementCount() == VT.getVectorElementCount()) && in getNode()
5749 assert(EVT.bitsLE(VT) && "Not extending!"); in getNode()
5750 if (EVT == VT) return N1; // Not actually extending in getNode()
5761 return SignExtendInReg(Val, VT); in getNode()
5767 for (int i = 0, e = VT.getVectorNumElements(); i != e; ++i) { in getNode()
5777 return getBuildVector(VT, DL, Ops); in getNode()
5783 assert(VT.isInteger() && cast<VTSDNode>(N2)->getVT().isInteger() && in getNode()
5785 assert(N1.getValueType().isVector() == VT.isVector() && in getNode()
5788 assert((!VT.isVector() || VT.getVectorNumElements() == in getNode()
5793 assert(cast<VTSDNode>(N2)->getVT().bitsLE(VT.getScalarType()) && in getNode()
5798 assert(VT.getSizeInBits() >= N1.getValueType().getScalarSizeInBits() && in getNode()
5804 return getUNDEF(VT); in getNode()
5811 return getUNDEF(VT); in getNode()
5821 return getNode(ISD::EXTRACT_VECTOR_ELT, DL, VT, in getNode()
5837 if (VT != Elt.getValueType()) in getNode()
5841 Elt = getAnyExtOrTrunc(Elt, DL, VT); in getNode()
5857 if (VT == N1.getOperand(1).getValueType()) in getNode()
5859 return getSExtOrTrunc(N1.getOperand(1), DL, VT); in getNode()
5861 return getNode(ISD::EXTRACT_VECTOR_ELT, DL, VT, N1.getOperand(0), N2); in getNode()
5876 return getNode(ISD::EXTRACT_VECTOR_ELT, DL, VT, N1.getOperand(0), in getNode()
5882 assert(!N1.getValueType().isVector() && !VT.isVector() && in getNode()
5883 (N1.getValueType().isInteger() == VT.isInteger()) && in getNode()
5884 N1.getValueType() != VT && in getNode()
5895 unsigned ElementSize = VT.getSizeInBits(); in getNode()
5898 return getConstant(Val.extractBits(ElementSize, Shift), DL, VT); in getNode()
5903 assert(VT.isVector() && N1VT.isVector() && in getNode()
5905 assert(VT.getVectorElementType() == N1VT.getVectorElementType() && in getNode()
5907 assert((VT.isFixedLengthVector() || N1VT.isScalableVector()) && in getNode()
5909 assert((VT.isScalableVector() != N1VT.isScalableVector() || in getNode()
5910 VT.getVectorMinNumElements() <= N1VT.getVectorMinNumElements()) && in getNode()
5913 assert((VT.isScalableVector() != N1VT.isScalableVector() || in getNode()
5914 (VT.getVectorMinNumElements() + N2C->getZExtValue()) <= in getNode()
5922 if (VT == N1VT) in getNode()
5927 return getUNDEF(VT); in getNode()
5932 VT == N1.getOperand(0).getValueType()) { in getNode()
5933 unsigned Factor = VT.getVectorMinNumElements(); in getNode()
5940 VT == N1.getOperand(1).getValueType()) in getNode()
5947 if (SDValue SV = FoldConstantArithmetic(Opcode, DL, VT, {N1, N2})) in getNode()
5950 if (SDValue V = foldConstantFPMath(Opcode, DL, VT, N1, N2)) in getNode()
5961 return getUNDEF(VT); // fold op(undef, arg2) -> undef in getNode()
5968 return getConstant(0, DL, VT); // fold op(undef, arg2) -> 0 in getNode()
5980 return getConstant(0, DL, VT); in getNode()
5988 return getUNDEF(VT); // fold op(arg1, undef) -> undef in getNode()
5993 return getConstant(0, DL, VT); // fold op(arg1, undef) -> 0 in getNode()
5997 return getAllOnesConstant(DL, VT); in getNode()
6003 SDVTList VTs = getVTList(VT); in getNode()
6005 if (VT != MVT::Glue) { in getNode()
6029 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, in getNode() argument
6034 return getNode(Opcode, DL, VT, N1, N2, N3, Flags); in getNode()
6037 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, in getNode() argument
6047 assert(VT.isFloatingPoint() && "This operator only applies to FP types!"); in getNode()
6048 assert(N1.getValueType() == VT && N2.getValueType() == VT && in getNode()
6049 N3.getValueType() == VT && "FMA types must match!"); in getNode()
6058 return getConstantFP(V1, DL, VT); in getNode()
6065 if (SDValue V = FoldBUILD_VECTOR(DL, VT, Ops, *this)) in getNode()
6071 if (SDValue V = foldCONCAT_VECTORS(DL, VT, Ops, *this)) in getNode()
6076 assert(VT.isInteger() && "SETCC result type must be an integer!"); in getNode()
6079 assert(VT.isVector() == N1.getValueType().isVector() && in getNode()
6081 assert((!VT.isVector() || VT.getVectorElementCount() == in getNode()
6085 if (SDValue V = FoldSetCC(VT, N1, N2, cast<CondCodeSDNode>(N3)->get(), DL)) in getNode()
6089 if (SDValue V = FoldConstantVectorArithmetic(Opcode, DL, VT, Ops)) { in getNode()
6109 return getUNDEF(VT); in getNode()
6113 return getUNDEF(VT); in getNode()
6124 return getUNDEF(VT); in getNode()
6127 assert(VT == N1.getValueType() && in getNode()
6129 assert(VT.isVector() && N2VT.isVector() && in getNode()
6131 assert((VT.isScalableVector() || N2VT.isFixedLengthVector()) && in getNode()
6133 assert((VT.isScalableVector() != N2VT.isScalableVector() || in getNode()
6134 VT.getVectorMinNumElements() >= N2VT.getVectorMinNumElements()) && in getNode()
6138 assert((VT.isScalableVector() != N2VT.isScalableVector() || in getNode()
6141 VT.getVectorMinNumElements()) && in getNode()
6148 if (VT == N2VT) in getNode()
6154 N2.getOperand(1) == N3 && N2.getOperand(0).getValueType() == VT) in getNode()
6160 if (N1.getValueType() == VT) in getNode()
6167 SDVTList VTs = getVTList(VT); in getNode()
6169 if (VT != MVT::Glue) { in getNode()
6193 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, in getNode() argument
6196 return getNode(Opcode, DL, VT, Ops); in getNode()
6199 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, in getNode() argument
6203 return getNode(Opcode, DL, VT, Ops); in getNode()
6230 static SDValue getMemsetValue(SDValue Value, EVT VT, SelectionDAG &DAG, in getMemsetValue() argument
6234 unsigned NumBits = VT.getScalarSizeInBits(); in getMemsetValue()
6238 if (VT.isInteger()) { in getMemsetValue()
6239 bool IsOpaque = VT.getSizeInBits() > 64 || in getMemsetValue()
6241 return DAG.getConstant(Val, dl, VT, false, IsOpaque); in getMemsetValue()
6243 return DAG.getConstantFP(APFloat(DAG.EVTToAPFloatSemantics(VT), Val), dl, in getMemsetValue()
6244 VT); in getMemsetValue()
6248 EVT IntVT = VT.getScalarType(); in getMemsetValue()
6261 if (VT != Value.getValueType() && !VT.isInteger()) in getMemsetValue()
6262 Value = DAG.getBitcast(VT.getScalarType(), Value); in getMemsetValue()
6263 if (VT != Value.getValueType()) in getMemsetValue()
6264 Value = DAG.getSplatBuildVector(VT, dl, Value); in getMemsetValue()
6272 static SDValue getMemsetStringVal(EVT VT, const SDLoc &dl, SelectionDAG &DAG, in getMemsetStringVal() argument
6277 if (VT.isInteger()) in getMemsetStringVal()
6278 return DAG.getConstant(0, dl, VT); in getMemsetStringVal()
6279 if (VT == MVT::f32 || VT == MVT::f64 || VT == MVT::f128) in getMemsetStringVal()
6280 return DAG.getConstantFP(0.0, dl, VT); in getMemsetStringVal()
6281 if (VT.isVector()) { in getMemsetStringVal()
6282 unsigned NumElts = VT.getVectorNumElements(); in getMemsetStringVal()
6283 MVT EltVT = (VT.getVectorElementType() == MVT::f32) ? MVT::i32 : MVT::i64; in getMemsetStringVal()
6284 return DAG.getNode(ISD::BITCAST, dl, VT, in getMemsetStringVal()
6292 assert(!VT.isVector() && "Can't handle vector type here!"); in getMemsetStringVal()
6293 unsigned NumVTBits = VT.getSizeInBits(); in getMemsetStringVal()
6308 Type *Ty = VT.getTypeForEVT(*DAG.getContext()); in getMemsetStringVal()
6310 return DAG.getConstant(Val, dl, VT); in getMemsetStringVal()
6317 EVT VT = Base.getValueType(); in getMemBasePlusOffset() local
6325 Index = getConstant(Offset.getFixedSize(), DL, VT); in getMemBasePlusOffset()
6468 EVT VT = MemOps[i]; in getMemcpyLoadsAndStores() local
6469 unsigned VTSize = VT.getSizeInBits() / 8; in getMemcpyLoadsAndStores()
6481 (isZeroConstant || (VT.isInteger() && !VT.isVector()))) { in getMemcpyLoadsAndStores()
6497 Value = getMemsetStringVal(VT, dl, DAG, TLI, SubSlice); in getMemcpyLoadsAndStores()
6513 EVT NVT = TLI.getTypeToTransformTo(C, VT); in getMemcpyLoadsAndStores()
6514 assert(NVT.bitsGE(VT)); in getMemcpyLoadsAndStores()
6525 SrcPtrInfo.getWithOffset(SrcOff), VT, in getMemcpyLoadsAndStores()
6532 DstPtrInfo.getWithOffset(DstOff), VT, Alignment, MMOFlags, NewAAInfo); in getMemcpyLoadsAndStores()
6647 EVT VT = MemOps[i]; in getMemmoveLoadsAndStores() local
6648 unsigned VTSize = VT.getSizeInBits() / 8; in getMemmoveLoadsAndStores()
6658 VT, dl, Chain, in getMemmoveLoadsAndStores()
6668 EVT VT = MemOps[i]; in getMemmoveLoadsAndStores() local
6669 unsigned VTSize = VT.getSizeInBits() / 8; in getMemmoveLoadsAndStores()
6757 EVT VT = MemOps[i]; in getMemsetStores() local
6758 unsigned VTSize = VT.getSizeInBits() / 8; in getMemsetStores()
6769 if (VT.bitsLT(LargestVT)) { in getMemsetStores()
6770 if (!LargestVT.isVector() && !VT.isVector() && in getMemsetStores()
6771 TLI.isTruncateFree(LargestVT, VT)) in getMemsetStores()
6772 Value = DAG.getNode(ISD::TRUNCATE, dl, VT, MemSetValue); in getMemsetStores()
6774 Value = getMemsetValue(Src, VT, DAG, dl); in getMemsetStores()
6776 assert(Value.getValueType() == VT && "Value with wrong type."); in getMemsetStores()
6784 DstOff += VT.getSizeInBits() / 8; in getMemsetStores()
7173 EVT VT = Val.getValueType(); in getAtomic() local
7176 getVTList(VT, MVT::Other); in getAtomic()
7182 EVT VT, SDValue Chain, SDValue Ptr, in getAtomic() argument
7186 SDVTList VTs = getVTList(VT, MVT::Other); in getAtomic()
7354 EVT VT, const SDLoc &dl, SDValue Chain, in getLoad() argument
7374 return getLoad(AM, ExtType, VT, dl, Chain, Ptr, Offset, MemVT, MMO); in getLoad()
7378 EVT VT, const SDLoc &dl, SDValue Chain, in getLoad() argument
7381 if (VT == MemVT) { in getLoad()
7384 assert(VT == MemVT && "Non-extending load from different memory type!"); in getLoad()
7387 assert(MemVT.getScalarType().bitsLT(VT.getScalarType()) && in getLoad()
7389 assert(VT.isInteger() == MemVT.isInteger() && in getLoad()
7391 assert(VT.isVector() == MemVT.isVector() && in getLoad()
7393 assert((!VT.isVector() || in getLoad()
7394 VT.getVectorElementCount() == MemVT.getVectorElementCount()) && in getLoad()
7402 getVTList(VT, Ptr.getValueType(), MVT::Other) : getVTList(VT, MVT::Other); in getLoad()
7426 SDValue SelectionDAG::getLoad(EVT VT, const SDLoc &dl, SDValue Chain, in getLoad() argument
7432 return getLoad(ISD::UNINDEXED, ISD::NON_EXTLOAD, VT, dl, Chain, Ptr, Undef, in getLoad()
7433 PtrInfo, VT, Alignment, MMOFlags, AAInfo, Ranges); in getLoad()
7436 SDValue SelectionDAG::getLoad(EVT VT, const SDLoc &dl, SDValue Chain, in getLoad() argument
7439 return getLoad(ISD::UNINDEXED, ISD::NON_EXTLOAD, VT, dl, Chain, Ptr, Undef, in getLoad()
7440 VT, MMO); in getLoad()
7444 EVT VT, SDValue Chain, SDValue Ptr, in getExtLoad() argument
7450 return getLoad(ISD::UNINDEXED, ExtType, VT, dl, Chain, Ptr, Undef, PtrInfo, in getExtLoad()
7455 EVT VT, SDValue Chain, SDValue Ptr, EVT MemVT, in getExtLoad() argument
7458 return getLoad(ISD::UNINDEXED, ExtType, VT, dl, Chain, Ptr, Undef, in getExtLoad()
7501 EVT VT = Val.getValueType(); in getStore() local
7507 ID.AddInteger(VT.getRawBits()); in getStore()
7509 dl.getIROrder(), VTs, ISD::UNINDEXED, false, VT, MMO)); in getStore()
7517 ISD::UNINDEXED, false, VT, MMO); in getStore()
7551 EVT VT = Val.getValueType(); in getTruncStore() local
7555 if (VT == SVT) in getTruncStore()
7558 assert(SVT.getScalarType().bitsLT(VT.getScalarType()) && in getTruncStore()
7560 assert(VT.isInteger() == SVT.isInteger() && in getTruncStore()
7562 assert(VT.isVector() == SVT.isVector() && in getTruncStore()
7564 assert((!VT.isVector() || in getTruncStore()
7565 VT.getVectorElementCount() == SVT.getVectorElementCount()) && in getTruncStore()
7621 SDValue SelectionDAG::getMaskedLoad(EVT VT, const SDLoc &dl, SDValue Chain, in getMaskedLoad() argument
7630 SDVTList VTs = Indexed ? getVTList(VT, Base.getValueType(), MVT::Other) in getMaskedLoad()
7631 : getVTList(VT, MVT::Other); in getMaskedLoad()
7906 SDValue SelectionDAG::getVAArg(EVT VT, const SDLoc &dl, SDValue Chain, in getVAArg() argument
7909 return getNode(ISD::VAARG, dl, getVTList(VT, MVT::Other), Ops); in getVAArg()
7912 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, in getNode() argument
7915 case 0: return getNode(Opcode, DL, VT); in getNode()
7916 case 1: return getNode(Opcode, DL, VT, static_cast<const SDValue>(Ops[0])); in getNode()
7917 case 2: return getNode(Opcode, DL, VT, Ops[0], Ops[1]); in getNode()
7918 case 3: return getNode(Opcode, DL, VT, Ops[0], Ops[1], Ops[2]); in getNode()
7925 return getNode(Opcode, DL, VT, NewOps); in getNode()
7928 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, in getNode() argument
7933 return getNode(Opcode, DL, VT, Ops, Flags); in getNode()
7936 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, in getNode() argument
7940 case 0: return getNode(Opcode, DL, VT); in getNode()
7941 case 1: return getNode(Opcode, DL, VT, Ops[0], Flags); in getNode()
7942 case 2: return getNode(Opcode, DL, VT, Ops[0], Ops[1], Flags); in getNode()
7943 case 3: return getNode(Opcode, DL, VT, Ops[0], Ops[1], Ops[2], Flags); in getNode()
7957 if (SDValue V = FoldBUILD_VECTOR(DL, VT, Ops, *this)) in getNode()
7961 if (SDValue V = foldCONCAT_VECTORS(DL, VT, Ops, *this)) in getNode()
7970 assert(Ops[2].getValueType() == VT && in getNode()
7982 SDVTList VTs = getVTList(VT); in getNode()
7984 if (VT != MVT::Glue) { in getNode()
8074 return getNode(Opcode, DL, VT, N1, N2, N3.getOperand(0)); in getNode()
8079 unsigned NumBits = VT.getScalarSizeInBits()*2; in getNode()
8081 return getNode(Opcode, DL, VT, N1, N2, N3.getOperand(0)); in getNode()
8147 SDVTList SelectionDAG::getVTList(EVT VT) { in getVTList() argument
8148 return makeVTList(SDNode::getValueTypeList(VT), 1); in getVTList()
8378 EVT VT) { in SelectNodeTo() argument
8379 SDVTList VTs = getVTList(VT); in SelectNodeTo()
8384 EVT VT, SDValue Op1) { in SelectNodeTo() argument
8385 SDVTList VTs = getVTList(VT); in SelectNodeTo()
8391 EVT VT, SDValue Op1, in SelectNodeTo() argument
8393 SDVTList VTs = getVTList(VT); in SelectNodeTo()
8399 EVT VT, SDValue Op1, in SelectNodeTo() argument
8401 SDVTList VTs = getVTList(VT); in SelectNodeTo()
8407 EVT VT, ArrayRef<SDValue> Ops) { in SelectNodeTo() argument
8408 SDVTList VTs = getVTList(VT); in SelectNodeTo()
8586 EVT VT) { in getMachineNode() argument
8587 SDVTList VTs = getVTList(VT); in getMachineNode()
8592 EVT VT, SDValue Op1) { in getMachineNode() argument
8593 SDVTList VTs = getVTList(VT); in getMachineNode()
8599 EVT VT, SDValue Op1, SDValue Op2) { in getMachineNode() argument
8600 SDVTList VTs = getVTList(VT); in getMachineNode()
8606 EVT VT, SDValue Op1, SDValue Op2, in getMachineNode() argument
8608 SDVTList VTs = getVTList(VT); in getMachineNode()
8614 EVT VT, ArrayRef<SDValue> Ops) { in getMachineNode() argument
8615 SDVTList VTs = getVTList(VT); in getMachineNode()
8703 SDValue SelectionDAG::getTargetExtractSubreg(int SRIdx, const SDLoc &DL, EVT VT, in getTargetExtractSubreg() argument
8707 VT, Operand, SRIdxVal); in getTargetExtractSubreg()
8713 SDValue SelectionDAG::getTargetInsertSubreg(int SRIdx, const SDLoc &DL, EVT VT, in getTargetInsertSubreg() argument
8717 VT, Operand, Subreg, SRIdxVal); in getTargetInsertSubreg()
9696 const GlobalValue *GA, EVT VT, in GlobalAddressSDNode() argument
9698 : SDNode(Opc, Order, DL, getSDVTList(VT)), Offset(o), TargetFlags(TF) { in GlobalAddressSDNode()
9703 EVT VT, unsigned SrcAS, in AddrSpaceCastSDNode() argument
9705 : SDNode(ISD::ADDRSPACECAST, Order, dl, getSDVTList(VT)), in AddrSpaceCastSDNode()
9750 const EVT *SDNode::getValueTypeList(EVT VT) { in getValueTypeList() argument
9751 if (VT.isExtended()) { in getValueTypeList()
9753 return &(*EVTs->insert(VT).first); in getValueTypeList()
9755 assert(VT.getSimpleVT() < MVT::VALUETYPE_SIZE && "Value type out of range!"); in getValueTypeList()
9756 return &SimpleVTArray->VTs[VT.getSimpleVT().SimpleTy]; in getValueTypeList()
10008 EVT VT = N->getValueType(0); in UnrollVectorOp() local
10009 unsigned NE = VT.getVectorNumElements(); in UnrollVectorOp()
10010 EVT EltVT = VT.getVectorElementType(); in UnrollVectorOp()
10135 EVT VT = LD->getValueType(0); in areNonVolatileConsecutiveLoads() local
10136 if (VT.getSizeInBits() / 8 != Bytes) in areNonVolatileConsecutiveLoads()
10186 std::pair<EVT, EVT> SelectionDAG::GetSplitDestVTs(const EVT &VT) const { in GetSplitDestVTs()
10189 if (!VT.isVector()) in GetSplitDestVTs()
10190 LoVT = HiVT = TLI->getTypeToTransformTo(*getContext(), VT); in GetSplitDestVTs()
10192 LoVT = HiVT = VT.getHalfNumVectorElementsVT(*getContext()); in GetSplitDestVTs()
10201 SelectionDAG::GetDependentSplitDestVTs(const EVT &VT, const EVT &EnvVT, in GetDependentSplitDestVTs() argument
10203 EVT EltTp = VT.getVectorElementType(); in GetDependentSplitDestVTs()
10209 ElementCount VTNumElts = VT.getVectorElementCount(); in GetDependentSplitDestVTs()
10254 EVT VT = N.getValueType(); in WidenVector() local
10255 EVT WideVT = EVT::getVectorVT(*getContext(), VT.getVectorElementType(), in WidenVector()
10256 NextPowerOf2(VT.getVectorNumElements())); in WidenVector()
10265 EVT VT = Op.getValueType(); in ExtractVectorElements() local
10267 Count = VT.getVectorNumElements(); in ExtractVectorElements()
10269 EltVT = VT.getVectorElementType(); in ExtractVectorElements()
10293 EVT VT = getValueType(0); in isConstantSplat() local
10294 assert(VT.isVector() && "Expected a vector type"); in isConstantSplat()
10295 unsigned VecWidth = VT.getSizeInBits(); in isConstantSplat()
10310 unsigned EltWidth = VT.getScalarSizeInBits(); in isConstantSplat()
10497 bool ShuffleVectorSDNode::isSplatMask(const int *Mask, EVT VT) { in isSplatMask() argument
10500 for (i = 0, e = VT.getVectorNumElements(); i != e && Mask[i] < 0; ++i) in isSplatMask()
10584 EVT VT, SDNodeFlags Flags) { in getNeutralElement() argument
10592 return getConstant(0, DL, VT); in getNeutralElement()
10594 return getConstant(1, DL, VT); in getNeutralElement()
10597 return getAllOnesConstant(DL, VT); in getNeutralElement()
10599 return getConstant(APInt::getSignedMinValue(VT.getSizeInBits()), DL, VT); in getNeutralElement()
10601 return getConstant(APInt::getSignedMaxValue(VT.getSizeInBits()), DL, VT); in getNeutralElement()
10603 return getConstantFP(-0.0, DL, VT); in getNeutralElement()
10605 return getConstantFP(1.0, DL, VT); in getNeutralElement()
10609 const fltSemantics &Semantics = EVTToAPFloatSemantics(VT); in getNeutralElement()
10616 return getConstantFP(NeutralAF, DL, VT); in getNeutralElement()