• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/

Lines Matching refs:SDValue

107 static void NewSDValueDbgMsg(SDValue V, StringRef Msg, SelectionDAG *G) {
181 SDValue NotZero = N->getOperand(i);
209 for (const SDValue &Op : N->op_values()) {
242 for (const SDValue &Op : N->op_values()) {
255 for (const SDValue &Op : N->op_values()) {
270 return all_of(N->op_values(), [](SDValue Op) { return Op.isUndef(); });
273 bool ISD::matchUnaryPredicate(SDValue Op,
300 SDValue LHS, SDValue RHS,
318 SDValue LHSOp = LHS.getOperand(i);
319 SDValue RHSOp = RHS.getOperand(i);
464 ArrayRef<SDValue> Ops) {
481 SDVTList VTList, ArrayRef<SDValue> OpList) {
736 Use.set(SDValue());
951 SDNode *SelectionDAG::FindModifiedNodeSlot(SDNode *N, SDValue Op,
956 SDValue Ops[] = { Op };
971 SDValue Op1, SDValue Op2,
976 SDValue Ops[] = { Op1, Op2 };
990 SDNode *SelectionDAG::FindModifiedNodeSlot(SDNode *N, ArrayRef<SDValue> Ops,
1123 SDValue SelectionDAG::getFPExtendOrRound(SDValue Op, const SDLoc &DL, EVT VT) {
1129 std::pair<SDValue, SDValue>
1130 SelectionDAG::getStrictFPExtendOrRound(SDValue Op, SDValue Chain,
1134 SDValue Res =
1140 return std::pair<SDValue, SDValue>(Res, SDValue(Res.getNode(), 1));
1143 SDValue SelectionDAG::getAnyExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT) {
1149 SDValue SelectionDAG::getSExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT) {
1155 SDValue SelectionDAG::getZExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT) {
1161 SDValue SelectionDAG::getBoolExtOrTrunc(SDValue Op, const SDLoc &SL, EVT VT,
1170 SDValue SelectionDAG::getZeroExtendInReg(SDValue Op, const SDLoc &DL, EVT VT) {
1188 SDValue SelectionDAG::getPtrExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT) {
1194 SDValue SelectionDAG::getPtrExtendInReg(SDValue Op, const SDLoc &DL, EVT VT) {
1201 SDValue SelectionDAG::getNOT(const SDLoc &DL, SDValue Val, EVT VT) {
1203 SDValue NegOne =
1208 SDValue SelectionDAG::getLogicalNOT(const SDLoc &DL, SDValue Val, EVT VT) {
1209 SDValue TrueValue = getBoolConstant(true, DL, VT, VT);
1213 SDValue SelectionDAG::getBoolConstant(bool V, const SDLoc &DL, EVT VT,
1228 SDValue SelectionDAG::getConstant(uint64_t Val, const SDLoc &DL, EVT VT,
1237 SDValue SelectionDAG::getConstant(const APInt &Val, const SDLoc &DL, EVT VT,
1242 SDValue SelectionDAG::getConstant(const ConstantInt &Val, const SDLoc &DL,
1279 SmallVector<SDValue, 2> EltParts;
1298 SmallVector<SDValue, 8> Ops;
1302 SDValue V = getNode(ISD::BITCAST, DL, VT, getBuildVector(ViaVecVT, DL, Ops));
1317 return SDValue(N, 0);
1323 NewSDValueDbgMsg(SDValue(N, 0), "Creating constant: ", this);
1326 SDValue Result(N, 0);
1335 SDValue SelectionDAG::getIntPtrConstant(uint64_t Val, const SDLoc &DL,
1340 SDValue SelectionDAG::getShiftAmountConstant(uint64_t Val, EVT VT,
1347 SDValue SelectionDAG::getVectorIdxConstant(uint64_t Val, const SDLoc &DL,
1352 SDValue SelectionDAG::getConstantFP(const APFloat &V, const SDLoc &DL, EVT VT,
1357 SDValue SelectionDAG::getConstantFP(const ConstantFP &V, const SDLoc &DL,
1374 return SDValue(N, 0);
1382 SDValue Result(N, 0);
1389 SDValue SelectionDAG::getConstantFP(double Val, const SDLoc &DL, EVT VT,
1407 SDValue SelectionDAG::getGlobalAddress(const GlobalValue *GV, const SDLoc &DL,
1431 return SDValue(E, 0);
1437 return SDValue(N, 0);
1440 SDValue SelectionDAG::getFrameIndex(int FI, EVT VT, bool isTarget) {
1447 return SDValue(E, 0);
1452 return SDValue(N, 0);
1455 SDValue SelectionDAG::getJumpTable(int JTI, EVT VT, bool isTarget,
1466 return SDValue(E, 0);
1471 return SDValue(N, 0);
1474 SDValue SelectionDAG::getConstantPool(const Constant *C, EVT VT,
1492 return SDValue(E, 0);
1498 SDValue V = SDValue(N, 0);
1503 SDValue SelectionDAG::getConstantPool(MachineConstantPoolValue *C, EVT VT,
1519 return SDValue(E, 0);
1525 return SDValue(N, 0);
1528 SDValue SelectionDAG::getTargetIndex(int Index, EVT VT, int64_t Offset,
1537 return SDValue(E, 0);
1542 return SDValue(N, 0);
1545 SDValue SelectionDAG::getBasicBlock(MachineBasicBlock *MBB) {
1551 return SDValue(E, 0);
1556 return SDValue(N, 0);
1559 SDValue SelectionDAG::getValueType(EVT VT) {
1567 if (N) return SDValue(N, 0);
1570 return SDValue(N, 0);
1573 SDValue SelectionDAG::getExternalSymbol(const char *Sym, EVT VT) {
1575 if (N) return SDValue(N, 0);
1578 return SDValue(N, 0);
1581 SDValue SelectionDAG::getMCSymbol(MCSymbol *Sym, EVT VT) {
1584 return SDValue(N, 0);
1587 return SDValue(N, 0);
1590 SDValue SelectionDAG::getTargetExternalSymbol(const char *Sym, EVT VT,
1594 if (N) return SDValue(N, 0);
1597 return SDValue(N, 0);
1600 SDValue SelectionDAG::getCondCode(ISD::CondCode Cond) {
1610 return SDValue(CondCodeNodes[Cond], 0);
1615 static void commuteShuffle(SDValue &N1, SDValue &N2, MutableArrayRef<int> M) {
1620 SDValue SelectionDAG::getVectorShuffle(EVT VT, const SDLoc &dl, SDValue N1,
1621 SDValue N2, ArrayRef<int> Mask) {
1657 SDValue Splat = BV->getSplatValue(&UndefElements);
1721 SDValue V = N1;
1731 SDValue Splat = BV->getSplatValue(&UndefElements);
1754 const SDValue &Splatted = BV->getOperand(MaskVec[0]);
1755 SDValue NewBV = getSplatBuildVector(BuildVT, dl, Splatted);
1767 SDValue Ops[2] = { N1, N2 };
1774 return SDValue(E, 0);
1788 SDValue V = SDValue(N, 0);
1793 SDValue SelectionDAG::getCommutedVectorShuffle(const ShuffleVectorSDNode &SV) {
1798 SDValue Op0 = SV.getOperand(0);
1799 SDValue Op1 = SV.getOperand(1);
1803 SDValue SelectionDAG::getRegister(unsigned RegNo, EVT VT) {
1809 return SDValue(E, 0);
1815 return SDValue(N, 0);
1818 SDValue SelectionDAG::getRegisterMask(const uint32_t *RegMask) {
1824 return SDValue(E, 0);
1829 return SDValue(N, 0);
1832 SDValue SelectionDAG::getEHLabel(const SDLoc &dl, SDValue Root,
1837 SDValue SelectionDAG::getLabelNode(unsigned Opcode, const SDLoc &dl,
1838 SDValue Root, MCSymbol *Label) {
1840 SDValue Ops[] = { Root };
1845 return SDValue(E, 0);
1853 return SDValue(N, 0);
1856 SDValue SelectionDAG::getBlockAddress(const BlockAddress *BA, EVT VT,
1868 return SDValue(E, 0);
1873 return SDValue(N, 0);
1876 SDValue SelectionDAG::getSrcValue(const Value *V) {
1883 return SDValue(E, 0);
1888 return SDValue(N, 0);
1891 SDValue SelectionDAG::getMDNode(const MDNode *MD) {
1898 return SDValue(E, 0);
1903 return SDValue(N, 0);
1906 SDValue SelectionDAG::getBitcast(EVT VT, SDValue V) {
1913 SDValue SelectionDAG::getAddrSpaceCast(const SDLoc &dl, EVT VT, SDValue Ptr,
1915 SDValue Ops[] = {Ptr};
1923 return SDValue(E, 0);
1931 return SDValue(N, 0);
1934 SDValue SelectionDAG::getFreeze(SDValue V) {
1940 SDValue SelectionDAG::getShiftAmountOperand(EVT LHSTy, SDValue Op) {
1948 SDValue SelectionDAG::expandVAArg(SDNode *Node) {
1953 SDValue Tmp1 = Node->getOperand(0);
1954 SDValue Tmp2 = Node->getOperand(1);
1957 SDValue VAListLoad = getLoad(TLI.getPointerTy(getDataLayout()), dl, Tmp1,
1959 SDValue VAList = VAListLoad;
1982 SDValue SelectionDAG::expandVACopy(SDNode *Node) {
1989 SDValue Tmp1 =
2024 SDValue SelectionDAG::CreateStackTemporary(TypeSize Bytes, Align Alignment) {
2030 SDValue SelectionDAG::CreateStackTemporary(EVT VT, unsigned minAlign) {
2037 SDValue SelectionDAG::CreateStackTemporary(EVT VT1, EVT VT2) {
2046 SDValue SelectionDAG::FoldSetCC(EVT VT, SDValue N1, SDValue N2,
2176 return SDValue();
2198 return SDValue();
2205 SDValue SelectionDAG::GetDemandedBits(SDValue V, const APInt &DemandedBits) {
2218 SDValue SelectionDAG::GetDemandedBits(SDValue V, const APInt &DemandedBits,
2244 if (SDValue SimplifyLHS =
2263 return SDValue();
2268 bool SelectionDAG::SignBitIsZero(SDValue Op, unsigned Depth) const {
2276 bool SelectionDAG::MaskedValueIsZero(SDValue V, const APInt &Mask,
2284 bool SelectionDAG::MaskedValueIsZero(SDValue V, const APInt &Mask,
2291 bool SelectionDAG::MaskedValueIsAllOnes(SDValue V, const APInt &Mask,
2300 bool SelectionDAG::isSplatValue(SDValue V, const APInt &DemandedElts,
2317 SDValue LHS = V.getOperand(0);
2318 SDValue RHS = V.getOperand(1);
2339 SDValue Scl;
2341 SDValue Op = V.getOperand(i);
2375 SDValue Src = V.getOperand(0);
2392 bool SelectionDAG::isSplatValue(SDValue V, bool AllowUndefs) {
2406 SDValue SelectionDAG::getSplatSourceVector(SDValue V, int &SplatIdx) {
2441 return SDValue();
2456 return SDValue();
2459 SDValue SelectionDAG::getSplatValue(SDValue V) {
2461 if (SDValue SrcVector = getSplatSourceVector(V, SplatIdx))
2465 return SDValue();
2469 SelectionDAG::getValidShiftAmountConstant(SDValue V,
2485 SDValue V, const APInt &DemandedElts) const {
2514 SDValue V, const APInt &DemandedElts) const {
2545 KnownBits SelectionDAG::computeKnownBits(SDValue Op, unsigned Depth) const {
2564 KnownBits SelectionDAG::computeKnownBits(SDValue Op, const APInt &DemandedElts,
2609 SDValue SrcOp = Op.getOperand(i);
2656 SDValue LHS = Op.getOperand(0);
2665 SDValue RHS = Op.getOperand(1);
2682 SDValue Sub = Op.getOperand(i);
2696 SDValue Src = Op.getOperand(0);
2697 SDValue Sub = Op.getOperand(1);
2720 SDValue Src = Op.getOperand(0);
2736 SDValue N0 = Op.getOperand(0);
2744 SDValue N0 = Op.getOperand(0);
3307 SDValue InVec = Op.getOperand(0);
3308 SDValue EltNo = Op.getOperand(1);
3335 SDValue InVec = Op.getOperand(0);
3336 SDValue InVal = Op.getOperand(1);
3337 SDValue EltNo = Op.getOperand(2);
3480 SelectionDAG::OverflowKind SelectionDAG::computeOverflowKind(SDValue N0,
3481 SDValue N1) const {
3511 bool SelectionDAG::isKnownToBeAPowerOfTwo(SDValue Val) const {
3537 if (llvm::all_of(Val->ops(), [BitWidth](SDValue E) {
3552 unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, unsigned Depth) const {
3565 unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, const APInt &DemandedElts,
3601 SDValue SrcOp = Op.getOperand(i);
3649 SDValue N0 = Op.getOperand(0);
3704 SDValue Src = Op.getOperand(0);
3926 SDValue InVec = Op.getOperand(0);
3927 SDValue InVal = Op.getOperand(1);
3928 SDValue EltNo = Op.getOperand(2);
3953 SDValue InVec = Op.getOperand(0);
3954 SDValue EltNo = Op.getOperand(1);
3978 SDValue Src = Op.getOperand(0);
4008 SDValue Src = Op.getOperand(0);
4009 SDValue Sub = Op.getOperand(1);
4109 bool SelectionDAG::isBaseWithConstantOffset(SDValue Op) const {
4121 bool SelectionDAG::isKnownNeverNaN(SDValue Op, bool SNaN, unsigned Depth) const {
4239 bool SelectionDAG::isKnownNeverZeroFloat(SDValue Op) const {
4250 bool SelectionDAG::isKnownNeverZero(SDValue Op) const {
4272 bool SelectionDAG::isEqualTo(SDValue A, SDValue B) const {
4287 bool SelectionDAG::haveNoCommonBitsSet(SDValue A, SDValue B) const {
4293 static SDValue FoldBUILD_VECTOR(const SDLoc &DL, EVT VT,
4294 ArrayRef<SDValue> Ops,
4304 if (llvm::all_of(Ops, [](SDValue Op) { return Op.isUndef(); }))
4308 SDValue IdentitySrc;
4324 return SDValue();
4329 static SDValue foldCONCAT_VECTORS(const SDLoc &DL, EVT VT,
4330 ArrayRef<SDValue> Ops,
4334 [Ops](SDValue Op) {
4346 if (llvm::all_of(Ops, [](SDValue Op) { return Op.isUndef(); }))
4352 SDValue IdentitySrc;
4355 SDValue Op = Ops[i];
4376 return SDValue();
4382 SmallVector<SDValue, 16> Elts;
4383 for (SDValue Op : Ops) {
4390 return SDValue();
4395 for (SDValue Op : Elts)
4399 for (SDValue &Op : Elts)
4404 SDValue V = DAG.getBuildVector(VT, DL, Elts);
4410 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT) {
4415 return SDValue(E, 0);
4422 SDValue V = SDValue(N, 0);
4427 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
4428 SDValue Operand, const SDNodeFlags Flags) {
4598 SDValue Ops = { Operand };
4599 if (SDValue Fold = FoldConstantVectorArithmetic(Opcode, DL, VT, Ops))
4617 SDValue Ops[] = {Operand};
4618 if (SDValue V = FoldBUILD_VECTOR(DL, VT, Ops, *this))
4708 SDValue OpOp = Operand.getOperand(0);
4818 SDValue Ops[] = {Operand};
4825 return SDValue(E, 0);
4838 SDValue V = SDValue(N, 0);
4885 SDValue SelectionDAG::FoldSymbolOffset(unsigned Opcode, EVT VT,
4889 return SDValue();
4891 return SDValue();
4894 return SDValue();
4899 default: return SDValue();
4905 bool SelectionDAG::isUndef(unsigned Opcode, ArrayRef<SDValue> Ops) {
4914 SDValue Divisor = Ops[1];
4920 [](SDValue V) { return V.isUndef() ||
4930 SDValue SelectionDAG::FoldConstantArithmetic(unsigned Opcode, const SDLoc &DL,
4931 EVT VT, ArrayRef<SDValue> Ops) {
4936 return SDValue();
4942 return SDValue();
4954 return SDValue();
4959 return SDValue();
4961 SDValue Folded = getConstant(FoldAttempt.getValue(), DL, VT);
4979 return SDValue();
4985 return SDValue();
4988 return SDValue();
4991 return SDValue();
5001 return SDValue();
5003 SmallVector<SDValue, 4> Outputs;
5006 SDValue V1 = BV1 ? BV1->getOperand(I) : getUNDEF(SVT);
5007 SDValue V2 = BV2 ? BV2->getOperand(I) : getUNDEF(SVT);
5016 return SDValue();
5019 SDValue ScalarResult = getNode(Opcode, DL, SVT, V1, V2);
5026 return SDValue();
5041 SDValue SelectionDAG::FoldConstantVectorArithmetic(unsigned Opcode,
5043 ArrayRef<SDValue> Ops,
5049 return SDValue();
5056 return SDValue();
5062 return SDValue();
5067 auto IsScalarOrSameVectorSize = [&](const SDValue &Op) {
5072 auto IsConstantBuildVectorOrUndef = [&](const SDValue &Op) {
5083 return SDValue();
5095 return SDValue();
5099 SmallVector<SDValue, 4> ScalarResults;
5101 SmallVector<SDValue, 4> ScalarOps;
5102 for (SDValue Op : Ops) {
5114 SDValue ScalarOp = InBV->getOperand(i);
5126 SDValue ScalarResult = getNode(Opcode, DL, SVT, ScalarOps, Flags);
5135 return SDValue();
5139 SDValue V = getBuildVector(VT, DL, ScalarResults);
5144 SDValue SelectionDAG::foldConstantFPMath(unsigned Opcode, const SDLoc &DL,
5145 EVT VT, SDValue N1, SDValue N2) {
5204 return SDValue();
5207 SDValue SelectionDAG::getAssertAlign(const SDLoc &DL, SDValue Val, Align A) {
5221 return SDValue(E, 0);
5230 SDValue V(N, 0);
5235 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
5236 SDValue N1, SDValue N2, const SDNodeFlags Flags) {
5265 SDValue Ops[] = {N1, N2};
5266 if (SDValue V = FoldBUILD_VECTOR(DL, VT, Ops, *this))
5271 SDValue Ops[] = {N1, N2};
5272 if (SDValue V = foldCONCAT_VECTORS(DL, VT, Ops, *this))
5335 if (SDValue V = simplifyFPBinop(Opcode, N1, N2, Flags))
5353 if (SDValue V = simplifyShift(N1, N2))
5427 SmallVector<SDValue, 8> Ops;
5430 SDValue Op = N1.getOperand(i);
5481 SDValue Elt = N1.getOperand(Index);
5498 SDValue N1Op2 = N1.getOperand(2);
5591 if (SDValue SV = FoldConstantArithmetic(Opcode, DL, VT, {N1, N2}))
5594 if (SDValue V = foldConstantFPMath(Opcode, DL, VT, N1, N2))
5648 SDValue Ops[] = {N1, N2};
5655 return SDValue(E, 0);
5668 SDValue V = SDValue(N, 0);
5673 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
5674 SDValue N1, SDValue N2, SDValue N3,
5696 SDValue Ops[] = {N1, N2, N3};
5697 if (SDValue V = FoldBUILD_VECTOR(DL, VT, Ops, *this))
5702 SDValue Ops[] = {N1, N2, N3};
5703 if (SDValue V = foldCONCAT_VECTORS(DL, VT, Ops, *this))
5717 if (SDValue V = FoldSetCC(VT, N1, N2, cast<CondCodeSDNode>(N3)->get(), DL))
5720 SDValue Ops[] = {N1, N2, N3};
5721 if (SDValue V = FoldConstantVectorArithmetic(Opcode, DL, VT, Ops)) {
5729 if (SDValue V = simplifySelect(N1, N2, N3))
5797 SDValue Ops[] = {N1, N2, N3};
5804 return SDValue(E, 0);
5817 SDValue V = SDValue(N, 0);
5822 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
5823 SDValue N1, SDValue N2, SDValue N3, SDValue N4) {
5824 SDValue Ops[] = { N1, N2, N3, N4 };
5828 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
5829 SDValue N1, SDValue N2, SDValue N3, SDValue N4,
5830 SDValue N5) {
5831 SDValue Ops[] = { N1, N2, N3, N4, N5 };
5837 SDValue SelectionDAG::getStackArgumentTokenFactor(SDValue Chain) {
5838 SmallVector<SDValue, 8> ArgChains;
5851 ArgChains.push_back(SDValue(L, 1));
5859 static SDValue getMemsetValue(SDValue Value, EVT VT, SelectionDAG &DAG,
5901 static SDValue getMemsetStringVal(EVT VT, const SDLoc &dl, SelectionDAG &DAG,
5940 return SDValue(nullptr, 0);
5943 SDValue SelectionDAG::getMemBasePlusOffset(SDValue Base, int64_t Offset,
5950 SDValue SelectionDAG::getMemBasePlusOffset(SDValue Ptr, SDValue Offset,
5959 static bool isMemSrcFromConstant(SDValue Src, ConstantDataArraySlice &Slice) {
5987 SmallVector<SDValue, 32> &OutChains, unsigned From,
5988 unsigned To, SmallVector<SDValue, 16> &OutLoadChains,
5989 SmallVector<SDValue, 16> &OutStoreChains) {
5992 SmallVector<SDValue, 16> GluedLoadChains;
5999 SDValue LoadToken = DAG.getNode(ISD::TokenFactor, dl, MVT::Other,
6004 SDValue NewStore = DAG.getTruncStore(LoadToken, dl, ST->getValue(),
6011 static SDValue getMemcpyLoadsAndStores(SelectionDAG &DAG, const SDLoc &dl,
6012 SDValue Chain, SDValue Dst, SDValue Src,
6053 return SDValue();
6076 SmallVector<SDValue, 16> OutLoadChains;
6077 SmallVector<SDValue, 16> OutStoreChains;
6078 SmallVector<SDValue, 32> OutChains;
6084 SDValue Value, Store;
6198 static SDValue getMemmoveLoadsAndStores(SelectionDAG &DAG, const SDLoc &dl,
6199 SDValue Chain, SDValue Dst, SDValue Src,
6233 return SDValue();
6249 SmallVector<SDValue, 8> LoadValues;
6250 SmallVector<SDValue, 8> LoadChains;
6251 SmallVector<SDValue, 8> OutChains;
6256 SDValue Value;
6276 SDValue Store;
6301 /// SDValue otherwise.
6306 static SDValue getMemsetStores(SelectionDAG &DAG, const SDLoc &dl,
6307 SDValue Chain, SDValue Dst, SDValue Src,
6332 return SDValue();
6345 SmallVector<SDValue, 8> OutChains;
6354 SDValue MemSetValue = getMemsetValue(Src, LargestVT, DAG, dl);
6368 SDValue Value = MemSetValue;
6377 SDValue Store = DAG.getStore(
6399 SDValue SelectionDAG::getMemcpy(SDValue Chain, const SDLoc &dl, SDValue Dst,
6400 SDValue Src, SDValue Size, Align Alignment,
6412 SDValue Result = getMemcpyLoadsAndStores(
6422 SDValue Result = TSI->EmitTargetCodeForMemcpy(
6468 std::pair<SDValue,SDValue> CallResult = TLI->LowerCallTo(CLI);
6472 SDValue SelectionDAG::getAtomicMemcpy(SDValue Chain, const SDLoc &dl,
6473 SDValue Dst, unsigned DstAlign,
6474 SDValue Src, unsigned SrcAlign,
6475 SDValue Size, Type *SizeTy,
6509 std::pair<SDValue, SDValue> CallResult = TLI->LowerCallTo(CLI);
6513 SDValue SelectionDAG::getMemmove(SDValue Chain, const SDLoc &dl, SDValue Dst,
6514 SDValue Src, SDValue Size, Align Alignment,
6526 SDValue Result = getMemmoveLoadsAndStores(
6536 SDValue Result =
6570 std::pair<SDValue,SDValue> CallResult = TLI->LowerCallTo(CLI);
6574 SDValue SelectionDAG::getAtomicMemmove(SDValue Chain, const SDLoc &dl,
6575 SDValue Dst, unsigned DstAlign,
6576 SDValue Src, unsigned SrcAlign,
6577 SDValue Size, Type *SizeTy,
6611 std::pair<SDValue, SDValue> CallResult = TLI->LowerCallTo(CLI);
6615 SDValue SelectionDAG::getMemset(SDValue Chain, const SDLoc &dl, SDValue Dst,
6616 SDValue Src, SDValue Size, Align Alignment,
6627 SDValue Result = getMemsetStores(*this, dl, Chain, Dst, Src,
6638 SDValue Result = TSI->EmitTargetCodeForMemset(
6670 std::pair<SDValue,SDValue> CallResult = TLI->LowerCallTo(CLI);
6674 SDValue SelectionDAG::getAtomicMemset(SDValue Chain, const SDLoc &dl,
6675 SDValue Dst, unsigned DstAlign,
6676 SDValue Value, SDValue Size, Type *SizeTy,
6710 std::pair<SDValue, SDValue> CallResult = TLI->LowerCallTo(CLI);
6714 SDValue SelectionDAG::getAtomic(unsigned Opcode, const SDLoc &dl, EVT MemVT,
6715 SDVTList VTList, ArrayRef<SDValue> Ops,
6724 return SDValue(E, 0);
6733 return SDValue(N, 0);
6736 SDValue SelectionDAG::getAtomicCmpSwap(unsigned Opcode, const SDLoc &dl,
6737 EVT MemVT, SDVTList VTs, SDValue Chain,
6738 SDValue Ptr, SDValue Cmp, SDValue Swp,
6744 SDValue Ops[] = {Chain, Ptr, Cmp, Swp};
6748 SDValue SelectionDAG::getAtomic(unsigned Opcode, const SDLoc &dl, EVT MemVT,
6749 SDValue Chain, SDValue Ptr, SDValue Val,
6772 SDValue Ops[] = {Chain, Ptr, Val};
6776 SDValue SelectionDAG::getAtomic(unsigned Opcode, const SDLoc &dl, EVT MemVT,
6777 EVT VT, SDValue Chain, SDValue Ptr,
6782 SDValue Ops[] = {Chain, Ptr};
6787 SDValue SelectionDAG::getMergeValues(ArrayRef<SDValue> Ops, const SDLoc &dl) {
6798 SDValue SelectionDAG::getMemIntrinsicNode(
6799 unsigned Opcode, const SDLoc &dl, SDVTList VTList, ArrayRef<SDValue> Ops,
6814 SDValue SelectionDAG::getMemIntrinsicNode(unsigned Opcode, const SDLoc &dl,
6816 ArrayRef<SDValue> Ops, EVT MemVT,
6836 return SDValue(E, 0);
6850 SDValue V(N, 0);
6855 SDValue SelectionDAG::getLifetimeNode(bool IsStart, const SDLoc &dl,
6856 SDValue Chain, int FrameIndex,
6860 SDValue Ops[2] = {
6873 return SDValue(E, 0);
6880 SDValue V(N, 0);
6890 SelectionDAG &DAG, SDValue Ptr,
6914 SelectionDAG &DAG, SDValue Ptr,
6915 SDValue OffsetOp) {
6924 SDValue SelectionDAG::getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType,
6925 EVT VT, const SDLoc &dl, SDValue Chain,
6926 SDValue Ptr, SDValue Offset,
6948 SDValue SelectionDAG::getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType,
6949 EVT VT, const SDLoc &dl, SDValue Chain,
6950 SDValue Ptr, SDValue Offset, EVT MemVT,
6974 SDValue Ops[] = { Chain, Ptr, Offset };
6984 return SDValue(E, 0);
6992 SDValue V(N, 0);
6997 SDValue SelectionDAG::getLoad(EVT VT, const SDLoc &dl, SDValue Chain,
6998 SDValue Ptr, MachinePointerInfo PtrInfo,
7002 SDValue Undef = getUNDEF(Ptr.getValueType());
7007 SDValue SelectionDAG::getLoad(EVT VT, const SDLoc &dl, SDValue Chain,
7008 SDValue Ptr, MachineMemOperand *MMO) {
7009 SDValue Undef = getUNDEF(Ptr.getValueType());
7014 SDValue SelectionDAG::getExtLoad(ISD::LoadExtType ExtType, const SDLoc &dl,
7015 EVT VT, SDValue Chain, SDValue Ptr,
7020 SDValue Undef = getUNDEF(Ptr.getValueType());
7025 SDValue SelectionDAG::getExtLoad(ISD::LoadExtType ExtType, const SDLoc &dl,
7026 EVT VT, SDValue Chain, SDValue Ptr, EVT MemVT,
7028 SDValue Undef = getUNDEF(Ptr.getValueType());
7033 SDValue SelectionDAG::getIndexedLoad(SDValue OrigLoad, const SDLoc &dl,
7034 SDValue Base, SDValue Offset,
7048 SDValue SelectionDAG::getStore(SDValue Chain, const SDLoc &dl, SDValue Val,
7049 SDValue Ptr, MachinePointerInfo PtrInfo,
7069 SDValue SelectionDAG::getStore(SDValue Chain, const SDLoc &dl, SDValue Val,
7070 SDValue Ptr, MachineMemOperand *MMO) {
7075 SDValue Undef = getUNDEF(Ptr.getValueType());
7076 SDValue Ops[] = { Chain, Val, Ptr, Undef };
7086 return SDValue(E, 0);
7094 SDValue V(N, 0);
7099 SDValue SelectionDAG::getTruncStore(SDValue Chain, const SDLoc &dl, SDValue Val,
7100 SDValue Ptr, MachinePointerInfo PtrInfo,
7119 SDValue SelectionDAG::getTruncStore(SDValue Chain, const SDLoc &dl, SDValue Val,
7120 SDValue Ptr, EVT SVT,
7140 SDValue Undef = getUNDEF(Ptr.getValueType());
7141 SDValue Ops[] = { Chain, Val, Ptr, Undef };
7151 return SDValue(E, 0);
7159 SDValue V(N, 0);
7164 SDValue SelectionDAG::getIndexedStore(SDValue OrigStore, const SDLoc &dl,
7165 SDValue Base, SDValue Offset,
7170 SDValue Ops[] = { ST->getChain(), ST->getValue(), Base, Offset };
7178 return SDValue(E, 0);
7187 SDValue V(N, 0);
7192 SDValue SelectionDAG::getMaskedLoad(EVT VT, const SDLoc &dl, SDValue Chain,
7193 SDValue Base, SDValue Offset, SDValue Mask,
7194 SDValue PassThru, EVT MemVT,
7203 SDValue Ops[] = {Chain, Base, Offset, Mask, PassThru};
7213 return SDValue(E, 0);
7221 SDValue V(N, 0);
7226 SDValue SelectionDAG::getIndexedMaskedLoad(SDValue OrigLoad, const SDLoc &dl,
7227 SDValue Base, SDValue Offset,
7237 SDValue SelectionDAG::getMaskedStore(SDValue Chain, const SDLoc &dl,
7238 SDValue Val, SDValue Base, SDValue Offset,
7239 SDValue Mask, EVT MemVT,
7250 SDValue Ops[] = {Chain, Val, Base, Offset, Mask};
7260 return SDValue(E, 0);
7269 SDValue V(N, 0);
7274 SDValue SelectionDAG::getIndexedMaskedStore(SDValue OrigStore, const SDLoc &dl,
7275 SDValue Base, SDValue Offset,
7285 SDValue SelectionDAG::getMaskedGather(SDVTList VTs, EVT VT, const SDLoc &dl,
7286 ArrayRef<SDValue> Ops,
7300 return SDValue(E, 0);
7321 SDValue V(N, 0);
7326 SDValue SelectionDAG::getMaskedScatter(SDVTList VTs, EVT VT, const SDLoc &dl,
7327 ArrayRef<SDValue> Ops,
7341 return SDValue(E, 0);
7359 SDValue V(N, 0);
7364 SDValue SelectionDAG::simplifySelect(SDValue Cond, SDValue T, SDValue F) {
7391 return SDValue();
7394 SDValue SelectionDAG::simplifyShift(SDValue X, SDValue Y) {
7415 return SDValue();
7418 SDValue SelectionDAG::simplifyFPBinop(unsigned Opcode, SDValue X, SDValue Y,
7437 return SDValue();
7455 return SDValue();
7458 SDValue SelectionDAG::getVAArg(EVT VT, const SDLoc &dl, SDValue Chain,
7459 SDValue Ptr, SDValue SV, unsigned Align) {
7460 SDValue Ops[] = { Chain, Ptr, SV, getTargetConstant(Align, dl, MVT::i32) };
7464 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
7468 case 1: return getNode(Opcode, DL, VT, static_cast<const SDValue>(Ops[0]));
7474 // Copy from an SDUse array into an SDValue array for use with
7476 SmallVector<SDValue, 8> NewOps(Ops.begin(), Ops.end());
7480 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
7481 ArrayRef<SDValue> Ops, const SDNodeFlags Flags) {
7495 if (SDValue V = FoldBUILD_VECTOR(DL, VT, Ops, *this))
7499 if (SDValue V = foldCONCAT_VECTORS(DL, VT, Ops, *this))
7528 return SDValue(E, 0);
7541 SDValue V(N, 0);
7546 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL,
7547 ArrayRef<EVT> ResultTys, ArrayRef<SDValue> Ops) {
7551 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
7552 ArrayRef<SDValue> Ops, const SDNodeFlags Flags) {
7618 return SDValue(E, 0);
7630 SDValue V(N, 0);
7635 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL,
7640 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
7641 SDValue N1) {
7642 SDValue Ops[] = { N1 };
7646 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
7647 SDValue N1, SDValue N2) {
7648 SDValue Ops[] = { N1, N2 };
7652 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
7653 SDValue N1, SDValue N2, SDValue N3) {
7654 SDValue Ops[] = { N1, N2, N3 };
7658 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
7659 SDValue N1, SDValue N2, SDValue N3, SDValue N4) {
7660 SDValue Ops[] = { N1, N2, N3, N4 };
7664 SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
7665 SDValue N1, SDValue N2, SDValue N3, SDValue N4,
7666 SDValue N5) {
7667 SDValue Ops[] = { N1, N2, N3, N4, N5 };
7761 SDNode *SelectionDAG::UpdateNodeOperands(SDNode *N, SDValue Op) {
7786 SDNode *SelectionDAG::UpdateNodeOperands(SDNode *N, SDValue Op1, SDValue Op2) {
7816 UpdateNodeOperands(SDNode *N, SDValue Op1, SDValue Op2, SDValue Op3) {
7817 SDValue Ops[] = { Op1, Op2, Op3 };
7822 UpdateNodeOperands(SDNode *N, SDValue Op1, SDValue Op2,
7823 SDValue Op3, SDValue Op4) {
7824 SDValue Ops[] = { Op1, Op2, Op3, Op4 };
7829 UpdateNodeOperands(SDNode *N, SDValue Op1, SDValue Op2,
7830 SDValue Op3, SDValue Op4, SDValue Op5) {
7831 SDValue Ops[] = { Op1, Op2, Op3, Op4, Op5 };
7836 UpdateNodeOperands(SDNode *N, ArrayRef<SDValue> Ops) {
7873 Use.set(SDValue());
7908 EVT VT, SDValue Op1) {
7910 SDValue Ops[] = { Op1 };
7915 EVT VT, SDValue Op1,
7916 SDValue Op2) {
7918 SDValue Ops[] = { Op1, Op2 };
7923 EVT VT, SDValue Op1,
7924 SDValue Op2, SDValue Op3) {
7926 SDValue Ops[] = { Op1, Op2, Op3 };
7931 EVT VT, ArrayRef<SDValue> Ops) {
7937 EVT VT1, EVT VT2, ArrayRef<SDValue> Ops) {
7950 ArrayRef<SDValue> Ops) {
7957 SDValue Op1, SDValue Op2) {
7959 SDValue Ops[] = { Op1, Op2 };
7964 SDVTList VTs,ArrayRef<SDValue> Ops) {
8009 SDVTList VTs, ArrayRef<SDValue> Ops) {
8033 Use.set(SDValue());
8077 SDValue InputChain = Node->getOperand(0);
8078 SDValue OutputChain = SDValue(Node, 1);
8081 SmallVector<SDValue, 3> Ops;
8116 EVT VT, SDValue Op1) {
8118 SDValue Ops[] = { Op1 };
8123 EVT VT, SDValue Op1, SDValue Op2) {
8125 SDValue Ops[] = { Op1, Op2 };
8130 EVT VT, SDValue Op1, SDValue Op2,
8131 SDValue Op3) {
8133 SDValue Ops[] = { Op1, Op2, Op3 };
8138 EVT VT, ArrayRef<SDValue> Ops) {
8144 EVT VT1, EVT VT2, SDValue Op1,
8145 SDValue Op2) {
8147 SDValue Ops[] = { Op1, Op2 };
8152 EVT VT1, EVT VT2, SDValue Op1,
8153 SDValue Op2, SDValue Op3) {
8155 SDValue Ops[] = { Op1, Op2, Op3 };
8161 ArrayRef<SDValue> Ops) {
8168 SDValue Op1, SDValue Op2) {
8170 SDValue Ops[] = { Op1, Op2 };
8176 SDValue Op1, SDValue Op2,
8177 SDValue Op3) {
8179 SDValue Ops[] = { Op1, Op2, Op3 };
8185 ArrayRef<SDValue> Ops) {
8192 ArrayRef<SDValue> Ops) {
8199 ArrayRef<SDValue> Ops) {
8221 NewSDValueDbgMsg(SDValue(N, 0), "Creating new machine node: ", this);
8227 SDValue SelectionDAG::getTargetExtractSubreg(int SRIdx, const SDLoc &DL, EVT VT,
8228 SDValue Operand) {
8229 SDValue SRIdxVal = getTargetConstant(SRIdx, DL, MVT::i32);
8232 return SDValue(Subreg, 0);
8237 SDValue SelectionDAG::getTargetInsertSubreg(int SRIdx, const SDLoc &DL, EVT VT,
8238 SDValue Operand, SDValue Subreg) {
8239 SDValue SRIdxVal = getTargetConstant(SRIdx, DL, MVT::i32);
8242 return SDValue(Result, 0);
8248 ArrayRef<SDValue> Ops,
8307 void SelectionDAG::transferDbgValues(SDValue From, SDValue To,
8379 SDValue N0 = N.getOperand(0);
8380 SDValue N1 = N.getOperand(1);
8446 void SelectionDAG::ReplaceAllUsesWith(SDValue FromN, SDValue To) {
8513 transferDbgValues(SDValue(From, i), SDValue(To, i));
8545 setRoot(SDValue(To, getRoot().getResNo()));
8553 void SelectionDAG::ReplaceAllUsesWith(SDNode *From, const SDValue *To) {
8555 return ReplaceAllUsesWith(SDValue(From, 0), To[0]);
8559 transferDbgValues(SDValue(From, i), To[i]);
8578 const SDValue &ToOp = To[Use.getResNo()];
8594 setRoot(SDValue(To[getRoot().getResNo()]));
8600 void SelectionDAG::ReplaceAllUsesOfValueWith(SDValue From, SDValue To){
8747 void SelectionDAG::ReplaceAllUsesOfValuesWith(const SDValue *From,
8748 const SDValue *To,
8907 SDValue SelectionDAG::makeEquivalentMemoryOrdering(LoadSDNode *OldLoad,
8908 SDValue NewMemOp) {
8914 SDValue OldChain = SDValue(OldLoad, 1);
8915 SDValue NewChain = SDValue(NewMemOp.getNode(), 1);
8919 SDValue TokenFactor =
8926 SDValue SelectionDAG::getSymbolFunctionGlobalAddress(SDValue Op,
8956 bool llvm::isNullConstant(SDValue V) {
8961 bool llvm::isNullFPConstant(SDValue V) {
8966 bool llvm::isAllOnesConstant(SDValue V) {
8971 bool llvm::isOneConstant(SDValue V) {
8976 SDValue llvm::peekThroughBitcasts(SDValue V) {
8982 SDValue llvm::peekThroughOneUseBitcasts(SDValue V) {
8988 SDValue llvm::peekThroughExtractSubvectors(SDValue V) {
8994 bool llvm::isBitwiseNot(SDValue V, bool AllowUndefs) {
9004 ConstantSDNode *llvm::isConstOrConstSplat(SDValue N, bool AllowUndefs,
9027 ConstantSDNode *llvm::isConstOrConstSplat(SDValue N, const APInt &DemandedElts,
9051 ConstantFPSDNode *llvm::isConstOrConstSplatFP(SDValue N, bool AllowUndefs) {
9065 ConstantFPSDNode *llvm::isConstOrConstSplatFP(SDValue N,
9082 bool llvm::isNullOrNullSplat(SDValue N, bool AllowUndefs) {
9088 bool llvm::isOneOrOneSplat(SDValue N) {
9095 bool llvm::isAllOnesOrAllOnesSplat(SDValue N) {
9234 bool SDValue::isOperandOf(const SDNode *N) const {
9235 return any_of(N->op_values(), [this](SDValue Op) { return *this == Op; });
9240 [this](SDValue Op) { return this == Op.getNode(); });
9253 bool SDValue::reachesChainWithoutSideEffects(SDValue Dest,
9278 return llvm::all_of((*this)->ops(), [=](SDValue Op) {
9302 SDValue
9309 return SDValue();
9312 SDValue Op = Extract->getOperand(0);
9316 return SDValue();
9326 return SDValue();
9335 auto PartialReduction = [&](SDValue Op, unsigned NumSubElts) {
9337 return SDValue();
9342 return SDValue();
9362 SDValue PrevOp;
9369 SDValue Op0 = Op.getOperand(0);
9370 SDValue Op1 = Op.getOperand(1);
9397 SDValue Op0 = Op.getOperand(0);
9398 SDValue Op1 = Op.getOperand(1);
9403 SDValue Src = Op0.getOperand(0);
9419 SDValue SelectionDAG::UnrollVectorOp(SDNode *N, unsigned ResNE) {
9428 SmallVector<SDValue, 8> Scalars;
9429 SmallVector<SDValue, 4> Operands(N->getNumOperands());
9440 SDValue Operand = N->getOperand(j);
9487 std::pair<SDValue, SDValue> SelectionDAG::UnrollVectorOverflowOp(
9508 SmallVector<SDValue, 8> LHSScalars;
9509 SmallVector<SDValue, 8> RHSScalars;
9515 SmallVector<SDValue, 8> ResScalars;
9516 SmallVector<SDValue, 8> OvScalars;
9518 SDValue Res = getNode(Opcode, dl, VTs, LHSScalars[i], RHSScalars[i]);
9519 SDValue Ov =
9565 MaybeAlign SelectionDAG::InferPtrAlign(SDValue Ptr) const {
9645 std::pair<SDValue, SDValue>
9646 SelectionDAG::SplitVector(const SDValue &N, const SDLoc &DL, const EVT &LoVT,
9655 SDValue Lo, Hi;
9668 SDValue SelectionDAG::WidenVector(const SDValue &N, const SDLoc &DL) {
9676 void SelectionDAG::ExtractVectorElements(SDValue Op,
9677 SmallVectorImpl<SDValue> &Args,
9729 SDValue OpVal = getOperand(i);
9769 SDValue BuildVectorSDNode::getSplatValue(const APInt &DemandedElts,
9778 return SDValue();
9779 SDValue Splatted;
9783 SDValue Op = getOperand(i);
9790 return SDValue();
9804 SDValue BuildVectorSDNode::getSplatValue(BitVector *UndefElements) const {
9852 for (const SDValue &Op : op_values()) {
9881 SDNode *SelectionDAG::isConstantIntBuildVectorOrConstantInt(SDValue N) {
9895 SDNode *SelectionDAG::isConstantFPBuildVectorOrConstantFP(SDValue N) {
9905 void SelectionDAG::createOperands(SDNode *Node, ArrayRef<SDValue> Vals) {
9927 SDValue SelectionDAG::getTokenFactor(const SDLoc &DL,
9928 SmallVectorImpl<SDValue> &Vals) {
9932 auto ExtractedTFs = ArrayRef<SDValue>(Vals).slice(SliceIdx, Limit);
9933 SDValue NewTF = getNode(ISD::TokenFactor, DL, MVT::Other, ExtractedTFs);
9958 for (const SDValue &Op : N->op_values())