Lines Matching defs:SDValue

112 static void NewSDValueDbgMsg(SDValue V, StringRef Msg, SelectionDAG *G) {
209 SDValue NotZero = N->getOperand(i);
242 for (const SDValue &Op : N->op_values()) {
283 for (const SDValue &Op : N->op_values()) {
296 for (const SDValue &Op : N->op_values()) {
326 for (const SDValue &Op : N->op_values()) {
348 return all_of(N->op_values(), [](SDValue Op) { return Op.isUndef(); });
356 bool ISD::matchUnaryPredicateImpl(SDValue Op,
384 SDValue, std::function<bool(ConstantSDNode *)>, bool);
386 SDValue, std::function<bool(ConstantFPSDNode *)>, bool);
389 SDValue LHS, SDValue RHS,
408 SDValue LHSOp = LHS.getOperand(i);
409 SDValue RHSOp = RHS.getOperand(i);
694 ArrayRef<SDValue> Ops) {
711 SDVTList VTList, ArrayRef<SDValue> OpList) {
1031 Use.set(SDValue());
1263 SDNode *SelectionDAG::FindModifiedNodeSlot(SDNode *N, SDValue Op,
1268 SDValue Ops[] = { Op };
1283 SDValue Op1, SDValue Op2,
1288 SDValue Ops[] = { Op1, Op2 };
1302 SDNode *SelectionDAG::FindModifiedNodeSlot(SDNode *N, ArrayRef<SDValue> Ops,
1433 SDValue SelectionDAG::getFPExtendOrRound(SDValue Op, const SDLoc &DL, EVT VT) {
1440 std::pair<SDValue, SDValue>
1441 SelectionDAG::getStrictFPExtendOrRound(SDValue Op, SDValue Chain,
1445 SDValue Res =
1451 return std::pair<SDValue, SDValue>(Res, SDValue(Res.getNode(), 1));
1454 SDValue SelectionDAG::getAnyExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT) {
1460 SDValue SelectionDAG::getSExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT) {
1466 SDValue SelectionDAG::getZExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT) {
1472 SDValue SelectionDAG::getBitcastedAnyExtOrTrunc(SDValue Op, const SDLoc &DL,
1476 SDValue DestOp;
1487 SDValue SelectionDAG::getBitcastedSExtOrTrunc(SDValue Op, const SDLoc &DL,
1491 SDValue DestOp;
1502 SDValue SelectionDAG::getBitcastedZExtOrTrunc(SDValue Op, const SDLoc &DL,
1506 SDValue DestOp;
1517 SDValue SelectionDAG::getBoolExtOrTrunc(SDValue Op, const SDLoc &SL, EVT VT,
1526 SDValue SelectionDAG::getZeroExtendInReg(SDValue Op, const SDLoc &DL, EVT VT) {
1544 SDValue SelectionDAG::getVPZeroExtendInReg(SDValue Op, SDValue Mask,
1545 SDValue EVL, const SDLoc &DL,
1563 SDValue SelectionDAG::getPtrExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT) {
1569 SDValue SelectionDAG::getPtrExtendInReg(SDValue Op, const SDLoc &DL, EVT VT) {
1575 SDValue SelectionDAG::getNegative(SDValue Val, const SDLoc &DL, EVT VT) {
1580 SDValue SelectionDAG::getNOT(const SDLoc &DL, SDValue Val, EVT VT) {
1584 SDValue SelectionDAG::getLogicalNOT(const SDLoc &DL, SDValue Val, EVT VT) {
1585 SDValue TrueValue = getBoolConstant(true, DL, VT, VT);
1589 SDValue SelectionDAG::getVPLogicalNOT(const SDLoc &DL, SDValue Val,
1590 SDValue Mask, SDValue EVL, EVT VT) {
1591 SDValue TrueValue = getBoolConstant(true, DL, VT, VT);
1595 SDValue SelectionDAG::getVPPtrExtOrTrunc(const SDLoc &DL, EVT VT, SDValue Op,
1596 SDValue Mask, SDValue EVL) {
1600 SDValue SelectionDAG::getVPZExtOrTrunc(const SDLoc &DL, EVT VT, SDValue Op,
1601 SDValue Mask, SDValue EVL) {
1609 SDValue SelectionDAG::getBoolConstant(bool V, const SDLoc &DL, EVT VT,
1624 SDValue SelectionDAG::getConstant(uint64_t Val, const SDLoc &DL, EVT VT,
1633 SDValue SelectionDAG::getConstant(const APInt &Val, const SDLoc &DL, EVT VT,
1638 SDValue SelectionDAG::getConstant(const ConstantInt &Val, const SDLoc &DL,
1679 SmallVector<SDValue, 2> ScalarParts;
1696 SmallVector<SDValue, 2> EltParts;
1714 SmallVector<SDValue, 8> Ops;
1718 SDValue V =
1735 return SDValue(N, 0);
1741 NewSDValueDbgMsg(SDValue(N, 0), "Creating constant: ", this);
1744 SDValue Result(N, 0);
1750 SDValue SelectionDAG::getIntPtrConstant(uint64_t Val, const SDLoc &DL,
1755 SDValue SelectionDAG::getShiftAmountConstant(uint64_t Val, EVT VT,
1762 SDValue SelectionDAG::getShiftAmountConstant(const APInt &Val, EVT VT,
1768 SDValue SelectionDAG::getVectorIdxConstant(uint64_t Val, const SDLoc &DL,
1773 SDValue SelectionDAG::getConstantFP(const APFloat &V, const SDLoc &DL, EVT VT,
1778 SDValue SelectionDAG::getConstantFP(const ConstantFP &V, const SDLoc &DL,
1796 return SDValue(N, 0);
1804 SDValue Result(N, 0);
1811 SDValue SelectionDAG::getConstantFP(double Val, const SDLoc &DL, EVT VT,
1829 SDValue SelectionDAG::getGlobalAddress(const GlobalValue *GV, const SDLoc &DL,
1854 return SDValue(E, 0);
1860 return SDValue(N, 0);
1863 SDValue SelectionDAG::getFrameIndex(int FI, EVT VT, bool isTarget) {
1871 return SDValue(E, 0);
1876 return SDValue(N, 0);
1879 SDValue SelectionDAG::getJumpTable(int JTI, EVT VT, bool isTarget,
1891 return SDValue(E, 0);
1896 return SDValue(N, 0);
1899 SDValue SelectionDAG::getJumpTableDebugInfo(int JTI, SDValue Chain,
1906 SDValue SelectionDAG::getConstantPool(const Constant *C, EVT VT,
1925 return SDValue(E, 0);
1931 SDValue V = SDValue(N, 0);
1936 SDValue SelectionDAG::getConstantPool(MachineConstantPoolValue *C, EVT VT,
1953 return SDValue(E, 0);
1959 return SDValue(N, 0);
1962 SDValue SelectionDAG::getBasicBlock(MachineBasicBlock *MBB) {
1968 return SDValue(E, 0);
1973 return SDValue(N, 0);
1976 SDValue SelectionDAG::getValueType(EVT VT) {
1984 if (N) return SDValue(N, 0);
1987 return SDValue(N, 0);
1990 SDValue SelectionDAG::getExternalSymbol(const char *Sym, EVT VT) {
1992 if (N) return SDValue(N, 0);
1995 return SDValue(N, 0);
1998 SDValue SelectionDAG::getMCSymbol(MCSymbol *Sym, EVT VT) {
2001 return SDValue(N, 0);
2004 return SDValue(N, 0);
2007 SDValue SelectionDAG::getTargetExternalSymbol(const char *Sym, EVT VT,
2011 if (N) return SDValue(N, 0);
2014 return SDValue(N, 0);
2017 SDValue SelectionDAG::getCondCode(ISD::CondCode Cond) {
2027 return SDValue(CondCodeNodes[Cond], 0);
2030 SDValue SelectionDAG::getVScale(const SDLoc &DL, EVT VT, APInt MulImm,
2049 SDValue SelectionDAG::getElementCount(const SDLoc &DL, EVT VT, ElementCount EC,
2058 SDValue SelectionDAG::getStepVector(const SDLoc &DL, EVT ResVT) {
2063 SDValue SelectionDAG::getStepVector(const SDLoc &DL, EVT ResVT,
2071 SmallVector<SDValue, 16> OpsStepConstants;
2080 static void commuteShuffle(SDValue &N1, SDValue &N2, MutableArrayRef<int> M) {
2085 SDValue SelectionDAG::getVectorShuffle(EVT VT, const SDLoc &dl, SDValue N1,
2086 SDValue N2, ArrayRef<int> Mask) {
2122 SDValue Splat = BV->getSplatValue(&UndefElements);
2186 SDValue V = N1;
2196 SDValue Splat = BV->getSplatValue(&UndefElements);
2216 const SDValue &Splatted = BV->getOperand(MaskVec[0]);
2217 SDValue NewBV = getSplatBuildVector(BuildVT, dl, Splatted);
2230 SDValue Ops[2] = { N1, N2 };
2237 return SDValue(E, 0);
2251 SDValue V = SDValue(N, 0);
2256 SDValue SelectionDAG::getCommutedVectorShuffle(const ShuffleVectorSDNode &SV) {
2261 SDValue Op0 = SV.getOperand(0);
2262 SDValue Op1 = SV.getOperand(1);
2266 SDValue SelectionDAG::getRegister(unsigned RegNo, EVT VT) {
2273 return SDValue(E, 0);
2279 return SDValue(N, 0);
2282 SDValue SelectionDAG::getRegisterMask(const uint32_t *RegMask) {
2288 return SDValue(E, 0);
2293 return SDValue(N, 0);
2296 SDValue SelectionDAG::getEHLabel(const SDLoc &dl, SDValue Root,
2301 SDValue SelectionDAG::getLabelNode(unsigned Opcode, const SDLoc &dl,
2302 SDValue Root, MCSymbol *Label) {
2304 SDValue Ops[] = { Root };
2309 return SDValue(E, 0);
2317 return SDValue(N, 0);
2320 SDValue SelectionDAG::getBlockAddress(const BlockAddress *BA, EVT VT,
2333 return SDValue(E, 0);
2338 return SDValue(N, 0);
2341 SDValue SelectionDAG::getSrcValue(const Value *V) {
2348 return SDValue(E, 0);
2353 return SDValue(N, 0);
2356 SDValue SelectionDAG::getMDNode(const MDNode *MD) {
2363 return SDValue(E, 0);
2368 return SDValue(N, 0);
2371 SDValue SelectionDAG::getBitcast(EVT VT, SDValue V) {
2378 SDValue SelectionDAG::getAddrSpaceCast(const SDLoc &dl, EVT VT, SDValue Ptr,
2381 SDValue Ops[] = {Ptr};
2389 return SDValue(E, 0);
2397 return SDValue(N, 0);
2400 SDValue SelectionDAG::getFreeze(SDValue V) {
2406 SDValue SelectionDAG::getShiftAmountOperand(EVT LHSTy, SDValue Op) {
2414 SDValue SelectionDAG::expandVAArg(SDNode *Node) {
2419 SDValue Tmp1 = Node->getOperand(0);
2420 SDValue Tmp2 = Node->getOperand(1);
2423 SDValue VAListLoad = getLoad(TLI.getPointerTy(getDataLayout()), dl, Tmp1,
2425 SDValue VAList = VAListLoad;
2448 SDValue SelectionDAG::expandVACopy(SDNode *Node) {
2455 SDValue Tmp1 =
2490 SDValue SelectionDAG::CreateStackTemporary(TypeSize Bytes, Align Alignment) {
2503 SDValue SelectionDAG::CreateStackTemporary(EVT VT, unsigned minAlign) {
2510 SDValue SelectionDAG::CreateStackTemporary(EVT VT1, EVT VT2) {
2527 SDValue SelectionDAG::FoldSetCC(EVT VT, SDValue N1, SDValue N2,
2656 return SDValue();
2678 return SDValue();
2683 bool SelectionDAG::SignBitIsZero(SDValue Op, unsigned Depth) const {
2691 bool SelectionDAG::MaskedValueIsZero(SDValue V, const APInt &Mask,
2699 bool SelectionDAG::MaskedValueIsZero(SDValue V, const APInt &Mask,
2707 bool SelectionDAG::MaskedVectorIsZero(SDValue V, const APInt &DemandedElts,
2713 bool SelectionDAG::MaskedValueIsAllOnes(SDValue V, const APInt &Mask,
2718 APInt SelectionDAG::computeVectorKnownZeroElements(SDValue Op,
2743 bool SelectionDAG::isSplatValue(SDValue V, const APInt &DemandedElts,
2771 SDValue LHS = V.getOperand(0);
2772 SDValue RHS = V.getOperand(1);
2804 SDValue Scl;
2806 SDValue Op = V.getOperand(i);
2847 auto CheckSplatSrc = [&](SDValue Src, const APInt &SrcElts) {
2859 SDValue Src = V.getOperand(0);
2877 SDValue Src = V.getOperand(0);
2891 SDValue Src = V.getOperand(0);
2929 bool SelectionDAG::isSplatValue(SDValue V, bool AllowUndefs) const {
2943 SDValue SelectionDAG::getSplatSourceVector(SDValue V, int &SplatIdx) {
2992 return SDValue();
2995 SDValue SelectionDAG::getSplatValue(SDValue V, bool LegalTypes) {
2997 if (SDValue SrcVector = getSplatSourceVector(V, SplatIdx)) {
3002 return SDValue();
3005 return SDValue();
3010 return SDValue();
3014 SelectionDAG::getValidShiftAmountRange(SDValue V, const APInt &DemandedElts,
3063 SelectionDAG::getValidShiftAmount(SDValue V, const APInt &DemandedElts,
3076 SelectionDAG::getValidShiftAmount(SDValue V, unsigned Depth) const {
3085 SelectionDAG::getValidMinimumShiftAmount(SDValue V, const APInt &DemandedElts,
3097 SelectionDAG::getValidMinimumShiftAmount(SDValue V, unsigned Depth) const {
3106 SelectionDAG::getValidMaximumShiftAmount(SDValue V, const APInt &DemandedElts,
3118 SelectionDAG::getValidMaximumShiftAmount(SDValue V, unsigned Depth) const {
3129 KnownBits SelectionDAG::computeKnownBits(SDValue Op, unsigned Depth) const {
3144 KnownBits SelectionDAG::computeKnownBits(SDValue Op, const APInt &DemandedElts,
3177 SDValue SrcOp = Op.getOperand(0);
3229 SDValue SrcOp = Op.getOperand(i);
3261 SDValue LHS = Op.getOperand(0);
3269 SDValue RHS = Op.getOperand(1);
3293 SDValue Sub = Op.getOperand(i);
3308 SDValue Src = Op.getOperand(0);
3309 SDValue Sub = Op.getOperand(1);
3331 SDValue Src = Op.getOperand(0);
3349 SDValue N0 = Op.getOperand(0);
3360 SDValue N0 = Op.getOperand(0);
3993 SDValue InVec = Op.getOperand(0);
3994 SDValue EltNo = Op.getOperand(1);
4027 SDValue InVec = Op.getOperand(0);
4028 SDValue InVal = Op.getOperand(1);
4029 SDValue EltNo = Op.getOperand(2);
4235 SelectionDAG::computeOverflowForSignedAdd(SDValue N0, SDValue N1) const {
4250 SelectionDAG::computeOverflowForUnsignedAdd(SDValue N0, SDValue N1) const {
4273 SelectionDAG::computeOverflowForSignedSub(SDValue N0, SDValue N1) const {
4291 SelectionDAG::computeOverflowForUnsignedSub(SDValue N0, SDValue N1) const {
4304 SelectionDAG::computeOverflowForUnsignedMul(SDValue N0, SDValue N1) const {
4317 SelectionDAG::computeOverflowForSignedMul(SDValue N0, SDValue N1) const {
4346 bool SelectionDAG::isKnownToBeAPowerOfTwo(SDValue Val, unsigned Depth) const {
4384 if (llvm::all_of(Val->ops(), [BitWidth](SDValue E) {
4418 SDValue X;
4430 bool SelectionDAG::isKnownToBeAPowerOfTwoFP(SDValue Val, unsigned Depth) const {
4440 unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, unsigned Depth) const {
4452 unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, const APInt &DemandedElts,
4499 SDValue SrcOp = Op.getOperand(i);
4546 SDValue N0 = Op.getOperand(0);
4605 SDValue Src = Op.getOperand(0);
4629 SDValue Ext = Op.getOperand(0);
4631 SDValue Extendee = Ext.getOperand(0);
4870 SDValue InVec = Op.getOperand(0);
4871 SDValue InVal = Op.getOperand(1);
4872 SDValue EltNo = Op.getOperand(2);
4898 SDValue InVec = Op.getOperand(0);
4899 SDValue EltNo = Op.getOperand(1);
4926 SDValue Src = Op.getOperand(0);
4960 SDValue Src = Op.getOperand(0);
4961 SDValue Sub = Op.getOperand(1);
5114 unsigned SelectionDAG::ComputeMaxSignificantBits(SDValue Op,
5120 unsigned SelectionDAG::ComputeMaxSignificantBits(SDValue Op,
5127 bool SelectionDAG::isGuaranteedNotToBeUndefOrPoison(SDValue Op, bool PoisonOnly,
5144 bool SelectionDAG::isGuaranteedNotToBeUndefOrPoison(SDValue Op,
5221 all_of(Op->ops(), [&](SDValue V) {
5226 bool SelectionDAG::canCreateUndefOrPoison(SDValue Op, bool PoisonOnly,
5241 bool SelectionDAG::canCreateUndefOrPoison(SDValue Op, const APInt &DemandedElts,
5331 SDValue Idx = Op.getOperand(Opcode == ISD::INSERT_VECTOR_ELT ? 2 : 1);
5362 bool SelectionDAG::isADDLike(SDValue Op, bool NoWrap) const {
5372 bool SelectionDAG::isBaseWithConstantOffset(SDValue Op) const {
5377 bool SelectionDAG::isKnownNeverNaN(SDValue Op, bool SNaN, unsigned Depth) const {
5488 for (const SDValue &Opnd : Op->ops())
5505 bool SelectionDAG::isKnownNeverZeroFloat(SDValue Op) const {
5514 bool SelectionDAG::isKnownNeverZero(SDValue Op, unsigned Depth) const {
5668 bool SelectionDAG::cannotBeOrderedNegativeFP(SDValue Op) const {
5675 bool SelectionDAG::isEqualTo(SDValue A, SDValue B) const {
5689 SDValue llvm::getBitwiseNotOperand(SDValue V, SDValue Mask, bool AllowUndefs) {
5697 return SDValue();
5698 SDValue ExtArg = V.getOperand(0);
5705 return SDValue();
5708 static bool haveNoCommonBitsSetCommutative(SDValue A, SDValue B) {
5711 auto MatchNoCommonBitsPattern = [&](SDValue Not, SDValue Mask,
5712 SDValue Other) {
5713 if (SDValue NotOperand =
5741 bool SelectionDAG::haveNoCommonBitsSet(SDValue A, SDValue B) const {
5751 static SDValue FoldSTEP_VECTOR(const SDLoc &DL, EVT VT, SDValue Step,
5756 return SDValue();
5759 static SDValue FoldBUILD_VECTOR(const SDLoc &DL, EVT VT,
5760 ArrayRef<SDValue> Ops,
5770 if (llvm::all_of(Ops, [](SDValue Op) { return Op.isUndef(); }))
5774 SDValue IdentitySrc;
5790 return SDValue();
5795 static SDValue foldCONCAT_VECTORS(const SDLoc &DL, EVT VT,
5796 ArrayRef<SDValue> Ops,
5800 [Ops](SDValue Op) {
5812 if (llvm::all_of(Ops, [](SDValue Op) { return Op.isUndef(); }))
5818 SDValue IdentitySrc;
5821 SDValue Op = Ops[i];
5842 return SDValue();
5848 SmallVector<SDValue, 16> Elts;
5849 for (SDValue Op : Ops) {
5856 return SDValue();
5861 for (SDValue Op : Elts)
5865 for (SDValue &Op : Elts) {
5875 SDValue V = DAG.getBuildVector(VT, DL, Elts);
5881 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT) {
5887 return SDValue(E, 0);
5893 SDValue V = SDValue(N, 0);
5898 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
5899 SDValue N1) {
5906 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
5907 SDValue N1, const SDNodeFlags Flags) {
5944 SDValue Ops = {N1};
5945 if (SDValue Fold = FoldConstantArithmetic(Opcode, DL, VT, Ops))
5971 SDValue Ops[] = {N1};
5972 if (SDValue V = FoldBUILD_VECTOR(DL, VT, Ops, *this))
6045 SDValue OpOp = N1.getOperand(0);
6083 SDValue OpOp = N1.getOperand(0);
6227 SDValue Ops[] = {N1};
6234 return SDValue(E, 0);
6247 SDValue V = SDValue(N, 0);
6327 SDValue SelectionDAG::FoldSymbolOffset(unsigned Opcode, EVT VT,
6331 return SDValue();
6333 return SDValue();
6336 return SDValue();
6341 default: return SDValue();
6347 bool SelectionDAG::isUndef(unsigned Opcode, ArrayRef<SDValue> Ops) {
6356 SDValue Divisor = Ops[1];
6362 [](SDValue V) { return V.isUndef() ||
6372 SDValue SelectionDAG::FoldConstantArithmetic(unsigned Opcode, const SDLoc &DL,
6373 EVT VT, ArrayRef<SDValue> Ops,
6382 return SDValue();
6386 return SDValue();
6393 SDValue N1 = Ops[0];
6462 if (SDValue V = FoldSTEP_VECTOR(DL, VT, N1, *this))
6492 return SDValue();
6498 return SDValue();
6504 return SDValue();
6553 return SDValue();
6558 if (SDValue CFP = foldConstantFPMath(Opcode, DL, VT, Ops))
6564 return SDValue();
6569 return SDValue();
6571 SDValue Folded = getConstant(*FoldAttempt, DL, VT);
6588 return SDValue();
6597 SDValue N1 = peekThroughBitcasts(Ops[0]);
6598 SDValue N2 = peekThroughBitcasts(Ops[1]);
6634 SmallVector<SDValue> Ops(DstBits.size(), getUNDEF(BVEltVT));
6659 auto IsScalarOrSameVectorSize = [NumElts](const SDValue &Op) {
6664 auto IsBuildVectorSplatVectorOrUndef = [](const SDValue &Op) {
6675 return SDValue();
6692 return SDValue();
6701 SmallVector<SDValue, 4> ScalarResults;
6703 SmallVector<SDValue, 4> ScalarOps;
6704 for (SDValue Op : Ops) {
6715 SDValue ScalarOp =
6730 return SDValue();
6738 SDValue ScalarResult = getNode(Opcode, DL, SVT, ScalarOps, Flags);
6747 return SDValue();
6751 SDValue V = NumElts.isScalable() ? getSplatVector(VT, DL, ScalarResults[0])
6757 SDValue SelectionDAG::foldConstantFPMath(unsigned Opcode, const SDLoc &DL,
6758 EVT VT, ArrayRef<SDValue> Ops) {
6761 return SDValue();
6767 SDValue N1 = Ops[0];
6768 SDValue N2 = Ops[1];
6833 return SDValue();
6836 SDValue SelectionDAG::getAssertAlign(const SDLoc &DL, SDValue Val, Align A) {
6851 return SDValue(E, 0);
6860 SDValue V(N, 0);
6865 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
6866 SDValue N1, SDValue N2) {
6873 void SelectionDAG::canonicalizeCommutativeBinop(unsigned Opcode, SDValue &N1,
6874 SDValue &N2) const {
6894 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
6895 SDValue N1, SDValue N2, const SDNodeFlags Flags) {
6922 SDValue Ops[] = {N1, N2};
6923 if (SDValue V = FoldBUILD_VECTOR(DL, VT, Ops, *this))
6928 SDValue Ops[] = {N1, N2};
6929 if (SDValue V = foldCONCAT_VECTORS(DL, VT, Ops, *this))
7042 if (SDValue V = simplifyFPBinop(Opcode, N1, N2, Flags))
7060 if (SDValue V = simplifyShift(N1, N2))
7135 SmallVector<SDValue, 8> Ops;
7138 SDValue Op = N1.getOperand(i);
7212 SDValue Elt = N1.getOperand(Index);
7229 SDValue N1Op2 = N1.getOperand(2);
7328 if (SDValue SV = FoldConstantArithmetic(Opcode, DL, VT, {N1, N2}, Flags))
7382 SDValue Ops[] = {N1, N2};
7389 return SDValue(E, 0);
7402 SDValue V = SDValue(N, 0);
7407 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
7408 SDValue N1, SDValue N2, SDValue N3) {
7415 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
7416 SDValue N1, SDValue N2, SDValue N3,
7447 SDValue Ops[] = {N1, N2, N3};
7448 if (SDValue V = FoldBUILD_VECTOR(DL, VT, Ops, *this))
7453 SDValue Ops[] = {N1, N2, N3};
7454 if (SDValue V = foldCONCAT_VECTORS(DL, VT, Ops, *this))
7468 if (SDValue V = FoldSetCC(VT, N1, N2, cast<CondCodeSDNode>(N3)->get(), DL))
7471 SDValue Ops[] = {N1, N2, N3};
7472 if (SDValue V = FoldConstantArithmetic(Opcode, DL, VT, Ops)) {
7480 if (SDValue V = simplifySelect(N1, N2, N3))
7580 SDValue Ops[] = {N1, N2, N3};
7587 return SDValue(E, 0);
7600 SDValue V = SDValue(N, 0);
7605 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
7606 SDValue N1, SDValue N2, SDValue N3, SDValue N4) {
7607 SDValue Ops[] = { N1, N2, N3, N4 };
7611 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
7612 SDValue N1, SDValue N2, SDValue N3, SDValue N4,
7613 SDValue N5) {
7614 SDValue Ops[] = { N1, N2, N3, N4, N5 };
7620 SDValue SelectionDAG::getStackArgumentTokenFactor(SDValue Chain) {
7621 SmallVector<SDValue, 8> ArgChains;
7633 ArgChains.push_back(SDValue(L, 1));
7641 static SDValue getMemsetValue(SDValue Value, EVT VT, SelectionDAG &DAG,
7683 static SDValue getMemsetStringVal(EVT VT, const SDLoc &dl, SelectionDAG &DAG,
7722 return SDValue();
7725 SDValue SelectionDAG::getMemBasePlusOffset(SDValue Base, TypeSize Offset,
7729 SDValue Index;
7741 SDValue SelectionDAG::getMemBasePlusOffset(SDValue Ptr, SDValue Offset,
7750 static bool isMemSrcFromConstant(SDValue Src, ConstantDataArraySlice &Slice) {
7778 SmallVector<SDValue, 32> &OutChains, unsigned From,
7779 unsigned To, SmallVector<SDValue, 16> &OutLoadChains,
7780 SmallVector<SDValue, 16> &OutStoreChains) {
7783 SmallVector<SDValue, 16> GluedLoadChains;
7790 SDValue LoadToken = DAG.getNode(ISD::TokenFactor, dl, MVT::Other,
7795 SDValue NewStore = DAG.getTruncStore(LoadToken, dl, ST->getValue(),
7802 static SDValue getMemcpyLoadsAndStores(SelectionDAG &DAG, const SDLoc &dl,
7803 SDValue Chain, SDValue Dst, SDValue Src,
7846 return SDValue();
7879 SmallVector<SDValue, 16> OutLoadChains;
7880 SmallVector<SDValue, 16> OutStoreChains;
7881 SmallVector<SDValue, 32> OutChains;
7887 SDValue Value, Store;
8005 static SDValue getMemmoveLoadsAndStores(SelectionDAG &DAG, const SDLoc &dl,
8006 SDValue Chain, SDValue Dst, SDValue Src,
8041 return SDValue();
8070 SmallVector<SDValue, 8> LoadValues;
8071 SmallVector<SDValue, 8> LoadChains;
8072 SmallVector<SDValue, 8> OutChains;
8077 SDValue Value;
8098 SDValue Store;
8125 /// SDValue otherwise.
8130 static SDValue getMemsetStores(SelectionDAG &DAG, const SDLoc &dl,
8131 SDValue Chain, SDValue Dst, SDValue Src,
8158 return SDValue();
8181 SmallVector<SDValue, 8> OutChains;
8190 SDValue MemSetValue = getMemsetValue(Src, LargestVT, DAG, dl);
8209 SDValue Value = MemSetValue;
8225 SDValue TailValue = DAG.getNode(ISD::BITCAST, dl, SVT, MemSetValue);
8232 SDValue Store = DAG.getStore(
8256 SDValue SelectionDAG::getMemcpy(
8257 SDValue Chain, const SDLoc &dl, SDValue Dst, SDValue Src, SDValue Size,
8269 SDValue Result = getMemcpyLoadsAndStores(
8279 SDValue Result = TSI->EmitTargetCodeForMemcpy(
8337 std::pair<SDValue,SDValue> CallResult = TLI->LowerCallTo(CLI);
8341 SDValue SelectionDAG::getAtomicMemcpy(SDValue Chain, const SDLoc &dl,
8342 SDValue Dst, SDValue Src, SDValue Size,
8377 std::pair<SDValue, SDValue> CallResult = TLI->LowerCallTo(CLI);
8381 SDValue SelectionDAG::getMemmove(SDValue Chain, const SDLoc &dl, SDValue Dst,
8382 SDValue Src, SDValue Size, Align Alignment,
8396 SDValue Result = getMemmoveLoadsAndStores(
8406 SDValue Result =
8453 std::pair<SDValue,SDValue> CallResult = TLI->LowerCallTo(CLI);
8457 SDValue SelectionDAG::getAtomicMemmove(SDValue Chain, const SDLoc &dl,
8458 SDValue Dst, SDValue Src, SDValue Size,
8493 std::pair<SDValue, SDValue> CallResult = TLI->LowerCallTo(CLI);
8497 SDValue SelectionDAG::getMemset(SDValue Chain, const SDLoc &dl, SDValue Dst,
8498 SDValue Src, SDValue Size, Align Alignment,
8511 SDValue Result = getMemsetStores(*this, dl, Chain, Dst, Src,
8522 SDValue Result = TSI->EmitTargetCodeForMemset(
8532 SDValue Result = getMemsetStores(*this, dl, Chain, Dst, Src,
8553 const auto CreateEntry = [](SDValue Node, Type *Ty) {
8591 std::pair<SDValue, SDValue> CallResult = TLI->LowerCallTo(CLI);
8595 SDValue SelectionDAG::getAtomicMemset(SDValue Chain, const SDLoc &dl,
8596 SDValue Dst, SDValue Value, SDValue Size,
8631 std::pair<SDValue, SDValue> CallResult = TLI->LowerCallTo(CLI);
8635 SDValue SelectionDAG::getAtomic(unsigned Opcode, const SDLoc &dl, EVT MemVT,
8636 SDVTList VTList, ArrayRef<SDValue> Ops,
8646 return SDValue(E, 0);
8655 return SDValue(N, 0);
8658 SDValue SelectionDAG::getAtomicCmpSwap(unsigned Opcode, const SDLoc &dl,
8659 EVT MemVT, SDVTList VTs, SDValue Chain,
8660 SDValue Ptr, SDValue Cmp, SDValue Swp,
8666 SDValue Ops[] = {Chain, Ptr, Cmp, Swp};
8670 SDValue SelectionDAG::getAtomic(unsigned Opcode, const SDLoc &dl, EVT MemVT,
8671 SDValue Chain, SDValue Ptr, SDValue Val,
8698 SDValue Ops[] = {Chain, Ptr, Val};
8702 SDValue SelectionDAG::getAtomic(unsigned Opcode, const SDLoc &dl, EVT MemVT,
8703 EVT VT, SDValue Chain, SDValue Ptr,
8708 SDValue Ops[] = {Chain, Ptr};
8713 SDValue SelectionDAG::getMergeValues(ArrayRef<SDValue> Ops, const SDLoc &dl) {
8719 for (const SDValue &Op : Ops)
8724 SDValue SelectionDAG::getMemIntrinsicNode(
8725 unsigned Opcode, const SDLoc &dl, SDVTList VTList, ArrayRef<SDValue> Ops,
8739 SDValue SelectionDAG::getMemIntrinsicNode(unsigned Opcode, const SDLoc &dl,
8741 ArrayRef<SDValue> Ops, EVT MemVT,
8763 return SDValue(E, 0);
8777 SDValue V(N, 0);
8782 SDValue SelectionDAG::getLifetimeNode(bool IsStart, const SDLoc &dl,
8783 SDValue Chain, int FrameIndex,
8787 SDValue Ops[2] = {
8800 return SDValue(E, 0);
8807 SDValue V(N, 0);
8812 SDValue SelectionDAG::getPseudoProbeNode(const SDLoc &Dl, SDValue Chain,
8817 SDValue Ops[] = {Chain};
8824 return SDValue(E, 0);
8831 SDValue V(N, 0);
8841 SelectionDAG &DAG, SDValue Ptr,
8865 SelectionDAG &DAG, SDValue Ptr,
8866 SDValue OffsetOp) {
8875 SDValue SelectionDAG::getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType,
8876 EVT VT, const SDLoc &dl, SDValue Chain,
8877 SDValue Ptr, SDValue Offset,
8899 SDValue SelectionDAG::getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType,
8900 EVT VT, const SDLoc &dl, SDValue Chain,
8901 SDValue Ptr, SDValue Offset, EVT MemVT,
8925 SDValue Ops[] = { Chain, Ptr, Offset };
8936 return SDValue(E, 0);
8944 SDValue V(N, 0);
8949 SDValue SelectionDAG::getLoad(EVT VT, const SDLoc &dl, SDValue Chain,
8950 SDValue Ptr, MachinePointerInfo PtrInfo,
8954 SDValue Undef = getUNDEF(Ptr.getValueType());
8959 SDValue SelectionDAG::getLoad(EVT VT, const SDLoc &dl, SDValue Chain,
8960 SDValue Ptr, MachineMemOperand *MMO) {
8961 SDValue Undef = getUNDEF(Ptr.getValueType());
8966 SDValue SelectionDAG::getExtLoad(ISD::LoadExtType ExtType, const SDLoc &dl,
8967 EVT VT, SDValue Chain, SDValue Ptr,
8972 SDValue Undef = getUNDEF(Ptr.getValueType());
8977 SDValue SelectionDAG::getExtLoad(ISD::LoadExtType ExtType, const SDLoc &dl,
8978 EVT VT, SDValue Chain, SDValue Ptr, EVT MemVT,
8980 SDValue Undef = getUNDEF(Ptr.getValueType());
8985 SDValue SelectionDAG::getIndexedLoad(SDValue OrigLoad, const SDLoc &dl,
8986 SDValue Base, SDValue Offset,
8999 SDValue SelectionDAG::getStore(SDValue Chain, const SDLoc &dl, SDValue Val,
9000 SDValue Ptr, MachinePointerInfo PtrInfo,
9019 SDValue SelectionDAG::getStore(SDValue Chain, const SDLoc &dl, SDValue Val,
9020 SDValue Ptr, MachineMemOperand *MMO) {
9025 SDValue Undef = getUNDEF(Ptr.getValueType());
9026 SDValue Ops[] = { Chain, Val, Ptr, Undef };
9037 return SDValue(E, 0);
9045 SDValue V(N, 0);
9050 SDValue SelectionDAG::getTruncStore(SDValue Chain, const SDLoc &dl, SDValue Val,
9051 SDValue Ptr, MachinePointerInfo PtrInfo,
9071 SDValue SelectionDAG::getTruncStore(SDValue Chain, const SDLoc &dl, SDValue Val,
9072 SDValue Ptr, EVT SVT,
9092 SDValue Undef = getUNDEF(Ptr.getValueType());
9093 SDValue Ops[] = { Chain, Val, Ptr, Undef };
9104 return SDValue(E, 0);
9112 SDValue V(N, 0);
9117 SDValue SelectionDAG::getIndexedStore(SDValue OrigStore, const SDLoc &dl,
9118 SDValue Base, SDValue Offset,
9123 SDValue Ops[] = { ST->getChain(), ST->getValue(), Base, Offset };
9132 return SDValue(E, 0);
9141 SDValue V(N, 0);
9146 SDValue SelectionDAG::getLoadVP(
9148 SDValue Chain, SDValue Ptr, SDValue Offset, SDValue Mask, SDValue EVL,
9169 SDValue SelectionDAG::getLoadVP(ISD::MemIndexedMode AM,
9171 const SDLoc &dl, SDValue Chain, SDValue Ptr,
9172 SDValue Offset, SDValue Mask, SDValue EVL,
9180 SDValue Ops[] = {Chain, Ptr, Offset, Mask, EVL};
9191 return SDValue(E, 0);
9199 SDValue V(N, 0);
9204 SDValue SelectionDAG::getLoadVP(EVT VT, const SDLoc &dl, SDValue Chain,
9205 SDValue Ptr, SDValue Mask, SDValue EVL,
9211 SDValue Undef = getUNDEF(Ptr.getValueType());
9217 SDValue SelectionDAG::getLoadVP(EVT VT, const SDLoc &dl, SDValue Chain,
9218 SDValue Ptr, SDValue Mask, SDValue EVL,
9220 SDValue Undef = getUNDEF(Ptr.getValueType());
9225 SDValue SelectionDAG::getExtLoadVP(ISD::LoadExtType ExtType, const SDLoc &dl,
9226 EVT VT, SDValue Chain, SDValue Ptr,
9227 SDValue Mask, SDValue EVL,
9232 SDValue Undef = getUNDEF(Ptr.getValueType());
9238 SDValue SelectionDAG::getExtLoadVP(ISD::LoadExtType ExtType, const SDLoc &dl,
9239 EVT VT, SDValue Chain, SDValue Ptr,
9240 SDValue Mask, SDValue EVL, EVT MemVT,
9242 SDValue Undef = getUNDEF(Ptr.getValueType());
9247 SDValue SelectionDAG::getIndexedLoadVP(SDValue OrigLoad, const SDLoc &dl,
9248 SDValue Base, SDValue Offset,
9263 SDValue SelectionDAG::getStoreVP(SDValue Chain, const SDLoc &dl, SDValue Val,
9264 SDValue Ptr, SDValue Offset, SDValue Mask,
9265 SDValue EVL, EVT MemVT, MachineMemOperand *MMO,
9273 SDValue Ops[] = {Chain, Val, Ptr, Offset, Mask, EVL};
9284 return SDValue(E, 0);
9292 SDValue V(N, 0);
9297 SDValue SelectionDAG::getTruncStoreVP(SDValue Chain, const SDLoc &dl,
9298 SDValue Val, SDValue Ptr, SDValue Mask,
9299 SDValue EVL, MachinePointerInfo PtrInfo,
9320 SDValue SelectionDAG::getTruncStoreVP(SDValue Chain, const SDLoc &dl,
9321 SDValue Val, SDValue Ptr, SDValue Mask,
9322 SDValue EVL, EVT SVT,
9343 SDValue Undef = getUNDEF(Ptr.getValueType());
9344 SDValue Ops[] = {Chain, Val, Ptr, Undef, Mask, EVL};
9355 return SDValue(E, 0);
9364 SDValue V(N, 0);
9369 SDValue SelectionDAG::getIndexedStoreVP(SDValue OrigStore, const SDLoc &dl,
9370 SDValue Base, SDValue Offset,
9375 SDValue Ops[] = {ST->getChain(), ST->getValue(), Base,
9385 return SDValue(E, 0);
9394 SDValue V(N, 0);
9399 SDValue SelectionDAG::getStridedLoadVP(
9401 SDValue Chain, SDValue Ptr, SDValue Offset, SDValue Stride, SDValue Mask,
9402 SDValue EVL, EVT MemVT, MachineMemOperand *MMO, bool IsExpanding) {
9406 SDValue Ops[] = {Chain, Ptr, Offset, Stride, Mask, EVL};
9419 return SDValue(E, 0);
9428 SDValue V(N, 0);
9433 SDValue SelectionDAG::getStridedLoadVP(EVT VT, const SDLoc &DL, SDValue Chain,
9434 SDValue Ptr, SDValue Stride,
9435 SDValue Mask, SDValue EVL,
9438 SDValue Undef = getUNDEF(Ptr.getValueType());
9443 SDValue SelectionDAG::getExtStridedLoadVP(
9444 ISD::LoadExtType ExtType, const SDLoc &DL, EVT VT, SDValue Chain,
9445 SDValue Ptr, SDValue Stride, SDValue Mask, SDValue EVL, EVT MemVT,
9447 SDValue Undef = getUNDEF(Ptr.getValueType());
9452 SDValue SelectionDAG::getStridedStoreVP(SDValue Chain, const SDLoc &DL,
9453 SDValue Val, SDValue Ptr,
9454 SDValue Offset, SDValue Stride,
9455 SDValue Mask, SDValue EVL, EVT MemVT,
9464 SDValue Ops[] = {Chain, Val, Ptr, Offset, Stride, Mask, EVL};
9474 return SDValue(E, 0);
9483 SDValue V(N, 0);
9488 SDValue SelectionDAG::getTruncStridedStoreVP(SDValue Chain, const SDLoc &DL,
9489 SDValue Val, SDValue Ptr,
9490 SDValue Stride, SDValue Mask,
9491 SDValue EVL, EVT SVT,
9512 SDValue Undef = getUNDEF(Ptr.getValueType());
9513 SDValue Ops[] = {Chain, Val, Ptr, Undef, Stride, Mask, EVL};
9523 return SDValue(E, 0);
9532 SDValue V(N, 0);
9537 SDValue SelectionDAG::getGatherVP(SDVTList VTs, EVT VT, const SDLoc &dl,
9538 ArrayRef<SDValue> Ops, MachineMemOperand *MMO,
9552 return SDValue(E, 0);
9575 SDValue V(N, 0);
9580 SDValue SelectionDAG::getScatterVP(SDVTList VTs, EVT VT, const SDLoc &dl,
9581 ArrayRef<SDValue> Ops,
9596 return SDValue(E, 0);
9619 SDValue V(N, 0);
9624 SDValue SelectionDAG::getMaskedLoad(EVT VT, const SDLoc &dl, SDValue Chain,
9625 SDValue Base, SDValue Offset, SDValue Mask,
9626 SDValue PassThru, EVT MemVT,
9635 SDValue Ops[] = {Chain, Base, Offset, Mask, PassThru};
9646 return SDValue(E, 0);
9654 SDValue V(N, 0);
9659 SDValue SelectionDAG::getIndexedMaskedLoad(SDValue OrigLoad, const SDLoc &dl,
9660 SDValue Base, SDValue Offset,
9670 SDValue SelectionDAG::getMaskedStore(SDValue Chain, const SDLoc &dl,
9671 SDValue Val, SDValue Base, SDValue Offset,
9672 SDValue Mask, EVT MemVT,
9683 SDValue Ops[] = {Chain, Val, Base, Offset, Mask};
9694 return SDValue(E, 0);
9703 SDValue V(N, 0);
9708 SDValue SelectionDAG::getIndexedMaskedStore(SDValue OrigStore, const SDLoc &dl,
9709 SDValue Base, SDValue Offset,
9719 SDValue SelectionDAG::getMaskedGather(SDVTList VTs, EVT MemVT, const SDLoc &dl,
9720 ArrayRef<SDValue> Ops,
9736 return SDValue(E, 0);
9761 SDValue V(N, 0);
9766 SDValue SelectionDAG::getMaskedScatter(SDVTList VTs, EVT MemVT, const SDLoc &dl,
9767 ArrayRef<SDValue> Ops,
9783 return SDValue(E, 0);
9807 SDValue V(N, 0);
9812 SDValue SelectionDAG::getMaskedHistogram(SDVTList VTs, EVT MemVT,
9813 const SDLoc &dl, ArrayRef<SDValue> Ops,
9828 return SDValue(E, 0);
9845 SDValue V(N, 0);
9850 SDValue SelectionDAG::getGetFPEnv(SDValue Chain, const SDLoc &dl, SDValue Ptr,
9854 SDValue Ops[] = {Chain, Ptr};
9864 return SDValue(E, 0);
9872 SDValue V(N, 0);
9877 SDValue SelectionDAG::getSetFPEnv(SDValue Chain, const SDLoc &dl, SDValue Ptr,
9881 SDValue Ops[] = {Chain, Ptr};
9891 return SDValue(E, 0);
9899 SDValue V(N, 0);
9904 SDValue SelectionDAG::simplifySelect(SDValue Cond, SDValue T, SDValue F) {
9931 return SDValue();
9934 SDValue SelectionDAG::simplifyShift(SDValue X, SDValue Y) {
9959 return SDValue();
9962 SDValue SelectionDAG::simplifyFPBinop(unsigned Opcode, SDValue X, SDValue Y,
9981 return SDValue();
10004 return SDValue();
10007 SDValue SelectionDAG::getVAArg(EVT VT, const SDLoc &dl, SDValue Chain,
10008 SDValue Ptr, SDValue SV, unsigned Align) {
10009 SDValue Ops[] = { Chain, Ptr, SV, getTargetConstant(Align, dl, MVT::i32) };
10013 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
10017 case 1: return getNode(Opcode, DL, VT, static_cast<const SDValue>(Ops[0]));
10023 // Copy from an SDUse array into an SDValue array for use with
10025 SmallVector<SDValue, 8> NewOps(Ops.begin(), Ops.end());
10029 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
10030 ArrayRef<SDValue> Ops) {
10037 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
10038 ArrayRef<SDValue> Ops, const SDNodeFlags Flags) {
10058 if (SDValue V = FoldBUILD_VECTOR(DL, VT, Ops, *this))
10062 if (SDValue V = foldCONCAT_VECTORS(DL, VT, Ops, *this))
10131 return SDValue(E, 0);
10144 SDValue V(N, 0);
10149 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL,
10150 ArrayRef<EVT> ResultTys, ArrayRef<SDValue> Ops) {
10154 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
10155 ArrayRef<SDValue> Ops) {
10162 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
10163 ArrayRef<SDValue> Ops, const SDNodeFlags Flags) {
10184 SDValue N1 = Ops[0], N2 = Ops[1];
10191 SDValue ZeroOverFlow = getConstant(0, DL, VTList.VTs[1]);
10198 SDValue F1 = getFreeze(N1);
10199 SDValue F2 = getFreeze(N2);
10208 SDValue NotF1 = getNOT(DL, F1, VTList.VTs[0]);
10253 SDValue Hi =
10255 SDValue Lo = getConstant(Val.trunc(Width), DL, VTList.VTs[0]);
10269 SDValue Result0 = getConstantFP(FrexpMant, DL, VTList.VTs[0]);
10270 SDValue Result1 =
10337 return SDValue(E, 0);
10349 SDValue V(N, 0);
10354 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL,
10359 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
10360 SDValue N1) {
10361 SDValue Ops[] = { N1 };
10365 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
10366 SDValue N1, SDValue N2) {
10367 SDValue Ops[] = { N1, N2 };
10371 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
10372 SDValue N1, SDValue N2, SDValue N3) {
10373 SDValue Ops[] = { N1, N2, N3 };
10377 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
10378 SDValue N1, SDValue N2, SDValue N3, SDValue N4) {
10379 SDValue Ops[] = { N1, N2, N3, N4 };
10383 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
10384 SDValue N1, SDValue N2, SDValue N3, SDValue N4,
10385 SDValue N5) {
10386 SDValue Ops[] = { N1, N2, N3, N4, N5 };
10480 SDNode *SelectionDAG::UpdateNodeOperands(SDNode *N, SDValue Op) {
10505 SDNode *SelectionDAG::UpdateNodeOperands(SDNode *N, SDValue Op1, SDValue Op2) {
10535 UpdateNodeOperands(SDNode *N, SDValue Op1, SDValue Op2, SDValue Op3) {
10536 SDValue Ops[] = { Op1, Op2, Op3 };
10541 UpdateNodeOperands(SDNode *N, SDValue Op1, SDValue Op2,
10542 SDValue Op3, SDValue Op4) {
10543 SDValue Ops[] = { Op1, Op2, Op3, Op4 };
10548 UpdateNodeOperands(SDNode *N, SDValue Op1, SDValue Op2,
10549 SDValue Op3, SDValue Op4, SDValue Op5) {
10550 SDValue Ops[] = { Op1, Op2, Op3, Op4, Op5 };
10555 UpdateNodeOperands(SDNode *N, ArrayRef<SDValue> Ops) {
10592 Use.set(SDValue());
10627 EVT VT, SDValue Op1) {
10629 SDValue Ops[] = { Op1 };
10634 EVT VT, SDValue Op1,
10635 SDValue Op2) {
10637 SDValue Ops[] = { Op1, Op2 };
10642 EVT VT, SDValue Op1,
10643 SDValue Op2, SDValue Op3) {
10645 SDValue Ops[] = { Op1, Op2, Op3 };
10650 EVT VT, ArrayRef<SDValue> Ops) {
10656 EVT VT1, EVT VT2, ArrayRef<SDValue> Ops) {
10669 ArrayRef<SDValue> Ops) {
10676 SDValue Op1, SDValue Op2) {
10678 SDValue Ops[] = { Op1, Op2 };
10683 SDVTList VTs,ArrayRef<SDValue> Ops) {
10728 SDVTList VTs, ArrayRef<SDValue> Ops) {
10752 Use.set(SDValue());
10796 SDValue InputChain = Node->getOperand(0);
10797 SDValue OutputChain = SDValue(Node, 1);
10800 SmallVector<SDValue, 3> Ops;
10835 EVT VT, SDValue Op1) {
10837 SDValue Ops[] = { Op1 };
10842 EVT VT, SDValue Op1, SDValue Op2) {
10844 SDValue Ops[] = { Op1, Op2 };
10849 EVT VT, SDValue Op1, SDValue Op2,
10850 SDValue Op3) {
10852 SDValue Ops[] = { Op1, Op2, Op3 };
10857 EVT VT, ArrayRef<SDValue> Ops) {
10863 EVT VT1, EVT VT2, SDValue Op1,
10864 SDValue Op2) {
10866 SDValue Ops[] = { Op1, Op2 };
10871 EVT VT1, EVT VT2, SDValue Op1,
10872 SDValue Op2, SDValue Op3) {
10874 SDValue Ops[] = { Op1, Op2, Op3 };
10880 ArrayRef<SDValue> Ops) {
10887 SDValue Op1, SDValue Op2) {
10889 SDValue Ops[] = { Op1, Op2 };
10895 SDValue Op1, SDValue Op2,
10896 SDValue Op3) {
10898 SDValue Ops[] = { Op1, Op2, Op3 };
10904 ArrayRef<SDValue> Ops) {
10911 ArrayRef<SDValue> Ops) {
10918 ArrayRef<SDValue> Ops) {
10940 NewSDValueDbgMsg(SDValue(N, 0), "Creating new machine node: ", this);
10946 SDValue SelectionDAG::getTargetExtractSubreg(int SRIdx, const SDLoc &DL, EVT VT,
10947 SDValue Operand) {
10948 SDValue SRIdxVal = getTargetConstant(SRIdx, DL, MVT::i32);
10951 return SDValue(Subreg, 0);
10956 SDValue SelectionDAG::getTargetInsertSubreg(int SRIdx, const SDLoc &DL, EVT VT,
10957 SDValue Operand, SDValue Subreg) {
10958 SDValue SRIdxVal = getTargetConstant(SRIdx, DL, MVT::i32);
10961 return SDValue(Result, 0);
10967 ArrayRef<SDValue> Ops) {
10975 ArrayRef<SDValue> Ops,
10991 ArrayRef<SDValue> Ops) {
11079 void SelectionDAG::transferDbgValues(SDValue From, SDValue To,
11173 SDValue N0 = N.getOperand(0);
11174 SDValue N1 = N.getOperand(1);
11242 SDValue N0 = N.getOperand(0);
11322 void SelectionDAG::ReplaceAllUsesWith(SDValue FromN, SDValue To) {
11391 transferDbgValues(SDValue(From, i), SDValue(To, i));
11425 setRoot(SDValue(To, getRoot().getResNo()));
11433 void SelectionDAG::ReplaceAllUsesWith(SDNode *From, const SDValue *To) {
11435 return ReplaceAllUsesWith(SDValue(From, 0), To[0]);
11439 transferDbgValues(SDValue(From, i), To[i]);
11461 const SDValue &ToOp = To[Use.getResNo()];
11477 setRoot(SDValue(To[getRoot().getResNo()]));
11483 void SelectionDAG::ReplaceAllUsesOfValueWith(SDValue From, SDValue To){
11641 void SelectionDAG::ReplaceAllUsesOfValuesWith(const SDValue *From,
11642 const SDValue *To,
11806 SDValue SelectionDAG::makeEquivalentMemoryOrdering(SDValue OldChain,
11807 SDValue NewMemOpChain) {
11817 SDValue TokenFactor = getNode(ISD::TokenFactor, SDLoc(OldChain), MVT::Other,
11824 SDValue SelectionDAG::makeEquivalentMemoryOrdering(LoadSDNode *OldLoad,
11825 SDValue NewMemOp) {
11827 SDValue OldChain = SDValue(OldLoad, 1);
11828 SDValue NewMemOpChain = NewMemOp.getValue(1);
11832 SDValue SelectionDAG::getSymbolFunctionGlobalAddress(SDValue Op,
11859 bool llvm::isNullConstant(SDValue V) {
11864 bool llvm::isNullConstantOrUndef(SDValue V) {
11868 bool llvm::isNullFPConstant(SDValue V) {
11873 bool llvm::isAllOnesConstant(SDValue V) {
11878 bool llvm::isOneConstant(SDValue V) {
11883 bool llvm::isMinSignedConstant(SDValue V) {
11888 bool llvm::isNeutralConstant(unsigned Opcode, SDNodeFlags Flags, SDValue V,
11951 SDValue llvm::peekThroughBitcasts(SDValue V) {
11957 SDValue llvm::peekThroughOneUseBitcasts(SDValue V) {
11963 SDValue llvm::peekThroughExtractSubvectors(SDValue V) {
11969 SDValue llvm::peekThroughTruncates(SDValue V) {
11975 bool llvm::isBitwiseNot(SDValue V, bool AllowUndefs) {
11985 ConstantSDNode *llvm::isConstOrConstSplat(SDValue N, bool AllowUndefs,
11994 ConstantSDNode *llvm::isConstOrConstSplat(SDValue N, const APInt &DemandedElts,
12031 ConstantFPSDNode *llvm::isConstOrConstSplatFP(SDValue N, bool AllowUndefs) {
12039 ConstantFPSDNode *llvm::isConstOrConstSplatFP(SDValue N,
12061 bool llvm::isNullOrNullSplat(SDValue N, bool AllowUndefs) {
12068 bool llvm::isOneOrOneSplat(SDValue N, bool AllowUndefs) {
12074 bool llvm::isAllOnesOrAllOnesSplat(SDValue N, bool AllowUndefs) {
12195 bool SDValue::isOperandOf(const SDNode *N) const {
12201 [this](SDValue Op) { return this == Op.getNode(); });
12214 bool SDValue::reachesChainWithoutSideEffects(SDValue Dest,
12239 return llvm::all_of((*this)->ops(), [=](SDValue Op) {
12263 SDValue
12270 return SDValue();
12273 SDValue Op = Extract->getOperand(0);
12277 return SDValue();
12287 return SDValue();
12296 auto PartialReduction = [&](SDValue Op, unsigned NumSubElts) {
12298 return SDValue();
12303 return SDValue();
12323 SDValue PrevOp;
12330 SDValue Op0 = Op.getOperand(0);
12331 SDValue Op1 = Op.getOperand(1);
12358 SDValue Op0 = Op.getOperand(0);
12359 SDValue Op1 = Op.getOperand(1);
12364 SDValue Src = Op0.getOperand(0);
12380 SDValue SelectionDAG::UnrollVectorOp(SDNode *N, unsigned ResNE) {
12394 SmallVector<SDValue, 8> Scalars0, Scalars1;
12395 SmallVector<SDValue, 4> Operands(N->getNumOperands());
12402 SDValue Operand = N->getOperand(j);
12411 SDValue EltOp = getNode(N->getOpcode(), dl, {EltVT, EltVT1}, Operands);
12416 SDValue Vec0 = getBuildVector(VT, dl, Scalars0);
12417 SDValue Vec1 = getBuildVector(VT1, dl, Scalars1);
12424 SmallVector<SDValue, 8> Scalars;
12425 SmallVector<SDValue, 4> Operands(N->getNumOperands());
12430 SDValue Operand = N->getOperand(j);
12477 std::pair<SDValue, SDValue> SelectionDAG::UnrollVectorOverflowOp(
12498 SmallVector<SDValue, 8> LHSScalars;
12499 SmallVector<SDValue, 8> RHSScalars;
12505 SmallVector<SDValue, 8> ResScalars;
12506 SmallVector<SDValue, 8> OvScalars;
12508 SDValue Res = getNode(Opcode, dl, VTs, LHSScalars[i], RHSScalars[i]);
12509 SDValue Ov =
12555 MaybeAlign SelectionDAG::InferPtrAlign(SDValue Ptr) const {
12591 std::pair<SDValue, SDValue> SelectionDAG::SplitScalar(const SDValue &N,
12597 SDValue Lo =
12599 SDValue Hi =
12650 std::pair<SDValue, SDValue>
12651 SelectionDAG::SplitVector(const SDValue &N, const SDLoc &DL, const EVT &LoVT,
12660 SDValue Lo, Hi;
12672 std::pair<SDValue, SDValue> SelectionDAG::SplitEVL(SDValue N, EVT VecVT,
12680 SDValue HalfNumElts =
12684 SDValue Lo = getNode(ISD::UMIN, DL, VT, N, HalfNumElts);
12685 SDValue Hi = getNode(ISD::USUBSAT, DL, VT, N, HalfNumElts);
12690 SDValue SelectionDAG::WidenVector(const SDValue &N, const SDLoc &DL) {
12698 void SelectionDAG::ExtractVectorElements(SDValue Op,
12699 SmallVectorImpl<SDValue> &Args,
12751 SDValue OpVal = getOperand(i);
12801 SDValue BuildVectorSDNode::getSplatValue(const APInt &DemandedElts,
12810 return SDValue();
12811 SDValue Splatted;
12815 SDValue Op = getOperand(i);
12822 return SDValue();
12836 SDValue BuildVectorSDNode::getSplatValue(BitVector *UndefElements) const {
12842 SmallVectorImpl<SDValue> &Sequence,
12862 Sequence.append(SeqLen, SDValue());
12866 SDValue &SeqOp = Sequence[I % SeqLen];
12867 SDValue Op = getOperand(I);
12887 bool BuildVectorSDNode::getRepeatedSequence(SmallVectorImpl<SDValue> &Sequence,
12953 SDValue Op = getOperand(I);
13026 for (const SDValue &Op : op_values()) {
13084 SDNode *SelectionDAG::isConstantIntBuildVectorOrConstantInt(SDValue N) const {
13103 SDNode *SelectionDAG::isConstantFPBuildVectorOrConstantFP(SDValue N) const {
13117 void SelectionDAG::createOperands(SDNode *Node, ArrayRef<SDValue> Vals) {
13140 SDValue SelectionDAG::getTokenFactor(const SDLoc &DL,
13141 SmallVectorImpl<SDValue> &Vals) {
13145 auto ExtractedTFs = ArrayRef<SDValue>(Vals).slice(SliceIdx, Limit);
13146 SDValue NewTF = getNode(ISD::TokenFactor, DL, MVT::Other, ExtractedTFs);
13153 SDValue SelectionDAG::getNeutralElement(unsigned Opcode, const SDLoc &DL,
13157 return SDValue();
13216 SDValue SelectionDAG::makeStateFunctionCall(unsigned LibFunc, SDValue Ptr,
13217 SDValue InChain,
13226 SDValue Callee = getExternalSymbol(TLI->getLibcallName(LC),
13236 assert(From && To && "Invalid SDNode; empty source SDValue?");
13276 for (const SDValue &Op : N->op_values())
13289 for (const SDValue &Op : N->op_values()) {
13347 for (const SDValue &Op : N->op_values())