Lines Matching refs:VT

126 bool ConstantFPSDNode::isValueValidForType(EVT VT,  in isValueValidForType()  argument
128 assert(VT.isFloatingPoint() && "Can only convert between FP types"); in isValueValidForType()
133 (void) Val2.convert(SelectionDAG::EVTToAPFloatSemantics(VT), in isValueValidForType()
1118 EVT VT = N->getValueType(0); in VerifySDNode() local
1120 assert(!VT.isVector() && (VT.isInteger() || VT.isFloatingPoint()) && in VerifySDNode()
1125 assert(N->getOperand(0).getValueType().isInteger() == VT.isInteger() && in VerifySDNode()
1127 assert(VT.getSizeInBits() == 2 * N->getOperand(0).getValueSizeInBits() && in VerifySDNode()
1194 EVT VT = cast<VTSDNode>(N)->getVT(); in RemoveNodeFromCSEMaps() local
1195 if (VT.isExtended()) { in RemoveNodeFromCSEMaps()
1196 Erased = ExtendedValueTypeNodes.erase(VT); in RemoveNodeFromCSEMaps()
1198 Erased = ValueTypeNodes[VT.getSimpleVT().SimpleTy] != nullptr; in RemoveNodeFromCSEMaps()
1199 ValueTypeNodes[VT.getSimpleVT().SimpleTy] = nullptr; in RemoveNodeFromCSEMaps()
1310 Align SelectionDAG::getEVTAlign(EVT VT) const { in getEVTAlign()
1311 Type *Ty = VT == MVT::iPTR ? PointerType::get(*getContext(), 0) in getEVTAlign()
1312 : VT.getTypeForEVT(*getContext()); in getEVTAlign()
1429 SDValue SelectionDAG::getFPExtendOrRound(SDValue Op, const SDLoc &DL, EVT VT) { in getFPExtendOrRound() argument
1430 return VT.bitsGT(Op.getValueType()) in getFPExtendOrRound()
1431 ? getNode(ISD::FP_EXTEND, DL, VT, Op) in getFPExtendOrRound()
1432 : getNode(ISD::FP_ROUND, DL, VT, Op, in getFPExtendOrRound()
1438 const SDLoc &DL, EVT VT) { in getStrictFPExtendOrRound() argument
1439 assert(!VT.bitsEq(Op.getValueType()) && in getStrictFPExtendOrRound()
1442 VT.bitsGT(Op.getValueType()) in getStrictFPExtendOrRound()
1443 ? getNode(ISD::STRICT_FP_EXTEND, DL, {VT, MVT::Other}, {Chain, Op}) in getStrictFPExtendOrRound()
1444 : getNode(ISD::STRICT_FP_ROUND, DL, {VT, MVT::Other}, in getStrictFPExtendOrRound()
1450 SDValue SelectionDAG::getAnyExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT) { in getAnyExtOrTrunc() argument
1451 return VT.bitsGT(Op.getValueType()) ? in getAnyExtOrTrunc()
1452 getNode(ISD::ANY_EXTEND, DL, VT, Op) : in getAnyExtOrTrunc()
1453 getNode(ISD::TRUNCATE, DL, VT, Op); in getAnyExtOrTrunc()
1456 SDValue SelectionDAG::getSExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT) { in getSExtOrTrunc() argument
1457 return VT.bitsGT(Op.getValueType()) ? in getSExtOrTrunc()
1458 getNode(ISD::SIGN_EXTEND, DL, VT, Op) : in getSExtOrTrunc()
1459 getNode(ISD::TRUNCATE, DL, VT, Op); in getSExtOrTrunc()
1462 SDValue SelectionDAG::getZExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT) { in getZExtOrTrunc() argument
1463 return VT.bitsGT(Op.getValueType()) ? in getZExtOrTrunc()
1464 getNode(ISD::ZERO_EXTEND, DL, VT, Op) : in getZExtOrTrunc()
1465 getNode(ISD::TRUNCATE, DL, VT, Op); in getZExtOrTrunc()
1469 EVT VT) { in getBitcastedAnyExtOrTrunc() argument
1470 assert(!VT.isVector()); in getBitcastedAnyExtOrTrunc()
1473 if (Type == VT) in getBitcastedAnyExtOrTrunc()
1477 if (DestOp.getValueType() == VT) in getBitcastedAnyExtOrTrunc()
1480 return getAnyExtOrTrunc(DestOp, DL, VT); in getBitcastedAnyExtOrTrunc()
1484 EVT VT) { in getBitcastedSExtOrTrunc() argument
1485 assert(!VT.isVector()); in getBitcastedSExtOrTrunc()
1488 if (Type == VT) in getBitcastedSExtOrTrunc()
1492 if (DestOp.getValueType() == VT) in getBitcastedSExtOrTrunc()
1495 return getSExtOrTrunc(DestOp, DL, VT); in getBitcastedSExtOrTrunc()
1499 EVT VT) { in getBitcastedZExtOrTrunc() argument
1500 assert(!VT.isVector()); in getBitcastedZExtOrTrunc()
1503 if (Type == VT) in getBitcastedZExtOrTrunc()
1507 if (DestOp.getValueType() == VT) in getBitcastedZExtOrTrunc()
1510 return getZExtOrTrunc(DestOp, DL, VT); in getBitcastedZExtOrTrunc()
1513 SDValue SelectionDAG::getBoolExtOrTrunc(SDValue Op, const SDLoc &SL, EVT VT, in getBoolExtOrTrunc() argument
1515 if (VT.bitsLE(Op.getValueType())) in getBoolExtOrTrunc()
1516 return getNode(ISD::TRUNCATE, SL, VT, Op); in getBoolExtOrTrunc()
1519 return getNode(TLI->getExtendForContent(BType), SL, VT, Op); in getBoolExtOrTrunc()
1522 SDValue SelectionDAG::getZeroExtendInReg(SDValue Op, const SDLoc &DL, EVT VT) { in getZeroExtendInReg() argument
1524 assert(VT.isInteger() && OpVT.isInteger() && in getZeroExtendInReg()
1526 assert(VT.isVector() == OpVT.isVector() && in getZeroExtendInReg()
1529 assert((!VT.isVector() || in getZeroExtendInReg()
1530 VT.getVectorElementCount() == OpVT.getVectorElementCount()) && in getZeroExtendInReg()
1532 assert(VT.bitsLE(OpVT) && "Not extending!"); in getZeroExtendInReg()
1533 if (OpVT == VT) in getZeroExtendInReg()
1536 VT.getScalarSizeInBits()); in getZeroExtendInReg()
1540 SDValue SelectionDAG::getPtrExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT) { in getPtrExtOrTrunc() argument
1543 return getZExtOrTrunc(Op, DL, VT); in getPtrExtOrTrunc()
1546 SDValue SelectionDAG::getPtrExtendInReg(SDValue Op, const SDLoc &DL, EVT VT) { in getPtrExtendInReg() argument
1549 return getZeroExtendInReg(Op, DL, VT); in getPtrExtendInReg()
1552 SDValue SelectionDAG::getNegative(SDValue Val, const SDLoc &DL, EVT VT) { in getNegative() argument
1553 return getNode(ISD::SUB, DL, VT, getConstant(0, DL, VT), Val); in getNegative()
1557 SDValue SelectionDAG::getNOT(const SDLoc &DL, SDValue Val, EVT VT) { in getNOT() argument
1558 return getNode(ISD::XOR, DL, VT, Val, getAllOnesConstant(DL, VT)); in getNOT()
1561 SDValue SelectionDAG::getLogicalNOT(const SDLoc &DL, SDValue Val, EVT VT) { in getLogicalNOT() argument
1562 SDValue TrueValue = getBoolConstant(true, DL, VT, VT); in getLogicalNOT()
1563 return getNode(ISD::XOR, DL, VT, Val, TrueValue); in getLogicalNOT()
1567 SDValue Mask, SDValue EVL, EVT VT) { in getVPLogicalNOT() argument
1568 SDValue TrueValue = getBoolConstant(true, DL, VT, VT); in getVPLogicalNOT()
1569 return getNode(ISD::VP_XOR, DL, VT, Val, TrueValue, Mask, EVL); in getVPLogicalNOT()
1572 SDValue SelectionDAG::getVPPtrExtOrTrunc(const SDLoc &DL, EVT VT, SDValue Op, in getVPPtrExtOrTrunc() argument
1574 return getVPZExtOrTrunc(DL, VT, Op, Mask, EVL); in getVPPtrExtOrTrunc()
1577 SDValue SelectionDAG::getVPZExtOrTrunc(const SDLoc &DL, EVT VT, SDValue Op, in getVPZExtOrTrunc() argument
1579 if (VT.bitsGT(Op.getValueType())) in getVPZExtOrTrunc()
1580 return getNode(ISD::VP_ZERO_EXTEND, DL, VT, Op, Mask, EVL); in getVPZExtOrTrunc()
1581 if (VT.bitsLT(Op.getValueType())) in getVPZExtOrTrunc()
1582 return getNode(ISD::VP_TRUNCATE, DL, VT, Op, Mask, EVL); in getVPZExtOrTrunc()
1586 SDValue SelectionDAG::getBoolConstant(bool V, const SDLoc &DL, EVT VT, in getBoolConstant() argument
1589 return getConstant(0, DL, VT); in getBoolConstant()
1594 return getConstant(1, DL, VT); in getBoolConstant()
1596 return getAllOnesConstant(DL, VT); in getBoolConstant()
1601 SDValue SelectionDAG::getConstant(uint64_t Val, const SDLoc &DL, EVT VT, in getConstant() argument
1603 EVT EltVT = VT.getScalarType(); in getConstant()
1607 return getConstant(APInt(EltVT.getSizeInBits(), Val), DL, VT, isT, isO); in getConstant()
1610 SDValue SelectionDAG::getConstant(const APInt &Val, const SDLoc &DL, EVT VT, in getConstant() argument
1612 return getConstant(*ConstantInt::get(*Context, Val), DL, VT, isT, isO); in getConstant()
1616 EVT VT, bool isT, bool isO) { in getConstant() argument
1617 assert(VT.isInteger() && "Cannot create FP integer constant!"); in getConstant()
1619 EVT EltVT = VT.getScalarType(); in getConstant()
1626 if (VT.isVector() && TLI->getTypeAction(*getContext(), EltVT) == in getConstant()
1630 if (TLI->isSExtCheaperThanZExt(VT.getScalarType(), EltVT)) in getConstant()
1642 else if (NewNodesMustHaveLegalTypes && VT.isVector() && in getConstant()
1650 if (VT.isScalableVector() || in getConstant()
1651 TLI->isOperationLegal(ISD::SPLAT_VECTOR, VT)) { in getConstant()
1662 return getNode(ISD::SPLAT_VECTOR_PARTS, DL, VT, ScalarParts); in getConstant()
1665 unsigned ViaVecNumElts = VT.getSizeInBits() / ViaEltSizeInBits; in getConstant()
1671 assert(ViaVecVT.getSizeInBits() == VT.getSizeInBits()); in getConstant()
1674 for (unsigned i = 0; i < ViaVecNumElts / VT.getVectorNumElements(); ++i) in getConstant()
1692 for (unsigned i = 0, e = VT.getVectorNumElements(); i != e; ++i) in getConstant()
1696 getNode(ISD::BITCAST, DL, VT, getBuildVector(ViaVecVT, DL, Ops)); in getConstant()
1710 if (!VT.isVector()) in getConstant()
1721 if (VT.isVector()) in getConstant()
1722 Result = getSplat(VT, DL, Result); in getConstant()
1731 SDValue SelectionDAG::getShiftAmountConstant(uint64_t Val, EVT VT, in getShiftAmountConstant() argument
1733 assert(VT.isInteger() && "Shift amount is not an integer type!"); in getShiftAmountConstant()
1734 EVT ShiftVT = TLI->getShiftAmountTy(VT, getDataLayout(), LegalTypes); in getShiftAmountConstant()
1743 SDValue SelectionDAG::getConstantFP(const APFloat &V, const SDLoc &DL, EVT VT, in getConstantFP() argument
1745 return getConstantFP(*ConstantFP::get(*getContext(), V), DL, VT, isTarget); in getConstantFP()
1749 EVT VT, bool isTarget) { in getConstantFP() argument
1750 assert(VT.isFloatingPoint() && "Cannot create integer FP constant!"); in getConstantFP()
1752 EVT EltVT = VT.getScalarType(); in getConstantFP()
1764 if (!VT.isVector()) in getConstantFP()
1774 if (VT.isVector()) in getConstantFP()
1775 Result = getSplat(VT, DL, Result); in getConstantFP()
1780 SDValue SelectionDAG::getConstantFP(double Val, const SDLoc &DL, EVT VT, in getConstantFP() argument
1782 EVT EltVT = VT.getScalarType(); in getConstantFP()
1784 return getConstantFP(APFloat((float)Val), DL, VT, isTarget); in getConstantFP()
1786 return getConstantFP(APFloat(Val), DL, VT, isTarget); in getConstantFP()
1793 return getConstantFP(APF, DL, VT, isTarget); in getConstantFP()
1799 EVT VT, int64_t Offset, bool isTargetGA, in getGlobalAddress() argument
1816 AddNodeIDNode(ID, Opc, getVTList(VT), std::nullopt); in getGlobalAddress()
1825 Opc, DL.getIROrder(), DL.getDebugLoc(), GV, VT, Offset, TargetFlags); in getGlobalAddress()
1831 SDValue SelectionDAG::getFrameIndex(int FI, EVT VT, bool isTarget) { in getFrameIndex() argument
1834 AddNodeIDNode(ID, Opc, getVTList(VT), std::nullopt); in getFrameIndex()
1840 auto *N = newSDNode<FrameIndexSDNode>(FI, VT, isTarget); in getFrameIndex()
1846 SDValue SelectionDAG::getJumpTable(int JTI, EVT VT, bool isTarget, in getJumpTable() argument
1852 AddNodeIDNode(ID, Opc, getVTList(VT), std::nullopt); in getJumpTable()
1859 auto *N = newSDNode<JumpTableSDNode>(JTI, VT, isTarget, TargetFlags); in getJumpTable()
1872 SDValue SelectionDAG::getConstantPool(const Constant *C, EVT VT, in getConstantPool() argument
1883 AddNodeIDNode(ID, Opc, getVTList(VT), std::nullopt); in getConstantPool()
1892 auto *N = newSDNode<ConstantPoolSDNode>(isTarget, C, VT, Offset, *Alignment, in getConstantPool()
1901 SDValue SelectionDAG::getConstantPool(MachineConstantPoolValue *C, EVT VT, in getConstantPool() argument
1910 AddNodeIDNode(ID, Opc, getVTList(VT), std::nullopt); in getConstantPool()
1919 auto *N = newSDNode<ConstantPoolSDNode>(isTarget, C, VT, Offset, *Alignment, in getConstantPool()
1940 SDValue SelectionDAG::getValueType(EVT VT) { in getValueType() argument
1941 if (VT.isSimple() && (unsigned)VT.getSimpleVT().SimpleTy >= in getValueType()
1943 ValueTypeNodes.resize(VT.getSimpleVT().SimpleTy+1); in getValueType()
1945 SDNode *&N = VT.isExtended() ? in getValueType()
1946 ExtendedValueTypeNodes[VT] : ValueTypeNodes[VT.getSimpleVT().SimpleTy]; in getValueType()
1949 N = newSDNode<VTSDNode>(VT); in getValueType()
1954 SDValue SelectionDAG::getExternalSymbol(const char *Sym, EVT VT) { in getExternalSymbol() argument
1957 N = newSDNode<ExternalSymbolSDNode>(false, Sym, 0, VT); in getExternalSymbol()
1962 SDValue SelectionDAG::getMCSymbol(MCSymbol *Sym, EVT VT) { in getMCSymbol() argument
1966 N = newSDNode<MCSymbolSDNode>(Sym, VT); in getMCSymbol()
1971 SDValue SelectionDAG::getTargetExternalSymbol(const char *Sym, EVT VT, in getTargetExternalSymbol() argument
1976 N = newSDNode<ExternalSymbolSDNode>(true, Sym, TargetFlags, VT); in getTargetExternalSymbol()
1994 SDValue SelectionDAG::getVScale(const SDLoc &DL, EVT VT, APInt MulImm, in getVScale() argument
1996 assert(MulImm.getBitWidth() == VT.getSizeInBits() && in getVScale()
2000 return getConstant(0, DL, VT); in getVScale()
2007 return getConstant(MulImm * C->getZExtValue(), DL, VT); in getVScale()
2010 return getNode(ISD::VSCALE, DL, VT, getConstant(MulImm, DL, VT)); in getVScale()
2013 SDValue SelectionDAG::getElementCount(const SDLoc &DL, EVT VT, ElementCount EC, in getElementCount() argument
2016 return getVScale(DL, VT, in getElementCount()
2017 APInt(VT.getSizeInBits(), EC.getKnownMinValue())); in getElementCount()
2019 return getConstant(EC.getKnownMinValue(), DL, VT); in getElementCount()
2048 SDValue SelectionDAG::getVectorShuffle(EVT VT, const SDLoc &dl, SDValue N1, in getVectorShuffle() argument
2050 assert(VT.getVectorNumElements() == Mask.size() && in getVectorShuffle()
2052 assert(VT == N1.getValueType() && VT == N2.getValueType() && in getVectorShuffle()
2057 return getUNDEF(VT); in getVectorShuffle()
2071 N2 = getUNDEF(VT); in getVectorShuffle()
2125 return getUNDEF(VT); in getVectorShuffle()
2127 N2 = getUNDEF(VT); in getVectorShuffle()
2129 N1 = getUNDEF(VT); in getVectorShuffle()
2136 return getUNDEF(VT); in getVectorShuffle()
2162 return getUNDEF(VT); in getVectorShuffle()
2165 V.getValueType().getVectorNumElements() == VT.getVectorNumElements(); in getVectorShuffle()
2184 if (BuildVT != VT) in getVectorShuffle()
2185 NewBV = getNode(ISD::BITCAST, dl, VT, NewBV); in getVectorShuffle()
2193 AddNodeIDNode(ID, ISD::VECTOR_SHUFFLE, getVTList(VT), Ops); in getVectorShuffle()
2207 auto *N = newSDNode<ShuffleVectorSDNode>(VT, dl.getIROrder(), in getVectorShuffle()
2219 EVT VT = SV.getValueType(0); in getCommutedVectorShuffle() local
2225 return getVectorShuffle(VT, SDLoc(&SV), Op1, Op0, MaskVec); in getCommutedVectorShuffle()
2228 SDValue SelectionDAG::getRegister(unsigned RegNo, EVT VT) { in getRegister() argument
2230 AddNodeIDNode(ID, ISD::Register, getVTList(VT), std::nullopt); in getRegister()
2236 auto *N = newSDNode<RegisterSDNode>(RegNo, VT); in getRegister()
2281 SDValue SelectionDAG::getBlockAddress(const BlockAddress *BA, EVT VT, in getBlockAddress() argument
2287 AddNodeIDNode(ID, Opc, getVTList(VT), std::nullopt); in getBlockAddress()
2295 auto *N = newSDNode<BlockAddressSDNode>(Opc, VT, BA, Offset, TargetFlags); in getBlockAddress()
2331 SDValue SelectionDAG::getBitcast(EVT VT, SDValue V) { in getBitcast() argument
2332 if (VT == V.getValueType()) in getBitcast()
2335 return getNode(ISD::BITCAST, SDLoc(V), VT, V); in getBitcast()
2338 SDValue SelectionDAG::getAddrSpaceCast(const SDLoc &dl, EVT VT, SDValue Ptr, in getAddrSpaceCast() argument
2342 AddNodeIDNode(ID, ISD::ADDRSPACECAST, getVTList(VT), Ops); in getAddrSpaceCast()
2351 VT, SrcAS, DestAS); in getAddrSpaceCast()
2377 EVT VT = Node->getValueType(0); in expandVAArg() local
2398 VT.getTypeForEVT(*getContext())), in expandVAArg()
2404 return getLoad(VT, dl, Tmp1, VAList, MachinePointerInfo()); in expandVAArg()
2421 Align SelectionDAG::getReducedAlign(EVT VT, bool UseABI) { in getReducedAlign() argument
2423 Type *Ty = VT.getTypeForEVT(*getContext()); in getReducedAlign()
2426 if (TLI->isTypeLegal(VT) || !VT.isVector()) in getReducedAlign()
2438 TLI->getVectorTypeBreakdown(*getContext(), VT, IntermediateVT, in getReducedAlign()
2462 SDValue SelectionDAG::CreateStackTemporary(EVT VT, unsigned minAlign) { in CreateStackTemporary() argument
2463 Type *Ty = VT.getTypeForEVT(*getContext()); in CreateStackTemporary()
2466 return CreateStackTemporary(VT.getStoreSize(), StackAlign); in CreateStackTemporary()
2486 SDValue SelectionDAG::FoldSetCC(EVT VT, SDValue N1, SDValue N2, in FoldSetCC() argument
2491 if (VT.getScalarType() == MVT::i1 || in FoldSetCC()
2494 return getUNDEF(VT); in FoldSetCC()
2497 return getConstant(0, dl, VT); in FoldSetCC()
2504 case ISD::SETFALSE2: return getBoolConstant(false, dl, VT, OpVT); in FoldSetCC()
2506 case ISD::SETTRUE2: return getBoolConstant(true, dl, VT, OpVT); in FoldSetCC()
2539 return getBoolConstant(ISD::isTrueWhenEqual(Cond), dl, VT, OpVT); in FoldSetCC()
2548 dl, VT, OpVT); in FoldSetCC()
2562 case ISD::SETOEQ: return getBoolConstant(R==APFloat::cmpEqual, dl, VT, in FoldSetCC()
2568 R==APFloat::cmpLessThan, dl, VT, in FoldSetCC()
2573 case ISD::SETOLT: return getBoolConstant(R==APFloat::cmpLessThan, dl, VT, in FoldSetCC()
2579 VT, OpVT); in FoldSetCC()
2584 R==APFloat::cmpEqual, dl, VT, in FoldSetCC()
2590 R==APFloat::cmpEqual, dl, VT, OpVT); in FoldSetCC()
2591 case ISD::SETO: return getBoolConstant(R!=APFloat::cmpUnordered, dl, VT, in FoldSetCC()
2593 case ISD::SETUO: return getBoolConstant(R==APFloat::cmpUnordered, dl, VT, in FoldSetCC()
2596 R==APFloat::cmpEqual, dl, VT, in FoldSetCC()
2598 case ISD::SETUNE: return getBoolConstant(R!=APFloat::cmpEqual, dl, VT, in FoldSetCC()
2601 R==APFloat::cmpLessThan, dl, VT, in FoldSetCC()
2604 R==APFloat::cmpUnordered, dl, VT, in FoldSetCC()
2607 VT, OpVT); in FoldSetCC()
2608 case ISD::SETUGE: return getBoolConstant(R!=APFloat::cmpLessThan, dl, VT, in FoldSetCC()
2616 return getSetCC(dl, VT, N2, N1, SwappedCond); in FoldSetCC()
2628 return getBoolConstant(false, dl, VT, OpVT); in FoldSetCC()
2630 return getBoolConstant(true, dl, VT, OpVT); in FoldSetCC()
2680 EVT VT = Op.getValueType(); in computeVectorKnownZeroElements() local
2681 assert(VT.isVector() && !VT.isScalableVector() && "Only for fixed vectors!"); in computeVectorKnownZeroElements()
2683 unsigned NumElts = VT.getVectorNumElements(); in computeVectorKnownZeroElements()
2705 EVT VT = V.getValueType(); in isSplatValue() local
2706 assert(VT.isVector() && "Vector type expected"); in isSplatValue()
2707 assert((!VT.isScalableVector() || DemandedElts.getBitWidth() == 1) && in isSplatValue()
2754 if (VT.isScalableVector()) in isSplatValue()
2757 unsigned NumElts = VT.getVectorNumElements(); in isSplatValue()
2853 unsigned BitWidth = VT.getScalarSizeInBits(); in isSplatValue()
2857 if (!SrcVT.isVector() || !SrcVT.isInteger() || !VT.isInteger()) in isSplatValue()
2889 EVT VT = V.getValueType(); in isSplatValue() local
2890 assert(VT.isVector() && "Vector type expected"); in isSplatValue()
2897 = APInt::getAllOnes(VT.isScalableVector() ? 1 : VT.getVectorNumElements()); in isSplatValue()
2905 EVT VT = V.getValueType(); in getSplatSourceVector() local
2914 = APInt::getAllOnes(VT.isScalableVector() ? 1 : VT.getVectorNumElements()); in getSplatSourceVector()
2917 if (VT.isScalableVector()) { in getSplatSourceVector()
2925 return getUNDEF(VT); in getSplatSourceVector()
2937 assert(!VT.isScalableVector()); in getSplatSourceVector()
3050 EVT VT = Op.getValueType(); in computeKnownBits() local
3055 APInt DemandedElts = VT.isFixedLengthVector() in computeKnownBits()
3056 ? APInt::getAllOnes(VT.getVectorNumElements()) in computeKnownBits()
3618 EVT VT = LD->getMemoryVT(); in computeKnownBits() local
3619 unsigned MemBits = VT.getScalarSizeInBits(); in computeKnownBits()
3622 EVT VT = LD->getValueType(0); in computeKnownBits() local
3626 if (VT.isVector()) { in computeKnownBits()
3697 EVT VT = cast<VTSDNode>(Op.getOperand(1))->getVT(); in computeKnownBits() local
3698 APInt InMask = APInt::getLowBitsSet(BitWidth, VT.getSizeInBits()); in computeKnownBits()
3977 EVT VT = cast<VTSDNode>(Op.getOperand(1))->getVT(); in computeKnownBits() local
3978 Known.Zero |= APInt::getBitsSetFrom(BitWidth, VT.getScalarSizeInBits()); in computeKnownBits()
4261 EVT VT = Op.getValueType(); in ComputeNumSignBits() local
4266 APInt DemandedElts = VT.isFixedLengthVector() in ComputeNumSignBits()
4267 ? APInt::getAllOnes(VT.getVectorNumElements()) in ComputeNumSignBits()
4274 EVT VT = Op.getValueType(); in ComputeNumSignBits() local
4275 assert((VT.isInteger() || VT.isFloatingPoint()) && "Invalid VT!"); in ComputeNumSignBits()
4276 unsigned VTBits = VT.getScalarSizeInBits(); in ComputeNumSignBits()
4313 assert(!VT.isScalableVector()); in ComputeNumSignBits()
4364 if (VT.isScalableVector()) in ComputeNumSignBits()
4382 assert(VT.isVector() && "Expected bitcast to vector"); in ComputeNumSignBits()
4423 if (VT.isScalableVector()) in ComputeNumSignBits()
4523 if (TLI->getBooleanContents(VT.isVector(), false) == in ComputeNumSignBits()
4642 if (VT.isScalableVector()) in ComputeNumSignBits()
4657 if (VT.isScalableVector()) in ComputeNumSignBits()
4689 assert(!VT.isScalableVector()); in ComputeNumSignBits()
4728 if (VT.isScalableVector()) in ComputeNumSignBits()
4748 if (VT.isScalableVector()) in ComputeNumSignBits()
4848 if (CstTy->isVectorTy() && !VT.isScalableVector() && in ComputeNumSignBits()
4885 if (!VT.isScalableVector()) { in ComputeNumSignBits()
4919 EVT VT = Op.getValueType(); in isGuaranteedNotToBeUndefOrPoison() local
4920 if (VT.isScalableVector()) in isGuaranteedNotToBeUndefOrPoison()
4923 APInt DemandedElts = VT.isVector() in isGuaranteedNotToBeUndefOrPoison()
4924 ? APInt::getAllOnes(VT.getVectorNumElements()) in isGuaranteedNotToBeUndefOrPoison()
4994 EVT VT = Op.getValueType(); in canCreateUndefOrPoison() local
4995 if (VT.isScalableVector()) in canCreateUndefOrPoison()
4998 APInt DemandedElts = VT.isVector() in canCreateUndefOrPoison()
4999 ? APInt::getAllOnes(VT.getVectorNumElements()) in canCreateUndefOrPoison()
5009 EVT VT = Op.getValueType(); in canCreateUndefOrPoison() local
5010 if (VT.isScalableVector()) in canCreateUndefOrPoison()
5427 static SDValue FoldSTEP_VECTOR(const SDLoc &DL, EVT VT, SDValue Step, in FoldSTEP_VECTOR() argument
5430 return DAG.getConstant(0, DL, VT); in FoldSTEP_VECTOR()
5435 static SDValue FoldBUILD_VECTOR(const SDLoc &DL, EVT VT, in FoldBUILD_VECTOR() argument
5440 assert(!VT.isScalableVector() && in FoldBUILD_VECTOR()
5442 assert(VT.getVectorNumElements() == (unsigned)NumOps && in FoldBUILD_VECTOR()
5447 return DAG.getUNDEF(VT); in FoldBUILD_VECTOR()
5454 Ops[i].getOperand(0).getValueType() != VT || in FoldBUILD_VECTOR()
5471 static SDValue foldCONCAT_VECTORS(const SDLoc &DL, EVT VT, in foldCONCAT_VECTORS() argument
5481 VT.getVectorElementCount() && in foldCONCAT_VECTORS()
5489 return DAG.getUNDEF(VT); in foldCONCAT_VECTORS()
5500 Op.getOperand(0).getValueType() != VT || in foldCONCAT_VECTORS()
5517 if (VT.isScalableVector()) in foldCONCAT_VECTORS()
5523 EVT SVT = VT.getScalarType(); in foldCONCAT_VECTORS()
5540 if (SVT.bitsGT(VT.getScalarType())) { in foldCONCAT_VECTORS()
5551 SDValue V = DAG.getBuildVector(VT, DL, Elts); in foldCONCAT_VECTORS()
5557 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT) { in getNode() argument
5559 AddNodeIDNode(ID, Opcode, getVTList(VT), std::nullopt); in getNode()
5565 getVTList(VT)); in getNode()
5574 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, in getNode() argument
5579 return getNode(Opcode, DL, VT, N1, Flags); in getNode()
5582 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, in getNode() argument
5621 if (SDValue Fold = FoldConstantArithmetic(Opcode, DL, VT, Ops)) in getNode()
5629 assert(VT.isScalableVector() && in getNode()
5632 VT.getVectorElementType() == N1.getValueType() && in getNode()
5636 assert(VT == N1.getValueType() && "Unexpected VT!"); in getNode()
5648 if (SDValue V = FoldBUILD_VECTOR(DL, VT, Ops, *this)) in getNode()
5654 assert(VT.isFloatingPoint() && N1.getValueType().isFloatingPoint() && in getNode()
5656 if (N1.getValueType() == VT) return N1; // noop conversion. in getNode()
5657 assert((!VT.isVector() || VT.getVectorElementCount() == in getNode()
5660 assert(N1.getValueType().bitsLT(VT) && "Invalid fpext node, dst < src!"); in getNode()
5662 return getUNDEF(VT); in getNode()
5667 return getUNDEF(VT); in getNode()
5673 return getConstantFP(0.0, DL, VT); in getNode()
5676 assert(VT.isInteger() && N1.getValueType().isInteger() && in getNode()
5678 assert(VT.isVector() == N1.getValueType().isVector() && in getNode()
5681 if (N1.getValueType() == VT) return N1; // noop extension in getNode()
5682 assert((!VT.isVector() || VT.getVectorElementCount() == in getNode()
5685 assert(N1.getValueType().bitsLT(VT) && "Invalid sext node, dst < src!"); in getNode()
5687 return getNode(OpOpcode, DL, VT, N1.getOperand(0)); in getNode()
5690 return getConstant(0, DL, VT); in getNode()
5693 assert(VT.isInteger() && N1.getValueType().isInteger() && in getNode()
5695 assert(VT.isVector() == N1.getValueType().isVector() && in getNode()
5698 if (N1.getValueType() == VT) return N1; // noop extension in getNode()
5699 assert((!VT.isVector() || VT.getVectorElementCount() == in getNode()
5702 assert(N1.getValueType().bitsLT(VT) && "Invalid zext node, dst < src!"); in getNode()
5704 return getNode(ISD::ZERO_EXTEND, DL, VT, N1.getOperand(0)); in getNode()
5707 return getConstant(0, DL, VT); in getNode()
5715 if (OpOp.getValueType() == VT) { in getNode()
5717 APInt HiBits = APInt::getBitsSetFrom(VT.getScalarSizeInBits(), in getNode()
5728 assert(VT.isInteger() && N1.getValueType().isInteger() && in getNode()
5730 assert(VT.isVector() == N1.getValueType().isVector() && in getNode()
5733 if (N1.getValueType() == VT) return N1; // noop extension in getNode()
5734 assert((!VT.isVector() || VT.getVectorElementCount() == in getNode()
5737 assert(N1.getValueType().bitsLT(VT) && "Invalid anyext node, dst < src!"); in getNode()
5742 return getNode(OpOpcode, DL, VT, N1.getOperand(0)); in getNode()
5744 return getUNDEF(VT); in getNode()
5749 if (OpOp.getValueType() == VT) { in getNode()
5756 assert(VT.isInteger() && N1.getValueType().isInteger() && in getNode()
5758 assert(VT.isVector() == N1.getValueType().isVector() && in getNode()
5761 if (N1.getValueType() == VT) return N1; // noop truncate in getNode()
5762 assert((!VT.isVector() || VT.getVectorElementCount() == in getNode()
5765 assert(N1.getValueType().bitsGT(VT) && "Invalid truncate node, src < dst!"); in getNode()
5767 return getNode(ISD::TRUNCATE, DL, VT, N1.getOperand(0)); in getNode()
5772 VT.getScalarType())) in getNode()
5773 return getNode(OpOpcode, DL, VT, N1.getOperand(0)); in getNode()
5774 if (N1.getOperand(0).getValueType().bitsGT(VT)) in getNode()
5775 return getNode(ISD::TRUNCATE, DL, VT, N1.getOperand(0)); in getNode()
5779 return getUNDEF(VT); in getNode()
5781 return getVScale(DL, VT, in getNode()
5782 N1.getConstantOperandAPInt(0).trunc(VT.getSizeInBits())); in getNode()
5787 assert(VT.isVector() && "This DAG node is restricted to vector types."); in getNode()
5788 assert(N1.getValueType().bitsLE(VT) && in getNode()
5790 assert(VT.getVectorMinNumElements() < in getNode()
5795 assert(VT.isInteger() && VT == N1.getValueType() && "Invalid ABS!"); in getNode()
5797 return getConstant(0, DL, VT); in getNode()
5800 assert(VT.isInteger() && VT == N1.getValueType() && "Invalid BSWAP!"); in getNode()
5801 assert((VT.getScalarSizeInBits() % 16 == 0) && in getNode()
5804 return getUNDEF(VT); in getNode()
5810 assert(VT.isInteger() && VT == N1.getValueType() && "Invalid BITREVERSE!"); in getNode()
5812 return getUNDEF(VT); in getNode()
5815 assert(VT.getSizeInBits() == N1.getValueSizeInBits() && in getNode()
5817 if (VT == N1.getValueType()) return N1; // noop conversion. in getNode()
5819 return getNode(ISD::BITCAST, DL, VT, N1.getOperand(0)); in getNode()
5821 return getUNDEF(VT); in getNode()
5824 assert(VT.isVector() && !N1.getValueType().isVector() && in getNode()
5825 (VT.getVectorElementType() == N1.getValueType() || in getNode()
5826 (VT.getVectorElementType().isInteger() && in getNode()
5828 VT.getVectorElementType().bitsLE(N1.getValueType()))) && in getNode()
5831 return getUNDEF(VT); in getNode()
5836 N1.getOperand(0).getValueType() == VT) in getNode()
5842 return getUNDEF(VT); in getNode()
5849 return getNode(ISD::FABS, DL, VT, N1.getOperand(0)); in getNode()
5852 assert(VT == N1.getValueType() && "Unexpected VT!"); in getNode()
5865 return getNode(ISD::VECREDUCE_XOR, DL, VT, N1); in getNode()
5870 return getNode(ISD::VECREDUCE_OR, DL, VT, N1); in getNode()
5875 return getNode(ISD::VECREDUCE_AND, DL, VT, N1); in getNode()
5880 SDVTList VTs = getVTList(VT); in getNode()
5882 if (VT != MVT::Glue) { // Don't CSE glue producing nodes in getNode()
6006 SDValue SelectionDAG::FoldSymbolOffset(unsigned Opcode, EVT VT, in FoldSymbolOffset() argument
6022 return getGlobalAddress(GA->getGlobal(), SDLoc(C2), VT, in FoldSymbolOffset()
6052 EVT VT, ArrayRef<SDValue> Ops) { in FoldConstantArithmetic() argument
6067 return getUNDEF(VT); in FoldConstantArithmetic()
6082 return getConstant(Val.sextOrTrunc(VT.getSizeInBits()), DL, VT, in FoldConstantArithmetic()
6089 return getConstant(Val.zextOrTrunc(VT.getSizeInBits()), DL, VT, in FoldConstantArithmetic()
6093 if (TLI->isSExtCheaperThanZExt(N1.getValueType(), VT)) in FoldConstantArithmetic()
6094 return getConstant(Val.sextOrTrunc(VT.getSizeInBits()), DL, VT, in FoldConstantArithmetic()
6096 return getConstant(Val.zextOrTrunc(VT.getSizeInBits()), DL, VT, in FoldConstantArithmetic()
6099 return getConstant(Val.abs(), DL, VT, C->isTargetOpcode(), in FoldConstantArithmetic()
6102 return getConstant(Val.reverseBits(), DL, VT, C->isTargetOpcode(), in FoldConstantArithmetic()
6105 return getConstant(Val.byteSwap(), DL, VT, C->isTargetOpcode(), in FoldConstantArithmetic()
6108 return getConstant(Val.popcount(), DL, VT, C->isTargetOpcode(), in FoldConstantArithmetic()
6112 return getConstant(Val.countl_zero(), DL, VT, C->isTargetOpcode(), in FoldConstantArithmetic()
6116 return getConstant(Val.countr_zero(), DL, VT, C->isTargetOpcode(), in FoldConstantArithmetic()
6120 APFloat apf(EVTToAPFloatSemantics(VT), in FoldConstantArithmetic()
6121 APInt::getZero(VT.getSizeInBits())); in FoldConstantArithmetic()
6124 return getConstantFP(apf, DL, VT); in FoldConstantArithmetic()
6135 (void)FPV.convert(EVTToAPFloatSemantics(VT), in FoldConstantArithmetic()
6137 return getConstantFP(FPV, DL, VT); in FoldConstantArithmetic()
6140 if (SDValue V = FoldSTEP_VECTOR(DL, VT, N1, *this)) in FoldConstantArithmetic()
6144 if (VT == MVT::f16 && C->getValueType(0) == MVT::i16) in FoldConstantArithmetic()
6145 return getConstantFP(APFloat(APFloat::IEEEhalf(), Val), DL, VT); in FoldConstantArithmetic()
6146 if (VT == MVT::f32 && C->getValueType(0) == MVT::i32) in FoldConstantArithmetic()
6147 return getConstantFP(APFloat(APFloat::IEEEsingle(), Val), DL, VT); in FoldConstantArithmetic()
6148 if (VT == MVT::f64 && C->getValueType(0) == MVT::i64) in FoldConstantArithmetic()
6149 return getConstantFP(APFloat(APFloat::IEEEdouble(), Val), DL, VT); in FoldConstantArithmetic()
6150 if (VT == MVT::f128 && C->getValueType(0) == MVT::i128) in FoldConstantArithmetic()
6151 return getConstantFP(APFloat(APFloat::IEEEquad(), Val), DL, VT); in FoldConstantArithmetic()
6162 return getConstantFP(V, DL, VT); in FoldConstantArithmetic()
6165 return getConstantFP(V, DL, VT); in FoldConstantArithmetic()
6169 return getConstantFP(V, DL, VT); in FoldConstantArithmetic()
6175 return getConstantFP(V, DL, VT); in FoldConstantArithmetic()
6181 return getConstantFP(V, DL, VT); in FoldConstantArithmetic()
6188 (void)V.convert(EVTToAPFloatSemantics(VT), APFloat::rmNearestTiesToEven, in FoldConstantArithmetic()
6190 return getConstantFP(V, DL, VT); in FoldConstantArithmetic()
6195 APSInt IntVal(VT.getSizeInBits(), Opcode == ISD::FP_TO_UINT); in FoldConstantArithmetic()
6201 return getConstant(IntVal, DL, VT); in FoldConstantArithmetic()
6211 return getConstant(V.bitcastToAPInt().getZExtValue(), DL, VT); in FoldConstantArithmetic()
6214 if (VT == MVT::i16 && C->getValueType(0) == MVT::f16) in FoldConstantArithmetic()
6216 VT); in FoldConstantArithmetic()
6217 if (VT == MVT::i16 && C->getValueType(0) == MVT::bf16) in FoldConstantArithmetic()
6219 VT); in FoldConstantArithmetic()
6220 if (VT == MVT::i32 && C->getValueType(0) == MVT::f32) in FoldConstantArithmetic()
6222 VT); in FoldConstantArithmetic()
6223 if (VT == MVT::i64 && C->getValueType(0) == MVT::f64) in FoldConstantArithmetic()
6224 return getConstant(V.bitcastToAPInt().getZExtValue(), DL, VT); in FoldConstantArithmetic()
6236 if (SDValue CFP = foldConstantFPMath(Opcode, DL, VT, Ops)) in FoldConstantArithmetic()
6249 SDValue Folded = getConstant(*FoldAttempt, DL, VT); in FoldConstantArithmetic()
6250 assert((!Folded || !VT.isVector()) && in FoldConstantArithmetic()
6258 return FoldSymbolOffset(Opcode, VT, GA, Ops[1].getNode()); in FoldConstantArithmetic()
6261 return FoldSymbolOffset(Opcode, VT, GA, Ops[0].getNode()); in FoldConstantArithmetic()
6265 if (!VT.isVector()) in FoldConstantArithmetic()
6268 ElementCount NumElts = VT.getVectorElementCount(); in FoldConstantArithmetic()
6271 if (NumOps == 2 && VT.isFixedLengthVector() && VT.isInteger() && in FoldConstantArithmetic()
6272 Ops[0].getValueType() == VT && Ops[1].getValueType() == VT && in FoldConstantArithmetic()
6282 unsigned EltBits = VT.getScalarSizeInBits(); in FoldConstantArithmetic()
6311 return getBitcast(VT, getBuildVector(BVVT, DL, Ops)); in FoldConstantArithmetic()
6326 return getStepVector(DL, VT, NewStep); in FoldConstantArithmetic()
6351 EVT SVT = (Opcode == ISD::SETCC ? MVT::i1 : VT.getScalarType()); in FoldConstantArithmetic()
6353 (Opcode == ISD::SETCC && SVT != VT.getScalarType()) in FoldConstantArithmetic()
6354 ? TargetLowering::getExtendForContent(TLI->getBooleanContents(VT)) in FoldConstantArithmetic()
6359 EVT LegalSVT = VT.getScalarType(); in FoldConstantArithmetic()
6362 if (LegalSVT.bitsLT(VT.getScalarType())) in FoldConstantArithmetic()
6422 SDValue V = NumElts.isScalable() ? getSplatVector(VT, DL, ScalarResults[0]) in FoldConstantArithmetic()
6423 : getBuildVector(VT, DL, ScalarResults); in FoldConstantArithmetic()
6429 EVT VT, ArrayRef<SDValue> Ops) { in foldConstantFPMath() argument
6448 return getConstantFP(C1, DL, VT); in foldConstantFPMath()
6451 return getConstantFP(C1, DL, VT); in foldConstantFPMath()
6454 return getConstantFP(C1, DL, VT); in foldConstantFPMath()
6457 return getConstantFP(C1, DL, VT); in foldConstantFPMath()
6460 return getConstantFP(C1, DL, VT); in foldConstantFPMath()
6463 return getConstantFP(C1, DL, VT); in foldConstantFPMath()
6465 return getConstantFP(minnum(C1, C2), DL, VT); in foldConstantFPMath()
6467 return getConstantFP(maxnum(C1, C2), DL, VT); in foldConstantFPMath()
6469 return getConstantFP(minimum(C1, C2), DL, VT); in foldConstantFPMath()
6471 return getConstantFP(maximum(C1, C2), DL, VT); in foldConstantFPMath()
6480 (void) C1.convert(EVTToAPFloatSemantics(VT), APFloat::rmNearestTiesToEven, in foldConstantFPMath()
6482 return getConstantFP(C1, DL, VT); in foldConstantFPMath()
6490 return getUNDEF(VT); in foldConstantFPMath()
6500 return getUNDEF(VT); in foldConstantFPMath()
6502 return getConstantFP(APFloat::getNaN(EVTToAPFloatSemantics(VT)), DL, VT); in foldConstantFPMath()
6535 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, in getNode() argument
6540 return getNode(Opcode, DL, VT, N1, N2, Flags); in getNode()
6564 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, in getNode() argument
6583 assert(VT == MVT::Other && N1.getValueType() == MVT::Other && in getNode()
6593 if (SDValue V = FoldBUILD_VECTOR(DL, VT, Ops, *this)) in getNode()
6599 if (SDValue V = foldCONCAT_VECTORS(DL, VT, Ops, *this)) in getNode()
6604 assert(VT.isInteger() && "This operator does not apply to FP types!"); in getNode()
6606 N1.getValueType() == VT && "Binary operator types must match!"); in getNode()
6618 assert(VT.isInteger() && "This operator does not apply to FP types!"); in getNode()
6620 N1.getValueType() == VT && "Binary operator types must match!"); in getNode()
6625 if ((Opcode == ISD::ADD || Opcode == ISD::SUB) && VT.isVector() && in getNode()
6626 VT.getVectorElementType() == MVT::i1) in getNode()
6627 return getNode(ISD::XOR, DL, VT, N1, N2); in getNode()
6630 assert(VT.isInteger() && "This operator does not apply to FP types!"); in getNode()
6632 N1.getValueType() == VT && "Binary operator types must match!"); in getNode()
6633 if (VT.isVector() && VT.getVectorElementType() == MVT::i1) in getNode()
6634 return getNode(ISD::AND, DL, VT, N1, N2); in getNode()
6638 return getVScale(DL, VT, MulImm * N2CImm); in getNode()
6651 assert(VT.isInteger() && "This operator does not apply to FP types!"); in getNode()
6653 N1.getValueType() == VT && "Binary operator types must match!"); in getNode()
6654 if (VT.isVector() && VT.getVectorElementType() == MVT::i1) { in getNode()
6657 return getNode(ISD::OR, DL, VT, N1, N2); in getNode()
6660 return getNode(ISD::AND, DL, VT, N1, getNOT(DL, N2, VT)); in getNode()
6665 assert(VT.isInteger() && "This operator does not apply to FP types!"); in getNode()
6667 N1.getValueType() == VT && "Binary operator types must match!"); in getNode()
6671 assert(VT.isInteger() && "This operator does not apply to FP types!"); in getNode()
6673 N1.getValueType() == VT && "Binary operator types must match!"); in getNode()
6674 if (VT.isVector() && VT.getVectorElementType() == MVT::i1) in getNode()
6675 return getNode(ISD::OR, DL, VT, N1, N2); in getNode()
6679 assert(VT.isInteger() && "This operator does not apply to FP types!"); in getNode()
6681 N1.getValueType() == VT && "Binary operator types must match!"); in getNode()
6682 if (VT.isVector() && VT.getVectorElementType() == MVT::i1) in getNode()
6683 return getNode(ISD::AND, DL, VT, N1, N2); in getNode()
6690 assert(VT.isFloatingPoint() && "This operator only applies to FP types!"); in getNode()
6692 N1.getValueType() == VT && "Binary operator types must match!"); in getNode()
6697 assert(N1.getValueType() == VT && in getNode()
6706 return getVScale(DL, VT, MulImm << ShiftImm); in getNode()
6716 assert(VT == N1.getValueType() && in getNode()
6718 assert(VT.isInteger() && N2.getValueType().isInteger() && in getNode()
6720 assert((!VT.isVector() || VT == N2.getValueType()) && in getNode()
6727 Log2_32_Ceil(VT.getScalarSizeInBits()) && in getNode()
6733 if (VT == MVT::i1) in getNode()
6739 assert(VT.isFloatingPoint() && in getNode()
6741 VT.bitsLE(N1.getValueType()) && in getNode()
6744 if (N1.getValueType() == VT) return N1; // noop conversion. in getNode()
6749 assert(VT == N1.getValueType() && "Not an inreg extend!"); in getNode()
6750 assert(VT.isInteger() && EVT.isInteger() && in getNode()
6755 assert(EVT.bitsLE(VT.getScalarType()) && "Not extending!"); in getNode()
6756 if (VT.getScalarType() == EVT) return N1; // noop assertion. in getNode()
6761 assert(VT == N1.getValueType() && "Not an inreg extend!"); in getNode()
6762 assert(VT.isInteger() && EVT.isInteger() && in getNode()
6764 assert(EVT.isVector() == VT.isVector() && in getNode()
6768 EVT.getVectorElementCount() == VT.getVectorElementCount()) && in getNode()
6770 assert(EVT.bitsLE(VT) && "Not extending!"); in getNode()
6771 if (EVT == VT) return N1; // Not actually extending in getNode()
6782 return SignExtendInReg(Val, VT); in getNode()
6788 for (int i = 0, e = VT.getVectorNumElements(); i != e; ++i) { in getNode()
6798 return getBuildVector(VT, DL, Ops); in getNode()
6804 ISD::SPLAT_VECTOR, DL, VT, in getNode()
6811 assert(VT.isInteger() && cast<VTSDNode>(N2)->getVT().isInteger() && in getNode()
6813 assert(N1.getValueType().isVector() == VT.isVector() && in getNode()
6816 assert((!VT.isVector() || VT.getVectorElementCount() == in getNode()
6821 assert(cast<VTSDNode>(N2)->getVT().bitsLE(VT.getScalarType()) && in getNode()
6826 assert(VT.getSizeInBits() >= N1.getValueType().getScalarSizeInBits() && in getNode()
6832 return getUNDEF(VT); in getNode()
6839 return getUNDEF(VT); in getNode()
6849 return getNode(ISD::EXTRACT_VECTOR_ELT, DL, VT, in getNode()
6865 if (VT != Elt.getValueType()) in getNode()
6869 Elt = getAnyExtOrTrunc(Elt, DL, VT); in getNode()
6885 if (VT == N1.getOperand(1).getValueType()) in getNode()
6887 if (VT.isFloatingPoint()) { in getNode()
6888 assert(VT.getSizeInBits() > N1.getOperand(1).getValueType().getSizeInBits()); in getNode()
6889 return getFPExtendOrRound(N1.getOperand(1), DL, VT); in getNode()
6891 return getSExtOrTrunc(N1.getOperand(1), DL, VT); in getNode()
6893 return getNode(ISD::EXTRACT_VECTOR_ELT, DL, VT, N1.getOperand(0), N2); in getNode()
6908 return getNode(ISD::EXTRACT_VECTOR_ELT, DL, VT, N1.getOperand(0), in getNode()
6914 assert(!N1.getValueType().isVector() && !VT.isVector() && in getNode()
6915 (N1.getValueType().isInteger() == VT.isInteger()) && in getNode()
6916 N1.getValueType() != VT && in getNode()
6927 unsigned ElementSize = VT.getSizeInBits(); in getNode()
6930 return getConstant(Val.extractBits(ElementSize, Shift), DL, VT); in getNode()
6935 assert(VT.isVector() && N1VT.isVector() && in getNode()
6937 assert(VT.getVectorElementType() == N1VT.getVectorElementType() && in getNode()
6939 assert((VT.isFixedLengthVector() || N1VT.isScalableVector()) && in getNode()
6941 assert((VT.isScalableVector() != N1VT.isScalableVector() || in getNode()
6942 VT.getVectorMinNumElements() <= N1VT.getVectorMinNumElements()) && in getNode()
6945 assert((VT.isScalableVector() != N1VT.isScalableVector() || in getNode()
6946 (VT.getVectorMinNumElements() + N2C->getZExtValue()) <= in getNode()
6954 if (VT == N1VT) in getNode()
6959 return getUNDEF(VT); in getNode()
6964 VT == N1.getOperand(0).getValueType()) { in getNode()
6965 unsigned Factor = VT.getVectorMinNumElements(); in getNode()
6972 VT == N1.getOperand(1).getValueType()) in getNode()
6979 if (SDValue SV = FoldConstantArithmetic(Opcode, DL, VT, {N1, N2})) in getNode()
6989 return getUNDEF(VT); // fold op(undef, arg2) -> undef in getNode()
6997 return getConstant(0, DL, VT); // fold op(undef, arg2) -> 0 in getNode()
7009 return getConstant(0, DL, VT); in getNode()
7017 return getUNDEF(VT); // fold op(arg1, undef) -> undef in getNode()
7022 return getConstant(0, DL, VT); // fold op(arg1, undef) -> 0 in getNode()
7026 return getAllOnesConstant(DL, VT); in getNode()
7032 SDVTList VTs = getVTList(VT); in getNode()
7034 if (VT != MVT::Glue) { in getNode()
7058 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, in getNode() argument
7063 return getNode(Opcode, DL, VT, N1, N2, N3, Flags); in getNode()
7066 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, in getNode() argument
7077 assert(VT.isFloatingPoint() && "This operator only applies to FP types!"); in getNode()
7078 assert(N1.getValueType() == VT && N2.getValueType() == VT && in getNode()
7079 N3.getValueType() == VT && "FMA types must match!"); in getNode()
7092 return getConstantFP(V1, DL, VT); in getNode()
7099 if (SDValue V = FoldBUILD_VECTOR(DL, VT, Ops, *this)) in getNode()
7105 if (SDValue V = foldCONCAT_VECTORS(DL, VT, Ops, *this)) in getNode()
7110 assert(VT.isInteger() && "SETCC result type must be an integer!"); in getNode()
7113 assert(VT.isVector() == N1.getValueType().isVector() && in getNode()
7115 assert((!VT.isVector() || VT.getVectorElementCount() == in getNode()
7119 if (SDValue V = FoldSetCC(VT, N1, N2, cast<CondCodeSDNode>(N3)->get(), DL)) in getNode()
7123 if (SDValue V = FoldConstantArithmetic(Opcode, DL, VT, Ops)) { in getNode()
7148 return getUNDEF(VT); in getNode()
7152 return getUNDEF(VT); in getNode()
7163 return getUNDEF(VT); in getNode()
7166 assert(VT == N1.getValueType() && in getNode()
7168 assert(VT.isVector() && N2VT.isVector() && in getNode()
7170 assert(VT.getVectorElementType() == N2VT.getVectorElementType() && in getNode()
7172 assert((VT.isScalableVector() || N2VT.isFixedLengthVector()) && in getNode()
7174 assert((VT.isScalableVector() != N2VT.isScalableVector() || in getNode()
7175 VT.getVectorMinNumElements() >= N2VT.getVectorMinNumElements()) && in getNode()
7179 assert((VT.isScalableVector() != N2VT.isScalableVector() || in getNode()
7181 VT.getVectorMinNumElements()) && in getNode()
7188 if (VT == N2VT) in getNode()
7194 N2.getOperand(1) == N3 && N2.getOperand(0).getValueType() == VT) in getNode()
7200 if (N1.getValueType() == VT) in getNode()
7207 if (N1.getValueType() == VT) in getNode()
7214 SDVTList VTs = getVTList(VT); in getNode()
7216 if (VT != MVT::Glue) { in getNode()
7240 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, in getNode() argument
7243 return getNode(Opcode, DL, VT, Ops); in getNode()
7246 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, in getNode() argument
7250 return getNode(Opcode, DL, VT, Ops); in getNode()
7276 static SDValue getMemsetValue(SDValue Value, EVT VT, SelectionDAG &DAG, in getMemsetValue() argument
7280 unsigned NumBits = VT.getScalarSizeInBits(); in getMemsetValue()
7284 if (VT.isInteger()) { in getMemsetValue()
7285 bool IsOpaque = VT.getSizeInBits() > 64 || in getMemsetValue()
7287 return DAG.getConstant(Val, dl, VT, false, IsOpaque); in getMemsetValue()
7289 return DAG.getConstantFP(APFloat(DAG.EVTToAPFloatSemantics(VT), Val), dl, in getMemsetValue()
7290 VT); in getMemsetValue()
7294 EVT IntVT = VT.getScalarType(); in getMemsetValue()
7307 if (VT != Value.getValueType() && !VT.isInteger()) in getMemsetValue()
7308 Value = DAG.getBitcast(VT.getScalarType(), Value); in getMemsetValue()
7309 if (VT != Value.getValueType()) in getMemsetValue()
7310 Value = DAG.getSplatBuildVector(VT, dl, Value); in getMemsetValue()
7318 static SDValue getMemsetStringVal(EVT VT, const SDLoc &dl, SelectionDAG &DAG, in getMemsetStringVal() argument
7323 if (VT.isInteger()) in getMemsetStringVal()
7324 return DAG.getConstant(0, dl, VT); in getMemsetStringVal()
7325 if (VT == MVT::f32 || VT == MVT::f64 || VT == MVT::f128) in getMemsetStringVal()
7326 return DAG.getConstantFP(0.0, dl, VT); in getMemsetStringVal()
7327 if (VT.isVector()) { in getMemsetStringVal()
7328 unsigned NumElts = VT.getVectorNumElements(); in getMemsetStringVal()
7329 MVT EltVT = (VT.getVectorElementType() == MVT::f32) ? MVT::i32 : MVT::i64; in getMemsetStringVal()
7330 return DAG.getNode(ISD::BITCAST, dl, VT, in getMemsetStringVal()
7338 assert(!VT.isVector() && "Can't handle vector type here!"); in getMemsetStringVal()
7339 unsigned NumVTBits = VT.getSizeInBits(); in getMemsetStringVal()
7354 Type *Ty = VT.getTypeForEVT(*DAG.getContext()); in getMemsetStringVal()
7356 return DAG.getConstant(Val, dl, VT); in getMemsetStringVal()
7363 EVT VT = Base.getValueType(); in getMemBasePlusOffset() local
7371 Index = getConstant(Offset.getFixedValue(), DL, VT); in getMemBasePlusOffset()
7520 EVT VT = MemOps[i]; in getMemcpyLoadsAndStores() local
7521 unsigned VTSize = VT.getSizeInBits() / 8; in getMemcpyLoadsAndStores()
7533 (isZeroConstant || (VT.isInteger() && !VT.isVector()))) { in getMemcpyLoadsAndStores()
7549 Value = getMemsetStringVal(VT, dl, DAG, TLI, SubSlice); in getMemcpyLoadsAndStores()
7565 EVT NVT = TLI.getTypeToTransformTo(C, VT); in getMemcpyLoadsAndStores()
7566 assert(NVT.bitsGE(VT)); in getMemcpyLoadsAndStores()
7579 SrcPtrInfo.getWithOffset(SrcOff), VT, in getMemcpyLoadsAndStores()
7586 DstPtrInfo.getWithOffset(DstOff), VT, Alignment, MMOFlags, NewAAInfo); in getMemcpyLoadsAndStores()
7710 EVT VT = MemOps[i]; in getMemmoveLoadsAndStores() local
7711 unsigned VTSize = VT.getSizeInBits() / 8; in getMemmoveLoadsAndStores()
7721 VT, dl, Chain, in getMemmoveLoadsAndStores()
7731 EVT VT = MemOps[i]; in getMemmoveLoadsAndStores() local
7732 unsigned VTSize = VT.getSizeInBits() / 8; in getMemmoveLoadsAndStores()
7832 EVT VT = MemOps[i]; in getMemsetStores() local
7833 unsigned VTSize = VT.getSizeInBits() / 8; in getMemsetStores()
7845 if (VT.bitsLT(LargestVT)) { in getMemsetStores()
7847 unsigned NElts = LargestVT.getSizeInBits() / VT.getSizeInBits(); in getMemsetStores()
7848 EVT SVT = EVT::getVectorVT(*DAG.getContext(), VT.getScalarType(), NElts); in getMemsetStores()
7849 if (!LargestVT.isVector() && !VT.isVector() && in getMemsetStores()
7850 TLI.isTruncateFree(LargestVT, VT)) in getMemsetStores()
7851 Value = DAG.getNode(ISD::TRUNCATE, dl, VT, MemSetValue); in getMemsetStores()
7852 else if (LargestVT.isVector() && !VT.isVector() && in getMemsetStores()
7855 VT.getSizeInBits(), Index) && in getMemsetStores()
7861 Value = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, VT, TailValue, in getMemsetStores()
7864 Value = getMemsetValue(Src, VT, DAG, dl); in getMemsetStores()
7866 assert(Value.getValueType() == VT && "Value with wrong type."); in getMemsetStores()
7874 DstOff += VT.getSizeInBits() / 8; in getMemsetStores()
8294 EVT VT = Val.getValueType(); in getAtomic() local
8297 getVTList(VT, MVT::Other); in getAtomic()
8303 EVT VT, SDValue Chain, SDValue Ptr, in getAtomic() argument
8307 SDVTList VTs = getVTList(VT, MVT::Other); in getAtomic()
8477 EVT VT, const SDLoc &dl, SDValue Chain, in getLoad() argument
8497 return getLoad(AM, ExtType, VT, dl, Chain, Ptr, Offset, MemVT, MMO); in getLoad()
8501 EVT VT, const SDLoc &dl, SDValue Chain, in getLoad() argument
8504 if (VT == MemVT) { in getLoad()
8507 assert(VT == MemVT && "Non-extending load from different memory type!"); in getLoad()
8510 assert(MemVT.getScalarType().bitsLT(VT.getScalarType()) && in getLoad()
8512 assert(VT.isInteger() == MemVT.isInteger() && in getLoad()
8514 assert(VT.isVector() == MemVT.isVector() && in getLoad()
8516 assert((!VT.isVector() || in getLoad()
8517 VT.getVectorElementCount() == MemVT.getVectorElementCount()) && in getLoad()
8525 getVTList(VT, Ptr.getValueType(), MVT::Other) : getVTList(VT, MVT::Other); in getLoad()
8550 SDValue SelectionDAG::getLoad(EVT VT, const SDLoc &dl, SDValue Chain, in getLoad() argument
8556 return getLoad(ISD::UNINDEXED, ISD::NON_EXTLOAD, VT, dl, Chain, Ptr, Undef, in getLoad()
8557 PtrInfo, VT, Alignment, MMOFlags, AAInfo, Ranges); in getLoad()
8560 SDValue SelectionDAG::getLoad(EVT VT, const SDLoc &dl, SDValue Chain, in getLoad() argument
8563 return getLoad(ISD::UNINDEXED, ISD::NON_EXTLOAD, VT, dl, Chain, Ptr, Undef, in getLoad()
8564 VT, MMO); in getLoad()
8568 EVT VT, SDValue Chain, SDValue Ptr, in getExtLoad() argument
8574 return getLoad(ISD::UNINDEXED, ExtType, VT, dl, Chain, Ptr, Undef, PtrInfo, in getExtLoad()
8579 EVT VT, SDValue Chain, SDValue Ptr, EVT MemVT, in getExtLoad() argument
8582 return getLoad(ISD::UNINDEXED, ExtType, VT, dl, Chain, Ptr, Undef, in getExtLoad()
8625 EVT VT = Val.getValueType(); in getStore() local
8631 ID.AddInteger(VT.getRawBits()); in getStore()
8633 dl.getIROrder(), VTs, ISD::UNINDEXED, false, VT, MMO)); in getStore()
8642 ISD::UNINDEXED, false, VT, MMO); in getStore()
8676 EVT VT = Val.getValueType(); in getTruncStore() local
8680 if (VT == SVT) in getTruncStore()
8683 assert(SVT.getScalarType().bitsLT(VT.getScalarType()) && in getTruncStore()
8685 assert(VT.isInteger() == SVT.isInteger() && in getTruncStore()
8687 assert(VT.isVector() == SVT.isVector() && in getTruncStore()
8689 assert((!VT.isVector() || in getTruncStore()
8690 VT.getVectorElementCount() == SVT.getVectorElementCount()) && in getTruncStore()
8749 ISD::MemIndexedMode AM, ISD::LoadExtType ExtType, EVT VT, const SDLoc &dl, in getLoadVP() argument
8767 return getLoadVP(AM, ExtType, VT, dl, Chain, Ptr, Offset, Mask, EVL, MemVT, in getLoadVP()
8772 ISD::LoadExtType ExtType, EVT VT, in getLoadVP() argument
8780 SDVTList VTs = Indexed ? getVTList(VT, Ptr.getValueType(), MVT::Other) in getLoadVP()
8781 : getVTList(VT, MVT::Other); in getLoadVP()
8806 SDValue SelectionDAG::getLoadVP(EVT VT, const SDLoc &dl, SDValue Chain, in getLoadVP() argument
8814 return getLoadVP(ISD::UNINDEXED, ISD::NON_EXTLOAD, VT, dl, Chain, Ptr, Undef, in getLoadVP()
8815 Mask, EVL, PtrInfo, VT, Alignment, MMOFlags, AAInfo, Ranges, in getLoadVP()
8819 SDValue SelectionDAG::getLoadVP(EVT VT, const SDLoc &dl, SDValue Chain, in getLoadVP() argument
8823 return getLoadVP(ISD::UNINDEXED, ISD::NON_EXTLOAD, VT, dl, Chain, Ptr, Undef, in getLoadVP()
8824 Mask, EVL, VT, MMO, IsExpanding); in getLoadVP()
8828 EVT VT, SDValue Chain, SDValue Ptr, in getExtLoadVP() argument
8835 return getLoadVP(ISD::UNINDEXED, ExtType, VT, dl, Chain, Ptr, Undef, Mask, in getExtLoadVP()
8841 EVT VT, SDValue Chain, SDValue Ptr, in getExtLoadVP() argument
8845 return getLoadVP(ISD::UNINDEXED, ExtType, VT, dl, Chain, Ptr, Undef, Mask, in getExtLoadVP()
8927 EVT VT = Val.getValueType(); in getTruncStoreVP() local
8930 if (VT == SVT) in getTruncStoreVP()
8932 EVL, VT, MMO, ISD::UNINDEXED, in getTruncStoreVP()
8935 assert(SVT.getScalarType().bitsLT(VT.getScalarType()) && in getTruncStoreVP()
8937 assert(VT.isInteger() == SVT.isInteger() && "Can't do FP-INT conversion!"); in getTruncStoreVP()
8938 assert(VT.isVector() == SVT.isVector() && in getTruncStoreVP()
8940 assert((!VT.isVector() || in getTruncStoreVP()
8941 VT.getVectorElementCount() == SVT.getVectorElementCount()) && in getTruncStoreVP()
9002 ISD::MemIndexedMode AM, ISD::LoadExtType ExtType, EVT VT, const SDLoc &DL, in getStridedLoadVP() argument
9020 return getStridedLoadVP(AM, ExtType, VT, DL, Chain, Ptr, Offset, Stride, Mask, in getStridedLoadVP()
9025 ISD::MemIndexedMode AM, ISD::LoadExtType ExtType, EVT VT, const SDLoc &DL, in getStridedLoadVP() argument
9032 SDVTList VTs = Indexed ? getVTList(VT, Ptr.getValueType(), MVT::Other) in getStridedLoadVP()
9033 : getVTList(VT, MVT::Other); in getStridedLoadVP()
9036 ID.AddInteger(VT.getRawBits()); in getStridedLoadVP()
9059 EVT VT, const SDLoc &DL, SDValue Chain, SDValue Ptr, SDValue Stride, in getStridedLoadVP() argument
9064 return getStridedLoadVP(ISD::UNINDEXED, ISD::NON_EXTLOAD, VT, DL, Chain, Ptr, in getStridedLoadVP()
9065 Undef, Stride, Mask, EVL, PtrInfo, VT, Alignment, in getStridedLoadVP()
9069 SDValue SelectionDAG::getStridedLoadVP(EVT VT, const SDLoc &DL, SDValue Chain, in getStridedLoadVP() argument
9075 return getStridedLoadVP(ISD::UNINDEXED, ISD::NON_EXTLOAD, VT, DL, Chain, Ptr, in getStridedLoadVP()
9076 Undef, Stride, Mask, EVL, VT, MMO, IsExpanding); in getStridedLoadVP()
9080 ISD::LoadExtType ExtType, const SDLoc &DL, EVT VT, SDValue Chain, in getExtStridedLoadVP() argument
9086 return getStridedLoadVP(ISD::UNINDEXED, ExtType, VT, DL, Chain, Ptr, Undef, in getExtStridedLoadVP()
9092 ISD::LoadExtType ExtType, const SDLoc &DL, EVT VT, SDValue Chain, in getExtStridedLoadVP() argument
9096 return getStridedLoadVP(ISD::UNINDEXED, ExtType, VT, DL, Chain, Ptr, Undef, in getExtStridedLoadVP()
9179 EVT VT = Val.getValueType(); in getTruncStridedStoreVP() local
9182 if (VT == SVT) in getTruncStridedStoreVP()
9184 Stride, Mask, EVL, VT, MMO, ISD::UNINDEXED, in getTruncStridedStoreVP()
9187 assert(SVT.getScalarType().bitsLT(VT.getScalarType()) && in getTruncStridedStoreVP()
9189 assert(VT.isInteger() == SVT.isInteger() && "Can't do FP-INT conversion!"); in getTruncStridedStoreVP()
9190 assert(VT.isVector() == SVT.isVector() && in getTruncStridedStoreVP()
9192 assert((!VT.isVector() || in getTruncStridedStoreVP()
9193 VT.getVectorElementCount() == SVT.getVectorElementCount()) && in getTruncStridedStoreVP()
9254 SDValue SelectionDAG::getGatherVP(SDVTList VTs, EVT VT, const SDLoc &dl, in getGatherVP() argument
9261 ID.AddInteger(VT.getRawBits()); in getGatherVP()
9263 dl.getIROrder(), VTs, VT, MMO, IndexType)); in getGatherVP()
9273 VT, MMO, IndexType); in getGatherVP()
9297 SDValue SelectionDAG::getScatterVP(SDVTList VTs, EVT VT, const SDLoc &dl, in getScatterVP() argument
9305 ID.AddInteger(VT.getRawBits()); in getScatterVP()
9307 dl.getIROrder(), VTs, VT, MMO, IndexType)); in getScatterVP()
9316 VT, MMO, IndexType); in getScatterVP()
9341 SDValue SelectionDAG::getMaskedLoad(EVT VT, const SDLoc &dl, SDValue Chain, in getMaskedLoad() argument
9350 SDVTList VTs = Indexed ? getVTList(VT, Base.getValueType(), MVT::Other) in getMaskedLoad()
9351 : getVTList(VT, MVT::Other); in getMaskedLoad()
9682 SDValue SelectionDAG::getVAArg(EVT VT, const SDLoc &dl, SDValue Chain, in getVAArg() argument
9685 return getNode(ISD::VAARG, dl, getVTList(VT, MVT::Other), Ops); in getVAArg()
9688 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, in getNode() argument
9691 case 0: return getNode(Opcode, DL, VT); in getNode()
9692 case 1: return getNode(Opcode, DL, VT, static_cast<const SDValue>(Ops[0])); in getNode()
9693 case 2: return getNode(Opcode, DL, VT, Ops[0], Ops[1]); in getNode()
9694 case 3: return getNode(Opcode, DL, VT, Ops[0], Ops[1], Ops[2]); in getNode()
9701 return getNode(Opcode, DL, VT, NewOps); in getNode()
9704 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, in getNode() argument
9709 return getNode(Opcode, DL, VT, Ops, Flags); in getNode()
9712 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, in getNode() argument
9716 case 0: return getNode(Opcode, DL, VT); in getNode()
9717 case 1: return getNode(Opcode, DL, VT, Ops[0], Flags); in getNode()
9718 case 2: return getNode(Opcode, DL, VT, Ops[0], Ops[1], Flags); in getNode()
9719 case 3: return getNode(Opcode, DL, VT, Ops[0], Ops[1], Ops[2], Flags); in getNode()
9733 if (SDValue V = FoldBUILD_VECTOR(DL, VT, Ops, *this)) in getNode()
9737 if (SDValue V = foldCONCAT_VECTORS(DL, VT, Ops, *this)) in getNode()
9746 assert(Ops[2].getValueType() == VT && in getNode()
9750 VT.getVectorElementCount()) && in getNode()
9762 if (VT.isVector() && VT.getVectorElementType() == MVT::i1) in getNode()
9767 if (VT.isVector() && VT.getVectorElementType() == MVT::i1) in getNode()
9772 if (VT == MVT::i1) in getNode()
9777 if (VT == MVT::i1) in getNode()
9784 if (VT == MVT::i1) in getNode()
9791 if (VT == MVT::i1) in getNode()
9798 SDVTList VTs = getVTList(VT); in getNode()
9800 if (VT != MVT::Glue) { in getNode()
9980 return getNode(Opcode, DL, VT, N1, N2, N3.getOperand(0)); in getNode()
9985 unsigned NumBits = VT.getScalarSizeInBits()*2; in getNode()
9987 return getNode(Opcode, DL, VT, N1, N2, N3.getOperand(0)); in getNode()
10053 SDVTList SelectionDAG::getVTList(EVT VT) { in getVTList() argument
10054 return makeVTList(SDNode::getValueTypeList(VT), 1); in getVTList()
10284 EVT VT) { in SelectNodeTo() argument
10285 SDVTList VTs = getVTList(VT); in SelectNodeTo()
10290 EVT VT, SDValue Op1) { in SelectNodeTo() argument
10291 SDVTList VTs = getVTList(VT); in SelectNodeTo()
10297 EVT VT, SDValue Op1, in SelectNodeTo() argument
10299 SDVTList VTs = getVTList(VT); in SelectNodeTo()
10305 EVT VT, SDValue Op1, in SelectNodeTo() argument
10307 SDVTList VTs = getVTList(VT); in SelectNodeTo()
10313 EVT VT, ArrayRef<SDValue> Ops) { in SelectNodeTo() argument
10314 SDVTList VTs = getVTList(VT); in SelectNodeTo()
10492 EVT VT) { in getMachineNode() argument
10493 SDVTList VTs = getVTList(VT); in getMachineNode()
10498 EVT VT, SDValue Op1) { in getMachineNode() argument
10499 SDVTList VTs = getVTList(VT); in getMachineNode()
10505 EVT VT, SDValue Op1, SDValue Op2) { in getMachineNode() argument
10506 SDVTList VTs = getVTList(VT); in getMachineNode()
10512 EVT VT, SDValue Op1, SDValue Op2, in getMachineNode() argument
10514 SDVTList VTs = getVTList(VT); in getMachineNode()
10520 EVT VT, ArrayRef<SDValue> Ops) { in getMachineNode() argument
10521 SDVTList VTs = getVTList(VT); in getMachineNode()
10609 SDValue SelectionDAG::getTargetExtractSubreg(int SRIdx, const SDLoc &DL, EVT VT, in getTargetExtractSubreg() argument
10613 VT, Operand, SRIdxVal); in getTargetExtractSubreg()
10619 SDValue SelectionDAG::getTargetInsertSubreg(int SRIdx, const SDLoc &DL, EVT VT, in getTargetInsertSubreg() argument
10623 VT, Operand, Subreg, SRIdxVal); in getTargetInsertSubreg()
11591 EVT VT = V.getValueType(); in isNeutralConstant() local
11592 const fltSemantics &Semantics = SelectionDAG::EVTToAPFloatSemantics(VT); in isNeutralConstant()
11644 EVT VT = N.getValueType(); in isConstOrConstSplat() local
11645 APInt DemandedElts = VT.isFixedLengthVector() in isConstOrConstSplat()
11646 ? APInt::getAllOnes(VT.getVectorMinNumElements()) in isConstOrConstSplat()
11689 EVT VT = N.getValueType(); in isConstOrConstSplatFP() local
11690 APInt DemandedElts = VT.isFixedLengthVector() in isConstOrConstSplatFP()
11691 ? APInt::getAllOnes(VT.getVectorMinNumElements()) in isConstOrConstSplatFP()
11744 const GlobalValue *GA, EVT VT, in GlobalAddressSDNode() argument
11746 : SDNode(Opc, Order, DL, getSDVTList(VT)), Offset(o), TargetFlags(TF) { in GlobalAddressSDNode()
11751 EVT VT, unsigned SrcAS, in AddrSpaceCastSDNode() argument
11753 : SDNode(ISD::ADDRSPACECAST, Order, dl, getSDVTList(VT)), in AddrSpaceCastSDNode()
11794 const EVT *SDNode::getValueTypeList(EVT VT) { in getValueTypeList() argument
11799 if (VT.isExtended()) { in getValueTypeList()
11801 return &(*EVTs.insert(VT).first); in getValueTypeList()
11803 assert(VT.getSimpleVT() < MVT::VALUETYPE_SIZE && "Value type out of range!"); in getValueTypeList()
11804 return &SimpleVTArray.VTs[VT.getSimpleVT().SimpleTy]; in getValueTypeList()
12051 EVT VT = N->getValueType(0); in UnrollVectorOp() local
12052 EVT EltVT = VT.getVectorElementType(); in UnrollVectorOp()
12053 unsigned NE = VT.getVectorNumElements(); in UnrollVectorOp()
12086 SDValue Vec0 = getBuildVector(VT, dl, Scalars0); in UnrollVectorOp()
12210 EVT VT = LD->getMemoryVT(); in areNonVolatileConsecutiveLoads() local
12211 if (VT.getSizeInBits() / 8 != Bytes) in areNonVolatileConsecutiveLoads()
12276 std::pair<EVT, EVT> SelectionDAG::GetSplitDestVTs(const EVT &VT) const { in GetSplitDestVTs()
12279 if (!VT.isVector()) in GetSplitDestVTs()
12280 LoVT = HiVT = TLI->getTypeToTransformTo(*getContext(), VT); in GetSplitDestVTs()
12282 LoVT = HiVT = VT.getHalfNumVectorElementsVT(*getContext()); in GetSplitDestVTs()
12291 SelectionDAG::GetDependentSplitDestVTs(const EVT &VT, const EVT &EnvVT, in GetDependentSplitDestVTs() argument
12293 EVT EltTp = VT.getVectorElementType(); in GetDependentSplitDestVTs()
12299 ElementCount VTNumElts = VT.getVectorElementCount(); in GetDependentSplitDestVTs()
12346 EVT VT = N.getValueType(); in SplitEVL() local
12352 ? getConstant(HalfMinNumElts, DL, VT) in SplitEVL()
12353 : getVScale(DL, VT, APInt(VT.getScalarSizeInBits(), HalfMinNumElts)); in SplitEVL()
12354 SDValue Lo = getNode(ISD::UMIN, DL, VT, N, HalfNumElts); in SplitEVL()
12355 SDValue Hi = getNode(ISD::USUBSAT, DL, VT, N, HalfNumElts); in SplitEVL()
12361 EVT VT = N.getValueType(); in WidenVector() local
12362 EVT WideVT = EVT::getVectorVT(*getContext(), VT.getVectorElementType(), in WidenVector()
12363 NextPowerOf2(VT.getVectorNumElements())); in WidenVector()
12372 EVT VT = Op.getValueType(); in ExtractVectorElements() local
12374 Count = VT.getVectorNumElements(); in ExtractVectorElements()
12376 EltVT = VT.getVectorElementType(); in ExtractVectorElements()
12400 EVT VT = getValueType(0); in isConstantSplat() local
12401 assert(VT.isVector() && "Expected a vector type"); in isConstantSplat()
12402 unsigned VecWidth = VT.getSizeInBits(); in isConstantSplat()
12417 unsigned EltWidth = VT.getScalarSizeInBits(); in isConstantSplat()
12733 bool ShuffleVectorSDNode::isSplatMask(const int *Mask, EVT VT) { in isSplatMask() argument
12736 for (i = 0, e = VT.getVectorNumElements(); i != e && Mask[i] < 0; ++i) in isSplatMask()
12824 EVT VT, SDNodeFlags Flags) { in getNeutralElement() argument
12832 return getConstant(0, DL, VT); in getNeutralElement()
12834 return getConstant(1, DL, VT); in getNeutralElement()
12837 return getAllOnesConstant(DL, VT); in getNeutralElement()
12839 return getConstant(APInt::getSignedMinValue(VT.getSizeInBits()), DL, VT); in getNeutralElement()
12841 return getConstant(APInt::getSignedMaxValue(VT.getSizeInBits()), DL, VT); in getNeutralElement()
12843 return getConstantFP(-0.0, DL, VT); in getNeutralElement()
12845 return getConstantFP(1.0, DL, VT); in getNeutralElement()
12849 const fltSemantics &Semantics = EVTToAPFloatSemantics(VT); in getNeutralElement()
12856 return getConstantFP(NeutralAF, DL, VT); in getNeutralElement()
12861 const fltSemantics &Semantics = EVTToAPFloatSemantics(VT); in getNeutralElement()
12867 return getConstantFP(NeutralAF, DL, VT); in getNeutralElement()