Lines Matching defs:SDValue
119 static void NewSDValueDbgMsg(SDValue V, StringRef Msg, SelectionDAG *G) {
217 SDValue NotZero = N->getOperand(i);
250 for (const SDValue &Op : N->op_values()) {
291 for (const SDValue &Op : N->op_values()) {
304 for (const SDValue &Op : N->op_values()) {
334 for (const SDValue &Op : N->op_values()) {
356 return all_of(N->op_values(), [](SDValue Op) { return Op.isUndef(); });
364 bool ISD::matchUnaryPredicateImpl(SDValue Op,
392 SDValue, std::function<bool(ConstantSDNode *)>, bool);
394 SDValue, std::function<bool(ConstantFPSDNode *)>, bool);
397 SDValue LHS, SDValue RHS,
416 SDValue LHSOp = LHS.getOperand(i);
417 SDValue RHSOp = RHS.getOperand(i);
730 ArrayRef<SDValue> Ops) {
747 SDVTList VTList, ArrayRef<SDValue> OpList) {
1073 Use.set(SDValue());
1305 SDNode *SelectionDAG::FindModifiedNodeSlot(SDNode *N, SDValue Op,
1310 SDValue Ops[] = { Op };
1325 SDValue Op1, SDValue Op2,
1330 SDValue Ops[] = { Op1, Op2 };
1344 SDNode *SelectionDAG::FindModifiedNodeSlot(SDNode *N, ArrayRef<SDValue> Ops,
1475 SDValue SelectionDAG::getFPExtendOrRound(SDValue Op, const SDLoc &DL, EVT VT) {
1482 std::pair<SDValue, SDValue>
1483 SelectionDAG::getStrictFPExtendOrRound(SDValue Op, SDValue Chain,
1487 SDValue Res =
1493 return std::pair<SDValue, SDValue>(Res, SDValue(Res.getNode(), 1));
1496 SDValue SelectionDAG::getAnyExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT) {
1502 SDValue SelectionDAG::getSExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT) {
1508 SDValue SelectionDAG::getZExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT) {
1514 SDValue SelectionDAG::getBitcastedAnyExtOrTrunc(SDValue Op, const SDLoc &DL,
1518 SDValue DestOp;
1529 SDValue SelectionDAG::getBitcastedSExtOrTrunc(SDValue Op, const SDLoc &DL,
1533 SDValue DestOp;
1544 SDValue SelectionDAG::getBitcastedZExtOrTrunc(SDValue Op, const SDLoc &DL,
1548 SDValue DestOp;
1559 SDValue SelectionDAG::getBoolExtOrTrunc(SDValue Op, const SDLoc &SL, EVT VT,
1568 SDValue SelectionDAG::getZeroExtendInReg(SDValue Op, const SDLoc &DL, EVT VT) {
1586 SDValue SelectionDAG::getVPZeroExtendInReg(SDValue Op, SDValue Mask,
1587 SDValue EVL, const SDLoc &DL,
1605 SDValue SelectionDAG::getPtrExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT) {
1611 SDValue SelectionDAG::getPtrExtendInReg(SDValue Op, const SDLoc &DL, EVT VT) {
1617 SDValue SelectionDAG::getNegative(SDValue Val, const SDLoc &DL, EVT VT) {
1622 SDValue SelectionDAG::getNOT(const SDLoc &DL, SDValue Val, EVT VT) {
1626 SDValue SelectionDAG::getLogicalNOT(const SDLoc &DL, SDValue Val, EVT VT) {
1627 SDValue TrueValue = getBoolConstant(true, DL, VT, VT);
1631 SDValue SelectionDAG::getVPLogicalNOT(const SDLoc &DL, SDValue Val,
1632 SDValue Mask, SDValue EVL, EVT VT) {
1633 SDValue TrueValue = getBoolConstant(true, DL, VT, VT);
1637 SDValue SelectionDAG::getVPPtrExtOrTrunc(const SDLoc &DL, EVT VT, SDValue Op,
1638 SDValue Mask, SDValue EVL) {
1642 SDValue SelectionDAG::getVPZExtOrTrunc(const SDLoc &DL, EVT VT, SDValue Op,
1643 SDValue Mask, SDValue EVL) {
1651 SDValue SelectionDAG::getBoolConstant(bool V, const SDLoc &DL, EVT VT,
1666 SDValue SelectionDAG::getConstant(uint64_t Val, const SDLoc &DL, EVT VT,
1672 SDValue SelectionDAG::getConstant(const APInt &Val, const SDLoc &DL, EVT VT,
1677 SDValue SelectionDAG::getConstant(const ConstantInt &Val, const SDLoc &DL,
1723 SmallVector<SDValue, 2> ScalarParts;
1740 SmallVector<SDValue, 2> EltParts;
1758 SmallVector<SDValue, 8> Ops;
1762 SDValue V =
1779 return SDValue(N, 0);
1785 NewSDValueDbgMsg(SDValue(N, 0), "Creating constant: ", this);
1788 SDValue Result(N, 0);
1794 SDValue SelectionDAG::getSignedConstant(int64_t Val, const SDLoc &DL, EVT VT,
1800 SDValue SelectionDAG::getAllOnesConstant(const SDLoc &DL, EVT VT, bool IsTarget,
1806 SDValue SelectionDAG::getIntPtrConstant(uint64_t Val, const SDLoc &DL,
1811 SDValue SelectionDAG::getShiftAmountConstant(uint64_t Val, EVT VT,
1818 SDValue SelectionDAG::getShiftAmountConstant(const APInt &Val, EVT VT,
1824 SDValue SelectionDAG::getVectorIdxConstant(uint64_t Val, const SDLoc &DL,
1829 SDValue SelectionDAG::getConstantFP(const APFloat &V, const SDLoc &DL, EVT VT,
1834 SDValue SelectionDAG::getConstantFP(const ConstantFP &V, const SDLoc &DL,
1858 return SDValue(N, 0);
1866 SDValue Result(N, 0);
1873 SDValue SelectionDAG::getConstantFP(double Val, const SDLoc &DL, EVT VT,
1891 SDValue SelectionDAG::getGlobalAddress(const GlobalValue *GV, const SDLoc &DL,
1916 return SDValue(E, 0);
1922 return SDValue(N, 0);
1925 SDValue SelectionDAG::getFrameIndex(int FI, EVT VT, bool isTarget) {
1933 return SDValue(E, 0);
1938 return SDValue(N, 0);
1941 SDValue SelectionDAG::getJumpTable(int JTI, EVT VT, bool isTarget,
1953 return SDValue(E, 0);
1958 return SDValue(N, 0);
1961 SDValue SelectionDAG::getJumpTableDebugInfo(int JTI, SDValue Chain,
1968 SDValue SelectionDAG::getConstantPool(const Constant *C, EVT VT,
1987 return SDValue(E, 0);
1993 SDValue V = SDValue(N, 0);
1998 SDValue SelectionDAG::getConstantPool(MachineConstantPoolValue *C, EVT VT,
2015 return SDValue(E, 0);
2021 return SDValue(N, 0);
2024 SDValue SelectionDAG::getBasicBlock(MachineBasicBlock *MBB) {
2030 return SDValue(E, 0);
2035 return SDValue(N, 0);
2038 SDValue SelectionDAG::getValueType(EVT VT) {
2046 if (N) return SDValue(N, 0);
2049 return SDValue(N, 0);
2052 SDValue SelectionDAG::getExternalSymbol(const char *Sym, EVT VT) {
2054 if (N) return SDValue(N, 0);
2057 return SDValue(N, 0);
2060 SDValue SelectionDAG::getMCSymbol(MCSymbol *Sym, EVT VT) {
2063 return SDValue(N, 0);
2066 return SDValue(N, 0);
2069 SDValue SelectionDAG::getTargetExternalSymbol(const char *Sym, EVT VT,
2073 if (N) return SDValue(N, 0);
2076 return SDValue(N, 0);
2079 SDValue SelectionDAG::getCondCode(ISD::CondCode Cond) {
2089 return SDValue(CondCodeNodes[Cond], 0);
2092 SDValue SelectionDAG::getVScale(const SDLoc &DL, EVT VT, APInt MulImm,
2111 SDValue SelectionDAG::getElementCount(const SDLoc &DL, EVT VT, ElementCount EC,
2120 SDValue SelectionDAG::getStepVector(const SDLoc &DL, EVT ResVT) {
2125 SDValue SelectionDAG::getStepVector(const SDLoc &DL, EVT ResVT,
2133 SmallVector<SDValue, 16> OpsStepConstants;
2142 static void commuteShuffle(SDValue &N1, SDValue &N2, MutableArrayRef<int> M) {
2147 SDValue SelectionDAG::getVectorShuffle(EVT VT, const SDLoc &dl, SDValue N1,
2148 SDValue N2, ArrayRef<int> Mask) {
2184 SDValue Splat = BV->getSplatValue(&UndefElements);
2248 SDValue V = N1;
2258 SDValue Splat = BV->getSplatValue(&UndefElements);
2278 const SDValue &Splatted = BV->getOperand(MaskVec[0]);
2279 SDValue NewBV = getSplatBuildVector(BuildVT, dl, Splatted);
2292 SDValue Ops[2] = { N1, N2 };
2299 return SDValue(E, 0);
2313 SDValue V = SDValue(N, 0);
2318 SDValue SelectionDAG::getCommutedVectorShuffle(const ShuffleVectorSDNode &SV) {
2323 SDValue Op0 = SV.getOperand(0);
2324 SDValue Op1 = SV.getOperand(1);
2328 SDValue SelectionDAG::getRegister(Register Reg, EVT VT) {
2335 return SDValue(E, 0);
2341 return SDValue(N, 0);
2344 SDValue SelectionDAG::getRegisterMask(const uint32_t *RegMask) {
2350 return SDValue(E, 0);
2355 return SDValue(N, 0);
2358 SDValue SelectionDAG::getEHLabel(const SDLoc &dl, SDValue Root,
2363 SDValue SelectionDAG::getLabelNode(unsigned Opcode, const SDLoc &dl,
2364 SDValue Root, MCSymbol *Label) {
2366 SDValue Ops[] = { Root };
2371 return SDValue(E, 0);
2379 return SDValue(N, 0);
2382 SDValue SelectionDAG::getBlockAddress(const BlockAddress *BA, EVT VT,
2395 return SDValue(E, 0);
2400 return SDValue(N, 0);
2403 SDValue SelectionDAG::getSrcValue(const Value *V) {
2410 return SDValue(E, 0);
2415 return SDValue(N, 0);
2418 SDValue SelectionDAG::getMDNode(const MDNode *MD) {
2425 return SDValue(E, 0);
2430 return SDValue(N, 0);
2433 SDValue SelectionDAG::getBitcast(EVT VT, SDValue V) {
2440 SDValue SelectionDAG::getAddrSpaceCast(const SDLoc &dl, EVT VT, SDValue Ptr,
2443 SDValue Ops[] = {Ptr};
2451 return SDValue(E, 0);
2459 return SDValue(N, 0);
2462 SDValue SelectionDAG::getFreeze(SDValue V) {
2468 SDValue SelectionDAG::getShiftAmountOperand(EVT LHSTy, SDValue Op) {
2476 SDValue SelectionDAG::getPartialReduceAdd(SDLoc DL, EVT ReducedTy, SDValue Op1,
2477 SDValue Op2) {
2484 std::deque<SDValue> Subvectors = {Op1};
2514 for (SDValue Op : StoreNode->ops())
2540 for (SDValue Op : Node->ops())
2551 RTLIB::Libcall LC, SDNode *Node, SmallVectorImpl<SDValue> &Results,
2578 SDValue StoresInChain;
2584 SDValue StoreValue = ST->getValue();
2610 auto AddArgListEntry = [&](SDValue Node, Type *Ty) {
2618 for (const SDValue &Op : Node->op_values()) {
2625 SmallVector<SDValue, 2> ResultPtrs(NumResults);
2631 SDValue ResultPtr = ST ? ST->getBasePtr() : CreateStackTemporary(ResVT);
2641 SDValue Mask = getBoolConstant(true, DL, MaskVT, VT);
2648 SDValue InChain = StoresInChain ? StoresInChain : getEntryNode();
2649 SDValue Callee = getExternalSymbol(VD ? VD->getVectorFnName().data() : LCName,
2665 ReplaceAllUsesOfValueWith(SDValue(ST, 0), CallChain);
2671 SDValue LoadResult =
2685 SDValue NewRoot =
2695 SDValue SelectionDAG::expandVAArg(SDNode *Node) {
2700 SDValue Tmp1 = Node->getOperand(0);
2701 SDValue Tmp2 = Node->getOperand(1);
2704 SDValue VAListLoad = getLoad(TLI.getPointerTy(getDataLayout()), dl, Tmp1,
2706 SDValue VAList = VAListLoad;
2729 SDValue SelectionDAG::expandVACopy(SDNode *Node) {
2736 SDValue Tmp1 =
2776 SDValue SelectionDAG::CreateStackTemporary(TypeSize Bytes, Align Alignment) {
2789 SDValue SelectionDAG::CreateStackTemporary(EVT VT, unsigned minAlign) {
2796 SDValue SelectionDAG::CreateStackTemporary(EVT VT1, EVT VT2) {
2813 SDValue SelectionDAG::FoldSetCC(EVT VT, SDValue N1, SDValue N2,
2942 return SDValue();
2964 return SDValue();
2969 bool SelectionDAG::SignBitIsZero(SDValue Op, unsigned Depth) const {
2977 bool SelectionDAG::MaskedValueIsZero(SDValue V, const APInt &Mask,
2985 bool SelectionDAG::MaskedValueIsZero(SDValue V, const APInt &Mask,
2993 bool SelectionDAG::MaskedVectorIsZero(SDValue V, const APInt &DemandedElts,
2999 bool SelectionDAG::MaskedValueIsAllOnes(SDValue V, const APInt &Mask,
3004 APInt SelectionDAG::computeVectorKnownZeroElements(SDValue Op,
3029 bool SelectionDAG::isSplatValue(SDValue V, const APInt &DemandedElts,
3057 SDValue LHS = V.getOperand(0);
3058 SDValue RHS = V.getOperand(1);
3090 SDValue Scl;
3092 SDValue Op = V.getOperand(i);
3133 auto CheckSplatSrc = [&](SDValue Src, const APInt &SrcElts) {
3145 SDValue Src = V.getOperand(0);
3163 SDValue Src = V.getOperand(0);
3177 SDValue Src = V.getOperand(0);
3215 bool SelectionDAG::isSplatValue(SDValue V, bool AllowUndefs) const {
3229 SDValue SelectionDAG::getSplatSourceVector(SDValue V, int &SplatIdx) {
3278 return SDValue();
3281 SDValue SelectionDAG::getSplatValue(SDValue V, bool LegalTypes) {
3283 if (SDValue SrcVector = getSplatSourceVector(V, SplatIdx)) {
3288 return SDValue();
3291 return SDValue();
3296 return SDValue();
3300 SelectionDAG::getValidShiftAmountRange(SDValue V, const APInt &DemandedElts,
3349 SelectionDAG::getValidShiftAmount(SDValue V, const APInt &DemandedElts,
3362 SelectionDAG::getValidShiftAmount(SDValue V, unsigned Depth) const {
3371 SelectionDAG::getValidMinimumShiftAmount(SDValue V, const APInt &DemandedElts,
3383 SelectionDAG::getValidMinimumShiftAmount(SDValue V, unsigned Depth) const {
3392 SelectionDAG::getValidMaximumShiftAmount(SDValue V, const APInt &DemandedElts,
3404 SelectionDAG::getValidMaximumShiftAmount(SDValue V, unsigned Depth) const {
3415 KnownBits SelectionDAG::computeKnownBits(SDValue Op, unsigned Depth) const {
3430 KnownBits SelectionDAG::computeKnownBits(SDValue Op, const APInt &DemandedElts,
3463 SDValue SrcOp = Op.getOperand(0);
3515 SDValue SrcOp = Op.getOperand(i);
3547 SDValue LHS = Op.getOperand(0);
3555 SDValue RHS = Op.getOperand(1);
3579 SDValue Sub = Op.getOperand(i);
3594 SDValue Src = Op.getOperand(0);
3595 SDValue Sub = Op.getOperand(1);
3617 SDValue Src = Op.getOperand(0);
3635 SDValue N0 = Op.getOperand(0);
3646 SDValue N0 = Op.getOperand(0);
4292 SDValue InVec = Op.getOperand(0);
4293 SDValue EltNo = Op.getOperand(1);
4326 SDValue InVec = Op.getOperand(0);
4327 SDValue InVal = Op.getOperand(1);
4328 SDValue EltNo = Op.getOperand(2);
4534 SelectionDAG::computeOverflowForSignedAdd(SDValue N0, SDValue N1) const {
4549 SelectionDAG::computeOverflowForUnsignedAdd(SDValue N0, SDValue N1) const {
4572 SelectionDAG::computeOverflowForSignedSub(SDValue N0, SDValue N1) const {
4590 SelectionDAG::computeOverflowForUnsignedSub(SDValue N0, SDValue N1) const {
4603 SelectionDAG::computeOverflowForUnsignedMul(SDValue N0, SDValue N1) const {
4616 SelectionDAG::computeOverflowForSignedMul(SDValue N0, SDValue N1) const {
4645 bool SelectionDAG::isKnownToBeAPowerOfTwo(SDValue Val, unsigned Depth) const {
4683 if (llvm::all_of(Val->ops(), [BitWidth](SDValue E) {
4717 SDValue X;
4729 bool SelectionDAG::isKnownToBeAPowerOfTwoFP(SDValue Val, unsigned Depth) const {
4739 unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, unsigned Depth) const {
4751 unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, const APInt &DemandedElts,
4798 SDValue SrcOp = Op.getOperand(i);
4845 SDValue N0 = Op.getOperand(0);
4904 SDValue Src = Op.getOperand(0);
4928 SDValue Ext = Op.getOperand(0);
4930 SDValue Extendee = Ext.getOperand(0);
5173 SDValue InVec = Op.getOperand(0);
5174 SDValue InVal = Op.getOperand(1);
5175 SDValue EltNo = Op.getOperand(2);
5201 SDValue InVec = Op.getOperand(0);
5202 SDValue EltNo = Op.getOperand(1);
5229 SDValue Src = Op.getOperand(0);
5263 SDValue Src = Op.getOperand(0);
5264 SDValue Sub = Op.getOperand(1);
5417 unsigned SelectionDAG::ComputeMaxSignificantBits(SDValue Op,
5423 unsigned SelectionDAG::ComputeMaxSignificantBits(SDValue Op,
5430 bool SelectionDAG::isGuaranteedNotToBeUndefOrPoison(SDValue Op, bool PoisonOnly,
5443 bool SelectionDAG::isGuaranteedNotToBeUndefOrPoison(SDValue Op,
5524 all_of(Op->ops(), [&](SDValue V) {
5529 bool SelectionDAG::canCreateUndefOrPoison(SDValue Op, bool PoisonOnly,
5540 bool SelectionDAG::canCreateUndefOrPoison(SDValue Op, const APInt &DemandedElts,
5626 SDValue Idx = Op.getOperand(Opcode == ISD::INSERT_VECTOR_ELT ? 2 : 1);
5657 bool SelectionDAG::isADDLike(SDValue Op, bool NoWrap) const {
5667 bool SelectionDAG::isBaseWithConstantOffset(SDValue Op) const {
5672 bool SelectionDAG::isKnownNeverNaN(SDValue Op, bool SNaN, unsigned Depth) const {
5788 for (const SDValue &Opnd : Op->ops())
5805 bool SelectionDAG::isKnownNeverZeroFloat(SDValue Op) const {
5814 bool SelectionDAG::isKnownNeverZero(SDValue Op, unsigned Depth) const {
5968 bool SelectionDAG::cannotBeOrderedNegativeFP(SDValue Op) const {
5975 bool SelectionDAG::isEqualTo(SDValue A, SDValue B) const {
5989 SDValue llvm::getBitwiseNotOperand(SDValue V, SDValue Mask, bool AllowUndefs) {
5997 return SDValue();
5998 SDValue ExtArg = V.getOperand(0);
6005 return SDValue();
6008 static bool haveNoCommonBitsSetCommutative(SDValue A, SDValue B) {
6011 auto MatchNoCommonBitsPattern = [&](SDValue Not, SDValue Mask,
6012 SDValue Other) {
6013 if (SDValue NotOperand =
6041 bool SelectionDAG::haveNoCommonBitsSet(SDValue A, SDValue B) const {
6051 static SDValue FoldSTEP_VECTOR(const SDLoc &DL, EVT VT, SDValue Step,
6056 return SDValue();
6059 static SDValue FoldBUILD_VECTOR(const SDLoc &DL, EVT VT,
6060 ArrayRef<SDValue> Ops,
6070 if (llvm::all_of(Ops, [](SDValue Op) { return Op.isUndef(); }))
6074 SDValue IdentitySrc;
6090 return SDValue();
6095 static SDValue foldCONCAT_VECTORS(const SDLoc &DL, EVT VT,
6096 ArrayRef<SDValue> Ops,
6100 [Ops](SDValue Op) {
6112 if (llvm::all_of(Ops, [](SDValue Op) { return Op.isUndef(); }))
6118 SDValue IdentitySrc;
6121 SDValue Op = Ops[i];
6142 return SDValue();
6148 SmallVector<SDValue, 16> Elts;
6149 for (SDValue Op : Ops) {
6156 return SDValue();
6161 for (SDValue Op : Elts)
6165 for (SDValue &Op : Elts) {
6175 SDValue V = DAG.getBuildVector(VT, DL, Elts);
6181 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT) {
6187 return SDValue(E, 0);
6193 SDValue V = SDValue(N, 0);
6198 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
6199 SDValue N1) {
6206 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
6207 SDValue N1, const SDNodeFlags Flags) {
6244 SDValue Ops = {N1};
6245 if (SDValue Fold = FoldConstantArithmetic(Opcode, DL, VT, Ops))
6271 SDValue Ops[] = {N1};
6272 if (SDValue V = FoldBUILD_VECTOR(DL, VT, Ops, *this))
6345 SDValue OpOp = N1.getOperand(0);
6383 SDValue OpOp = N1.getOperand(0);
6527 SDValue Ops[] = {N1};
6534 return SDValue(E, 0);
6547 SDValue V = SDValue(N, 0);
6627 SDValue SelectionDAG::FoldSymbolOffset(unsigned Opcode, EVT VT,
6631 return SDValue();
6633 return SDValue();
6636 return SDValue();
6641 default: return SDValue();
6647 bool SelectionDAG::isUndef(unsigned Opcode, ArrayRef<SDValue> Ops) {
6656 SDValue Divisor = Ops[1];
6662 [](SDValue V) { return V.isUndef() ||
6672 SDValue SelectionDAG::FoldConstantArithmetic(unsigned Opcode, const SDLoc &DL,
6673 EVT VT, ArrayRef<SDValue> Ops,
6682 return SDValue();
6686 return SDValue();
6693 SDValue N1 = Ops[0];
6761 if (SDValue V = FoldSTEP_VECTOR(DL, VT, N1, *this))
6791 return SDValue();
6797 return SDValue();
6803 return SDValue();
6852 return SDValue();
6857 if (SDValue CFP = foldConstantFPMath(Opcode, DL, VT, Ops))
6863 return SDValue();
6868 return SDValue();
6870 SDValue Folded = getConstant(*FoldAttempt, DL, VT);
6901 SmallVector<SDValue, 8> ScalarOps;
6904 SDValue Op = Ops[0].getOperand(I);
6925 return SDValue();
6934 SDValue N1 = peekThroughBitcasts(Ops[0]);
6935 SDValue N2 = peekThroughBitcasts(Ops[1]);
6971 SmallVector<SDValue> Ops(DstBits.size(), getUNDEF(BVEltVT));
6996 auto IsScalarOrSameVectorSize = [NumElts](const SDValue &Op) {
7001 auto IsBuildVectorSplatVectorOrUndef = [](const SDValue &Op) {
7012 return SDValue();
7029 return SDValue();
7038 SmallVector<SDValue, 4> ScalarResults;
7040 SmallVector<SDValue, 4> ScalarOps;
7041 for (SDValue Op : Ops) {
7052 SDValue ScalarOp =
7067 return SDValue();
7075 SDValue ScalarResult = getNode(Opcode, DL, SVT, ScalarOps, Flags);
7080 return SDValue();
7091 SDValue V = NumElts.isScalable() ? getSplatVector(VT, DL, ScalarResults[0])
7097 SDValue SelectionDAG::foldConstantFPMath(unsigned Opcode, const SDLoc &DL,
7098 EVT VT, ArrayRef<SDValue> Ops) {
7101 return SDValue();
7107 SDValue N1 = Ops[0];
7108 SDValue N2 = Ops[1];
7177 return SDValue();
7180 SDValue SelectionDAG::getAssertAlign(const SDLoc &DL, SDValue Val, Align A) {
7195 return SDValue(E, 0);
7204 SDValue V(N, 0);
7209 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
7210 SDValue N1, SDValue N2) {
7217 void SelectionDAG::canonicalizeCommutativeBinop(unsigned Opcode, SDValue &N1,
7218 SDValue &N2) const {
7238 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
7239 SDValue N1, SDValue N2, const SDNodeFlags Flags) {
7266 SDValue Ops[] = {N1, N2};
7267 if (SDValue V = FoldBUILD_VECTOR(DL, VT, Ops, *this))
7272 SDValue Ops[] = {N1, N2};
7273 if (SDValue V = foldCONCAT_VECTORS(DL, VT, Ops, *this))
7388 if (SDValue V = simplifyFPBinop(Opcode, N1, N2, Flags))
7406 if (SDValue V = simplifyShift(N1, N2))
7522 SDValue Elt = N1.getOperand(Index);
7539 SDValue N1Op2 = N1.getOperand(2);
7638 if (SDValue SV = FoldConstantArithmetic(Opcode, DL, VT, {N1, N2}, Flags))
7692 SDValue Ops[] = {N1, N2};
7699 return SDValue(E, 0);
7712 SDValue V = SDValue(N, 0);
7717 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
7718 SDValue N1, SDValue N2, SDValue N3) {
7725 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
7726 SDValue N1, SDValue N2, SDValue N3,
7757 SDValue Ops[] = {N1, N2, N3};
7758 if (SDValue V = FoldBUILD_VECTOR(DL, VT, Ops, *this))
7763 SDValue Ops[] = {N1, N2, N3};
7764 if (SDValue V = foldCONCAT_VECTORS(DL, VT, Ops, *this))
7778 if (SDValue V = FoldSetCC(VT, N1, N2, cast<CondCodeSDNode>(N3)->get(), DL))
7781 SDValue Ops[] = {N1, N2, N3};
7782 if (SDValue V = FoldConstantArithmetic(Opcode, DL, VT, Ops)) {
7790 if (SDValue V = simplifySelect(N1, N2, N3))
7890 SDValue Ops[] = {N1, N2, N3};
7897 return SDValue(E, 0);
7910 SDValue V = SDValue(N, 0);
7915 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
7916 SDValue N1, SDValue N2, SDValue N3, SDValue N4,
7918 SDValue Ops[] = { N1, N2, N3, N4 };
7922 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
7923 SDValue N1, SDValue N2, SDValue N3, SDValue N4) {
7930 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
7931 SDValue N1, SDValue N2, SDValue N3, SDValue N4,
7932 SDValue N5, const SDNodeFlags Flags) {
7933 SDValue Ops[] = { N1, N2, N3, N4, N5 };
7937 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
7938 SDValue N1, SDValue N2, SDValue N3, SDValue N4,
7939 SDValue N5) {
7948 SDValue SelectionDAG::getStackArgumentTokenFactor(SDValue Chain) {
7949 SmallVector<SDValue, 8> ArgChains;
7961 ArgChains.push_back(SDValue(L, 1));
7969 static SDValue getMemsetValue(SDValue Value, EVT VT, SelectionDAG &DAG,
8010 static SDValue getMemsetStringVal(EVT VT, const SDLoc &dl, SelectionDAG &DAG,
8049 return SDValue();
8052 SDValue SelectionDAG::getMemBasePlusOffset(SDValue Base, TypeSize Offset,
8056 SDValue Index;
8068 SDValue SelectionDAG::getMemBasePlusOffset(SDValue Ptr, SDValue Offset,
8077 static bool isMemSrcFromConstant(SDValue Src, ConstantDataArraySlice &Slice) {
8105 SmallVector<SDValue, 32> &OutChains, unsigned From,
8106 unsigned To, SmallVector<SDValue, 16> &OutLoadChains,
8107 SmallVector<SDValue, 16> &OutStoreChains) {
8110 SmallVector<SDValue, 16> GluedLoadChains;
8117 SDValue LoadToken = DAG.getNode(ISD::TokenFactor, dl, MVT::Other,
8122 SDValue NewStore = DAG.getTruncStore(LoadToken, dl, ST->getValue(),
8129 static SDValue getMemcpyLoadsAndStores(
8130 SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, SDValue Dst, SDValue Src,
8171 return SDValue();
8204 SmallVector<SDValue, 16> OutLoadChains;
8205 SmallVector<SDValue, 16> OutStoreChains;
8206 SmallVector<SDValue, 32> OutChains;
8212 SDValue Value, Store;
8330 static SDValue getMemmoveLoadsAndStores(SelectionDAG &DAG, const SDLoc &dl,
8331 SDValue Chain, SDValue Dst, SDValue Src,
8366 return SDValue();
8395 SmallVector<SDValue, 8> LoadValues;
8396 SmallVector<SDValue, 8> LoadChains;
8397 SmallVector<SDValue, 8> OutChains;
8402 SDValue Value;
8423 SDValue Store;
8450 /// SDValue otherwise.
8455 static SDValue getMemsetStores(SelectionDAG &DAG, const SDLoc &dl,
8456 SDValue Chain, SDValue Dst, SDValue Src,
8483 return SDValue();
8506 SmallVector<SDValue, 8> OutChains;
8515 SDValue MemSetValue = getMemsetValue(Src, LargestVT, DAG, dl);
8534 SDValue Value = MemSetValue;
8550 SDValue TailValue = DAG.getNode(ISD::BITCAST, dl, SVT, MemSetValue);
8557 SDValue Store = DAG.getStore(
8581 SDValue SelectionDAG::getMemcpy(
8582 SDValue Chain, const SDLoc &dl, SDValue Dst, SDValue Src, SDValue Size,
8595 SDValue Result = getMemcpyLoadsAndStores(
8605 SDValue Result = TSI->EmitTargetCodeForMemcpy(
8663 std::pair<SDValue,SDValue> CallResult = TLI->LowerCallTo(CLI);
8667 SDValue SelectionDAG::getAtomicMemcpy(SDValue Chain, const SDLoc &dl,
8668 SDValue Dst, SDValue Src, SDValue Size,
8703 std::pair<SDValue, SDValue> CallResult = TLI->LowerCallTo(CLI);
8707 SDValue SelectionDAG::getMemmove(SDValue Chain, const SDLoc &dl, SDValue Dst,
8708 SDValue Src, SDValue Size, Align Alignment,
8723 SDValue Result = getMemmoveLoadsAndStores(
8733 SDValue Result =
8780 std::pair<SDValue,SDValue> CallResult = TLI->LowerCallTo(CLI);
8784 SDValue SelectionDAG::getAtomicMemmove(SDValue Chain, const SDLoc &dl,
8785 SDValue Dst, SDValue Src, SDValue Size,
8820 std::pair<SDValue, SDValue> CallResult = TLI->LowerCallTo(CLI);
8824 SDValue SelectionDAG::getMemset(SDValue Chain, const SDLoc &dl, SDValue Dst,
8825 SDValue Src, SDValue Size, Align Alignment,
8838 SDValue Result = getMemsetStores(*this, dl, Chain, Dst, Src,
8849 SDValue Result = TSI->EmitTargetCodeForMemset(
8859 SDValue Result = getMemsetStores(*this, dl, Chain, Dst, Src,
8880 const auto CreateEntry = [](SDValue Node, Type *Ty) {
8918 std::pair<SDValue, SDValue> CallResult = TLI->LowerCallTo(CLI);
8922 SDValue SelectionDAG::getAtomicMemset(SDValue Chain, const SDLoc &dl,
8923 SDValue Dst, SDValue Value, SDValue Size,
8958 std::pair<SDValue, SDValue> CallResult = TLI->LowerCallTo(CLI);
8962 SDValue SelectionDAG::getAtomic(unsigned Opcode, const SDLoc &dl, EVT MemVT,
8963 SDVTList VTList, ArrayRef<SDValue> Ops,
8973 return SDValue(E, 0);
8982 return SDValue(N, 0);
8985 SDValue SelectionDAG::getAtomicCmpSwap(unsigned Opcode, const SDLoc &dl,
8986 EVT MemVT, SDVTList VTs, SDValue Chain,
8987 SDValue Ptr, SDValue Cmp, SDValue Swp,
8993 SDValue Ops[] = {Chain, Ptr, Cmp, Swp};
8997 SDValue SelectionDAG::getAtomic(unsigned Opcode, const SDLoc &dl, EVT MemVT,
8998 SDValue Chain, SDValue Ptr, SDValue Val,
9019 SDValue Ops[] = {Chain, Ptr, Val};
9023 SDValue SelectionDAG::getAtomic(unsigned Opcode, const SDLoc &dl, EVT MemVT,
9024 EVT VT, SDValue Chain, SDValue Ptr,
9029 SDValue Ops[] = {Chain, Ptr};
9034 SDValue SelectionDAG::getMergeValues(ArrayRef<SDValue> Ops, const SDLoc &dl) {
9040 for (const SDValue &Op : Ops)
9045 SDValue SelectionDAG::getMemIntrinsicNode(
9046 unsigned Opcode, const SDLoc &dl, SDVTList VTList, ArrayRef<SDValue> Ops,
9060 SDValue SelectionDAG::getMemIntrinsicNode(unsigned Opcode, const SDLoc &dl,
9062 ArrayRef<SDValue> Ops, EVT MemVT,
9084 return SDValue(E, 0);
9098 SDValue V(N, 0);
9103 SDValue SelectionDAG::getLifetimeNode(bool IsStart, const SDLoc &dl,
9104 SDValue Chain, int FrameIndex,
9108 SDValue Ops[2] = {
9121 return SDValue(E, 0);
9128 SDValue V(N, 0);
9133 SDValue SelectionDAG::getPseudoProbeNode(const SDLoc &Dl, SDValue Chain,
9138 SDValue Ops[] = {Chain};
9145 return SDValue(E, 0);
9152 SDValue V(N, 0);
9162 SelectionDAG &DAG, SDValue Ptr,
9186 SelectionDAG &DAG, SDValue Ptr,
9187 SDValue OffsetOp) {
9196 SDValue SelectionDAG::getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType,
9197 EVT VT, const SDLoc &dl, SDValue Chain,
9198 SDValue Ptr, SDValue Offset,
9220 SDValue SelectionDAG::getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType,
9221 EVT VT, const SDLoc &dl, SDValue Chain,
9222 SDValue Ptr, SDValue Offset, EVT MemVT,
9246 SDValue Ops[] = { Chain, Ptr, Offset };
9257 return SDValue(E, 0);
9265 SDValue V(N, 0);
9270 SDValue SelectionDAG::getLoad(EVT VT, const SDLoc &dl, SDValue Chain,
9271 SDValue Ptr, MachinePointerInfo PtrInfo,
9275 SDValue Undef = getUNDEF(Ptr.getValueType());
9280 SDValue SelectionDAG::getLoad(EVT VT, const SDLoc &dl, SDValue Chain,
9281 SDValue Ptr, MachineMemOperand *MMO) {
9282 SDValue Undef = getUNDEF(Ptr.getValueType());
9287 SDValue SelectionDAG::getExtLoad(ISD::LoadExtType ExtType, const SDLoc &dl,
9288 EVT VT, SDValue Chain, SDValue Ptr,
9293 SDValue Undef = getUNDEF(Ptr.getValueType());
9298 SDValue SelectionDAG::getExtLoad(ISD::LoadExtType ExtType, const SDLoc &dl,
9299 EVT VT, SDValue Chain, SDValue Ptr, EVT MemVT,
9301 SDValue Undef = getUNDEF(Ptr.getValueType());
9306 SDValue SelectionDAG::getIndexedLoad(SDValue OrigLoad, const SDLoc &dl,
9307 SDValue Base, SDValue Offset,
9320 SDValue SelectionDAG::getStore(SDValue Chain, const SDLoc &dl, SDValue Val,
9321 SDValue Ptr, MachinePointerInfo PtrInfo,
9340 SDValue SelectionDAG::getStore(SDValue Chain, const SDLoc &dl, SDValue Val,
9341 SDValue Ptr, MachineMemOperand *MMO) {
9346 SDValue Undef = getUNDEF(Ptr.getValueType());
9347 SDValue Ops[] = { Chain, Val, Ptr, Undef };
9358 return SDValue(E, 0);
9366 SDValue V(N, 0);
9371 SDValue SelectionDAG::getTruncStore(SDValue Chain, const SDLoc &dl, SDValue Val,
9372 SDValue Ptr, MachinePointerInfo PtrInfo,
9392 SDValue SelectionDAG::getTruncStore(SDValue Chain, const SDLoc &dl, SDValue Val,
9393 SDValue Ptr, EVT SVT,
9413 SDValue Undef = getUNDEF(Ptr.getValueType());
9414 SDValue Ops[] = { Chain, Val, Ptr, Undef };
9425 return SDValue(E, 0);
9433 SDValue V(N, 0);
9438 SDValue SelectionDAG::getIndexedStore(SDValue OrigStore, const SDLoc &dl,
9439 SDValue Base, SDValue Offset,
9444 SDValue Ops[] = { ST->getChain(), ST->getValue(), Base, Offset };
9453 return SDValue(E, 0);
9462 SDValue V(N, 0);
9467 SDValue SelectionDAG::getLoadVP(
9469 SDValue Chain, SDValue Ptr, SDValue Offset, SDValue Mask, SDValue EVL,
9490 SDValue SelectionDAG::getLoadVP(ISD::MemIndexedMode AM,
9492 const SDLoc &dl, SDValue Chain, SDValue Ptr,
9493 SDValue Offset, SDValue Mask, SDValue EVL,
9501 SDValue Ops[] = {Chain, Ptr, Offset, Mask, EVL};
9512 return SDValue(E, 0);
9520 SDValue V(N, 0);
9525 SDValue SelectionDAG::getLoadVP(EVT VT, const SDLoc &dl, SDValue Chain,
9526 SDValue Ptr, SDValue Mask, SDValue EVL,
9532 SDValue Undef = getUNDEF(Ptr.getValueType());
9538 SDValue SelectionDAG::getLoadVP(EVT VT, const SDLoc &dl, SDValue Chain,
9539 SDValue Ptr, SDValue Mask, SDValue EVL,
9541 SDValue Undef = getUNDEF(Ptr.getValueType());
9546 SDValue SelectionDAG::getExtLoadVP(ISD::LoadExtType ExtType, const SDLoc &dl,
9547 EVT VT, SDValue Chain, SDValue Ptr,
9548 SDValue Mask, SDValue EVL,
9553 SDValue Undef = getUNDEF(Ptr.getValueType());
9559 SDValue SelectionDAG::getExtLoadVP(ISD::LoadExtType ExtType, const SDLoc &dl,
9560 EVT VT, SDValue Chain, SDValue Ptr,
9561 SDValue Mask, SDValue EVL, EVT MemVT,
9563 SDValue Undef = getUNDEF(Ptr.getValueType());
9568 SDValue SelectionDAG::getIndexedLoadVP(SDValue OrigLoad, const SDLoc &dl,
9569 SDValue Base, SDValue Offset,
9584 SDValue SelectionDAG::getStoreVP(SDValue Chain, const SDLoc &dl, SDValue Val,
9585 SDValue Ptr, SDValue Offset, SDValue Mask,
9586 SDValue EVL, EVT MemVT, MachineMemOperand *MMO,
9594 SDValue Ops[] = {Chain, Val, Ptr, Offset, Mask, EVL};
9605 return SDValue(E, 0);
9613 SDValue V(N, 0);
9618 SDValue SelectionDAG::getTruncStoreVP(SDValue Chain, const SDLoc &dl,
9619 SDValue Val, SDValue Ptr, SDValue Mask,
9620 SDValue EVL, MachinePointerInfo PtrInfo,
9641 SDValue SelectionDAG::getTruncStoreVP(SDValue Chain, const SDLoc &dl,
9642 SDValue Val, SDValue Ptr, SDValue Mask,
9643 SDValue EVL, EVT SVT,
9664 SDValue Undef = getUNDEF(Ptr.getValueType());
9665 SDValue Ops[] = {Chain, Val, Ptr, Undef, Mask, EVL};
9676 return SDValue(E, 0);
9685 SDValue V(N, 0);
9690 SDValue SelectionDAG::getIndexedStoreVP(SDValue OrigStore, const SDLoc &dl,
9691 SDValue Base, SDValue Offset,
9696 SDValue Ops[] = {ST->getChain(), ST->getValue(), Base,
9706 return SDValue(E, 0);
9715 SDValue V(N, 0);
9720 SDValue SelectionDAG::getStridedLoadVP(
9722 SDValue Chain, SDValue Ptr, SDValue Offset, SDValue Stride, SDValue Mask,
9723 SDValue EVL, EVT MemVT, MachineMemOperand *MMO, bool IsExpanding) {
9727 SDValue Ops[] = {Chain, Ptr, Offset, Stride, Mask, EVL};
9740 return SDValue(E, 0);
9749 SDValue V(N, 0);
9754 SDValue SelectionDAG::getStridedLoadVP(EVT VT, const SDLoc &DL, SDValue Chain,
9755 SDValue Ptr, SDValue Stride,
9756 SDValue Mask, SDValue EVL,
9759 SDValue Undef = getUNDEF(Ptr.getValueType());
9764 SDValue SelectionDAG::getExtStridedLoadVP(
9765 ISD::LoadExtType ExtType, const SDLoc &DL, EVT VT, SDValue Chain,
9766 SDValue Ptr, SDValue Stride, SDValue Mask, SDValue EVL, EVT MemVT,
9768 SDValue Undef = getUNDEF(Ptr.getValueType());
9773 SDValue SelectionDAG::getStridedStoreVP(SDValue Chain, const SDLoc &DL,
9774 SDValue Val, SDValue Ptr,
9775 SDValue Offset, SDValue Stride,
9776 SDValue Mask, SDValue EVL, EVT MemVT,
9785 SDValue Ops[] = {Chain, Val, Ptr, Offset, Stride, Mask, EVL};
9795 return SDValue(E, 0);
9804 SDValue V(N, 0);
9809 SDValue SelectionDAG::getTruncStridedStoreVP(SDValue Chain, const SDLoc &DL,
9810 SDValue Val, SDValue Ptr,
9811 SDValue Stride, SDValue Mask,
9812 SDValue EVL, EVT SVT,
9833 SDValue Undef = getUNDEF(Ptr.getValueType());
9834 SDValue Ops[] = {Chain, Val, Ptr, Undef, Stride, Mask, EVL};
9844 return SDValue(E, 0);
9853 SDValue V(N, 0);
9858 SDValue SelectionDAG::getGatherVP(SDVTList VTs, EVT VT, const SDLoc &dl,
9859 ArrayRef<SDValue> Ops, MachineMemOperand *MMO,
9873 return SDValue(E, 0);
9896 SDValue V(N, 0);
9901 SDValue SelectionDAG::getScatterVP(SDVTList VTs, EVT VT, const SDLoc &dl,
9902 ArrayRef<SDValue> Ops,
9917 return SDValue(E, 0);
9940 SDValue V(N, 0);
9945 SDValue SelectionDAG::getMaskedLoad(EVT VT, const SDLoc &dl, SDValue Chain,
9946 SDValue Base, SDValue Offset, SDValue Mask,
9947 SDValue PassThru, EVT MemVT,
9956 SDValue Ops[] = {Chain, Base, Offset, Mask, PassThru};
9967 return SDValue(E, 0);
9975 SDValue V(N, 0);
9980 SDValue SelectionDAG::getIndexedMaskedLoad(SDValue OrigLoad, const SDLoc &dl,
9981 SDValue Base, SDValue Offset,
9991 SDValue SelectionDAG::getMaskedStore(SDValue Chain, const SDLoc &dl,
9992 SDValue Val, SDValue Base, SDValue Offset,
9993 SDValue Mask, EVT MemVT,
10004 SDValue Ops[] = {Chain, Val, Base, Offset, Mask};
10015 return SDValue(E, 0);
10024 SDValue V(N, 0);
10029 SDValue SelectionDAG::getIndexedMaskedStore(SDValue OrigStore, const SDLoc &dl,
10030 SDValue Base, SDValue Offset,
10040 SDValue SelectionDAG::getMaskedGather(SDVTList VTs, EVT MemVT, const SDLoc &dl,
10041 ArrayRef<SDValue> Ops,
10057 return SDValue(E, 0);
10082 SDValue V(N, 0);
10087 SDValue SelectionDAG::getMaskedScatter(SDVTList VTs, EVT MemVT, const SDLoc &dl,
10088 ArrayRef<SDValue> Ops,
10104 return SDValue(E, 0);
10128 SDValue V(N, 0);
10133 SDValue SelectionDAG::getMaskedHistogram(SDVTList VTs, EVT MemVT,
10134 const SDLoc &dl, ArrayRef<SDValue> Ops,
10149 return SDValue(E, 0);
10166 SDValue V(N, 0);
10171 SDValue SelectionDAG::getGetFPEnv(SDValue Chain, const SDLoc &dl, SDValue Ptr,
10175 SDValue Ops[] = {Chain, Ptr};
10185 return SDValue(E, 0);
10193 SDValue V(N, 0);
10198 SDValue SelectionDAG::getSetFPEnv(SDValue Chain, const SDLoc &dl, SDValue Ptr,
10202 SDValue Ops[] = {Chain, Ptr};
10212 return SDValue(E, 0);
10220 SDValue V(N, 0);
10225 SDValue SelectionDAG::simplifySelect(SDValue Cond, SDValue T, SDValue F) {
10245 return SDValue();
10248 SDValue SelectionDAG::simplifyShift(SDValue X, SDValue Y) {
10273 return SDValue();
10276 SDValue SelectionDAG::simplifyFPBinop(unsigned Opcode, SDValue X, SDValue Y,
10295 return SDValue();
10318 return SDValue();
10321 SDValue SelectionDAG::getVAArg(EVT VT, const SDLoc &dl, SDValue Chain,
10322 SDValue Ptr, SDValue SV, unsigned Align) {
10323 SDValue Ops[] = { Chain, Ptr, SV, getTargetConstant(Align, dl, MVT::i32) };
10327 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
10331 case 1: return getNode(Opcode, DL, VT, static_cast<const SDValue>(Ops[0]));
10337 // Copy from an SDUse array into an SDValue array for use with
10339 SmallVector<SDValue, 8> NewOps(Ops);
10343 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
10344 ArrayRef<SDValue> Ops) {
10351 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
10352 ArrayRef<SDValue> Ops, const SDNodeFlags Flags) {
10372 if (SDValue V = FoldBUILD_VECTOR(DL, VT, Ops, *this))
10376 if (SDValue V = foldCONCAT_VECTORS(DL, VT, Ops, *this))
10446 return SDValue(E, 0);
10460 SDValue V(N, 0);
10465 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL,
10466 ArrayRef<EVT> ResultTys, ArrayRef<SDValue> Ops) {
10470 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
10471 ArrayRef<SDValue> Ops) {
10478 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
10479 ArrayRef<SDValue> Ops, const SDNodeFlags Flags) {
10500 SDValue N1 = Ops[0], N2 = Ops[1];
10507 SDValue ZeroOverFlow = getConstant(0, DL, VTList.VTs[1]);
10514 SDValue F1 = getFreeze(N1);
10515 SDValue F2 = getFreeze(N2);
10524 SDValue NotF1 = getNOT(DL, F1, VTList.VTs[0]);
10569 SDValue Hi =
10571 SDValue Lo = getConstant(Val.trunc(Width), DL, VTList.VTs[0]);
10585 SDValue Result0 = getConstantFP(FrexpMant, DL, VTList.VTs[0]);
10586 SDValue Result1 =
10654 return SDValue(E, 0);
10667 SDValue V(N, 0);
10672 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL,
10674 return getNode(Opcode, DL, VTList, ArrayRef<SDValue>());
10677 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
10678 SDValue N1) {
10679 SDValue Ops[] = { N1 };
10683 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
10684 SDValue N1, SDValue N2) {
10685 SDValue Ops[] = { N1, N2 };
10689 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
10690 SDValue N1, SDValue N2, SDValue N3) {
10691 SDValue Ops[] = { N1, N2, N3 };
10695 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
10696 SDValue N1, SDValue N2, SDValue N3, SDValue N4) {
10697 SDValue Ops[] = { N1, N2, N3, N4 };
10701 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
10702 SDValue N1, SDValue N2, SDValue N3, SDValue N4,
10703 SDValue N5) {
10704 SDValue Ops[] = { N1, N2, N3, N4, N5 };
10801 SDNode *SelectionDAG::UpdateNodeOperands(SDNode *N, SDValue Op) {
10826 SDNode *SelectionDAG::UpdateNodeOperands(SDNode *N, SDValue Op1, SDValue Op2) {
10856 UpdateNodeOperands(SDNode *N, SDValue Op1, SDValue Op2, SDValue Op3) {
10857 SDValue Ops[] = { Op1, Op2, Op3 };
10862 UpdateNodeOperands(SDNode *N, SDValue Op1, SDValue Op2,
10863 SDValue Op3, SDValue Op4) {
10864 SDValue Ops[] = { Op1, Op2, Op3, Op4 };
10869 UpdateNodeOperands(SDNode *N, SDValue Op1, SDValue Op2,
10870 SDValue Op3, SDValue Op4, SDValue Op5) {
10871 SDValue Ops[] = { Op1, Op2, Op3, Op4, Op5 };
10876 UpdateNodeOperands(SDNode *N, ArrayRef<SDValue> Ops) {
10913 Use.set(SDValue());
10948 EVT VT, SDValue Op1) {
10950 SDValue Ops[] = { Op1 };
10955 EVT VT, SDValue Op1,
10956 SDValue Op2) {
10958 SDValue Ops[] = { Op1, Op2 };
10963 EVT VT, SDValue Op1,
10964 SDValue Op2, SDValue Op3) {
10966 SDValue Ops[] = { Op1, Op2, Op3 };
10971 EVT VT, ArrayRef<SDValue> Ops) {
10977 EVT VT1, EVT VT2, ArrayRef<SDValue> Ops) {
10990 ArrayRef<SDValue> Ops) {
10997 SDValue Op1, SDValue Op2) {
10999 SDValue Ops[] = { Op1, Op2 };
11004 SDVTList VTs,ArrayRef<SDValue> Ops) {
11049 SDVTList VTs, ArrayRef<SDValue> Ops) {
11073 Use.set(SDValue());
11117 SDValue InputChain = Node->getOperand(0);
11118 SDValue OutputChain = SDValue(Node, 1);
11121 SmallVector<SDValue, 3> Ops;
11156 EVT VT, SDValue Op1) {
11158 SDValue Ops[] = { Op1 };
11163 EVT VT, SDValue Op1, SDValue Op2) {
11165 SDValue Ops[] = { Op1, Op2 };
11170 EVT VT, SDValue Op1, SDValue Op2,
11171 SDValue Op3) {
11173 SDValue Ops[] = { Op1, Op2, Op3 };
11178 EVT VT, ArrayRef<SDValue> Ops) {
11184 EVT VT1, EVT VT2, SDValue Op1,
11185 SDValue Op2) {
11187 SDValue Ops[] = { Op1, Op2 };
11192 EVT VT1, EVT VT2, SDValue Op1,
11193 SDValue Op2, SDValue Op3) {
11195 SDValue Ops[] = { Op1, Op2, Op3 };
11201 ArrayRef<SDValue> Ops) {
11208 SDValue Op1, SDValue Op2) {
11210 SDValue Ops[] = { Op1, Op2 };
11216 SDValue Op1, SDValue Op2,
11217 SDValue Op3) {
11219 SDValue Ops[] = { Op1, Op2, Op3 };
11225 ArrayRef<SDValue> Ops) {
11232 ArrayRef<SDValue> Ops) {
11239 ArrayRef<SDValue> Ops) {
11261 NewSDValueDbgMsg(SDValue(N, 0), "Creating new machine node: ", this);
11267 SDValue SelectionDAG::getTargetExtractSubreg(int SRIdx, const SDLoc &DL, EVT VT,
11268 SDValue Operand) {
11269 SDValue SRIdxVal = getTargetConstant(SRIdx, DL, MVT::i32);
11272 return SDValue(Subreg, 0);
11277 SDValue SelectionDAG::getTargetInsertSubreg(int SRIdx, const SDLoc &DL, EVT VT,
11278 SDValue Operand, SDValue Subreg) {
11279 SDValue SRIdxVal = getTargetConstant(SRIdx, DL, MVT::i32);
11282 return SDValue(Result, 0);
11288 ArrayRef<SDValue> Ops) {
11296 ArrayRef<SDValue> Ops,
11312 ArrayRef<SDValue> Ops) {
11400 void SelectionDAG::transferDbgValues(SDValue From, SDValue To,
11500 SDValue N0 = N.getOperand(0);
11501 SDValue N1 = N.getOperand(1);
11569 SDValue N0 = N.getOperand(0);
11653 void SelectionDAG::ReplaceAllUsesWith(SDValue FromN, SDValue To) {
11722 transferDbgValues(SDValue(From, i), SDValue(To, i));
11756 setRoot(SDValue(To, getRoot().getResNo()));
11764 void SelectionDAG::ReplaceAllUsesWith(SDNode *From, const SDValue *To) {
11766 return ReplaceAllUsesWith(SDValue(From, 0), To[0]);
11770 transferDbgValues(SDValue(From, i), To[i]);
11792 const SDValue &ToOp = To[Use.getResNo()];
11808 setRoot(SDValue(To[getRoot().getResNo()]));
11814 void SelectionDAG::ReplaceAllUsesOfValueWith(SDValue From, SDValue To){
11989 void SelectionDAG::ReplaceAllUsesOfValuesWith(const SDValue *From,
11990 const SDValue *To,
12152 SDValue SelectionDAG::makeEquivalentMemoryOrdering(SDValue OldChain,
12153 SDValue NewMemOpChain) {
12163 SDValue TokenFactor = getNode(ISD::TokenFactor, SDLoc(OldChain), MVT::Other,
12170 SDValue SelectionDAG::makeEquivalentMemoryOrdering(LoadSDNode *OldLoad,
12171 SDValue NewMemOp) {
12173 SDValue OldChain = SDValue(OldLoad, 1);
12174 SDValue NewMemOpChain = NewMemOp.getValue(1);
12178 SDValue SelectionDAG::getSymbolFunctionGlobalAddress(SDValue Op,
12205 bool llvm::isNullConstant(SDValue V) {
12210 bool llvm::isNullConstantOrUndef(SDValue V) {
12214 bool llvm::isNullFPConstant(SDValue V) {
12219 bool llvm::isAllOnesConstant(SDValue V) {
12224 bool llvm::isOneConstant(SDValue V) {
12229 bool llvm::isMinSignedConstant(SDValue V) {
12234 bool llvm::isNeutralConstant(unsigned Opcode, SDNodeFlags Flags, SDValue V,
12297 SDValue llvm::peekThroughBitcasts(SDValue V) {
12303 SDValue llvm::peekThroughOneUseBitcasts(SDValue V) {
12309 SDValue llvm::peekThroughExtractSubvectors(SDValue V) {
12315 SDValue llvm::peekThroughTruncates(SDValue V) {
12321 bool llvm::isBitwiseNot(SDValue V, bool AllowUndefs) {
12331 ConstantSDNode *llvm::isConstOrConstSplat(SDValue N, bool AllowUndefs,
12340 ConstantSDNode *llvm::isConstOrConstSplat(SDValue N, const APInt &DemandedElts,
12377 ConstantFPSDNode *llvm::isConstOrConstSplatFP(SDValue N, bool AllowUndefs) {
12385 ConstantFPSDNode *llvm::isConstOrConstSplatFP(SDValue N,
12407 bool llvm::isNullOrNullSplat(SDValue N, bool AllowUndefs) {
12414 bool llvm::isOneOrOneSplat(SDValue N, bool AllowUndefs) {
12420 bool llvm::isAllOnesOrAllOnesSplat(SDValue N, bool AllowUndefs) {
12535 bool SDValue::isOperandOf(const SDNode *N) const {
12541 [this](SDValue Op) { return this == Op.getNode(); });
12554 bool SDValue::reachesChainWithoutSideEffects(SDValue Dest,
12579 return llvm::all_of((*this)->ops(), [=](SDValue Op) {
12603 SDValue
12610 return SDValue();
12613 SDValue Op = Extract->getOperand(0);
12617 return SDValue();
12627 return SDValue();
12636 auto PartialReduction = [&](SDValue Op, unsigned NumSubElts) {
12638 return SDValue();
12643 return SDValue();
12663 SDValue PrevOp;
12670 SDValue Op0 = Op.getOperand(0);
12671 SDValue Op1 = Op.getOperand(1);
12698 SDValue Op0 = Op.getOperand(0);
12699 SDValue Op1 = Op.getOperand(1);
12704 SDValue Src = Op0.getOperand(0);
12720 SDValue SelectionDAG::UnrollVectorOp(SDNode *N, unsigned ResNE) {
12734 SmallVector<SDValue, 8> Scalars0, Scalars1;
12735 SmallVector<SDValue, 4> Operands(N->getNumOperands());
12742 SDValue Operand = N->getOperand(j);
12751 SDValue EltOp = getNode(N->getOpcode(), dl, {EltVT, EltVT1}, Operands);
12763 SDValue Vec0 = getBuildVector(VecVT, dl, Scalars0);
12764 SDValue Vec1 = getBuildVector(VecVT1, dl, Scalars1);
12771 SmallVector<SDValue, 8> Scalars;
12772 SmallVector<SDValue, 4> Operands(N->getNumOperands());
12777 SDValue Operand = N->getOperand(j);
12832 std::pair<SDValue, SDValue> SelectionDAG::UnrollVectorOverflowOp(
12853 SmallVector<SDValue, 8> LHSScalars;
12854 SmallVector<SDValue, 8> RHSScalars;
12860 SmallVector<SDValue, 8> ResScalars;
12861 SmallVector<SDValue, 8> OvScalars;
12863 SDValue Res = getNode(Opcode, dl, VTs, LHSScalars[i], RHSScalars[i]);
12864 SDValue Ov =
12910 MaybeAlign SelectionDAG::InferPtrAlign(SDValue Ptr) const {
12946 std::pair<SDValue, SDValue> SelectionDAG::SplitScalar(const SDValue &N,
12952 SDValue Lo =
12954 SDValue Hi =
13005 std::pair<SDValue, SDValue>
13006 SelectionDAG::SplitVector(const SDValue &N, const SDLoc &DL, const EVT &LoVT,
13015 SDValue Lo, Hi;
13027 std::pair<SDValue, SDValue> SelectionDAG::SplitEVL(SDValue N, EVT VecVT,
13035 SDValue HalfNumElts =
13039 SDValue Lo = getNode(ISD::UMIN, DL, VT, N, HalfNumElts);
13040 SDValue Hi = getNode(ISD::USUBSAT, DL, VT, N, HalfNumElts);
13045 SDValue SelectionDAG::WidenVector(const SDValue &N, const SDLoc &DL) {
13053 void SelectionDAG::ExtractVectorElements(SDValue Op,
13054 SmallVectorImpl<SDValue> &Args,
13106 SDValue OpVal = getOperand(i);
13156 SDValue BuildVectorSDNode::getSplatValue(const APInt &DemandedElts,
13165 return SDValue();
13166 SDValue Splatted;
13170 SDValue Op = getOperand(i);
13177 return SDValue();
13191 SDValue BuildVectorSDNode::getSplatValue(BitVector *UndefElements) const {
13197 SmallVectorImpl<SDValue> &Sequence,
13217 Sequence.append(SeqLen, SDValue());
13221 SDValue &SeqOp = Sequence[I % SeqLen];
13222 SDValue Op = getOperand(I);
13242 bool BuildVectorSDNode::getRepeatedSequence(SmallVectorImpl<SDValue> &Sequence,
13308 SDValue Op = getOperand(I);
13381 for (const SDValue &Op : op_values()) {
13440 SDValue N, bool AllowOpaques) const {
13463 bool SelectionDAG::isConstantFPBuildVectorOrConstantFP(SDValue N) const {
13477 std::optional<bool> SelectionDAG::isBoolConstant(SDValue N,
13503 void SelectionDAG::createOperands(SDNode *Node, ArrayRef<SDValue> Vals) {
13532 SDValue SelectionDAG::getTokenFactor(const SDLoc &DL,
13533 SmallVectorImpl<SDValue> &Vals) {
13537 auto ExtractedTFs = ArrayRef<SDValue>(Vals).slice(SliceIdx, Limit);
13538 SDValue NewTF = getNode(ISD::TokenFactor, DL, MVT::Other, ExtractedTFs);
13545 SDValue SelectionDAG::getNeutralElement(unsigned Opcode, const SDLoc &DL,
13549 return SDValue();
13610 SDValue SelectionDAG::makeStateFunctionCall(unsigned LibFunc, SDValue Ptr,
13611 SDValue InChain,
13620 SDValue Callee = getExternalSymbol(TLI->getLibcallName(LC),
13630 assert(From && To && "Invalid SDNode; empty source SDValue?");
13670 for (const SDValue &Op : N->op_values())
13683 for (const SDValue &Op : N->op_values()) {
13741 for (const SDValue &Op : N->op_values())