Lines Matching defs:Node
90 SDValue UnrollVSETCC(SDNode *Node);
96 void Expand(SDNode *Node, SmallVectorImpl<SDValue> &Results);
100 void ExpandFP_TO_UINT(SDNode *Node, SmallVectorImpl<SDValue> &Results);
104 void ExpandUINT_TO_FLOAT(SDNode *Node, SmallVectorImpl<SDValue> &Results);
107 SDValue ExpandSEXTINREG(SDNode *Node);
114 SDValue ExpandANY_EXTEND_VECTOR_INREG(SDNode *Node);
121 SDValue ExpandSIGN_EXTEND_VECTOR_INREG(SDNode *Node);
127 SDValue ExpandZERO_EXTEND_VECTOR_INREG(SDNode *Node);
130 SDValue ExpandBSWAP(SDNode *Node);
134 SDValue ExpandVSELECT(SDNode *Node);
135 SDValue ExpandVP_SELECT(SDNode *Node);
136 SDValue ExpandVP_MERGE(SDNode *Node);
137 SDValue ExpandVP_REM(SDNode *Node);
138 SDValue ExpandSELECT(SDNode *Node);
141 SDValue ExpandFNEG(SDNode *Node);
142 void ExpandFSUB(SDNode *Node, SmallVectorImpl<SDValue> &Results);
143 void ExpandSETCC(SDNode *Node, SmallVectorImpl<SDValue> &Results);
144 void ExpandBITREVERSE(SDNode *Node, SmallVectorImpl<SDValue> &Results);
145 void ExpandUADDSUBO(SDNode *Node, SmallVectorImpl<SDValue> &Results);
146 void ExpandSADDSUBO(SDNode *Node, SmallVectorImpl<SDValue> &Results);
147 void ExpandMULO(SDNode *Node, SmallVectorImpl<SDValue> &Results);
148 void ExpandFixedPointDiv(SDNode *Node, SmallVectorImpl<SDValue> &Results);
149 void ExpandStrictFPOp(SDNode *Node, SmallVectorImpl<SDValue> &Results);
150 void ExpandREM(SDNode *Node, SmallVectorImpl<SDValue> &Results);
152 bool tryExpandVecMathCall(SDNode *Node, RTLIB::Libcall LC,
154 bool tryExpandVecMathCall(SDNode *Node, RTLIB::Libcall Call_F32,
160 void UnrollStrictFPOp(SDNode *Node, SmallVectorImpl<SDValue> &Results);
166 void Promote(SDNode *Node, SmallVectorImpl<SDValue> &Results);
171 void PromoteINT_TO_FP(SDNode *Node, SmallVectorImpl<SDValue> &Results);
177 void PromoteFP_TO_INT(SDNode *Node, SmallVectorImpl<SDValue> &Results);
183 void PromoteSETCC(SDNode *Node, SmallVectorImpl<SDValue> &Results);
185 void PromoteSTRICT(SDNode *Node, SmallVectorImpl<SDValue> &Results);
273 SDNode *Node = DAG.UpdateNodeOperands(Op.getNode(), Ops);
276 llvm::any_of(Node->values(), [](EVT T) { return T.isVector(); }) ||
277 llvm::any_of(Node->op_values(),
280 return TranslateLegalizeResults(Op, Node);
286 return TranslateLegalizeResults(Op, Node);
288 LoadSDNode *LD = cast<LoadSDNode>(Node);
296 StoreSDNode *ST = cast<StoreSDNode>(Node);
304 Action = TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0));
313 ValVT = Node->getValueType(0);
316 ValVT = Node->getOperand(1).getValueType();
319 MVT OpVT = Node->getOperand(1).getSimpleValueType();
320 ISD::CondCode CCCode = cast<CondCodeSDNode>(Node->getOperand(3))->get();
323 Action = TLI.getOperationAction(Node->getOpcode(), OpVT);
325 Action = TLI.getOperationAction(Node->getOpcode(), ValVT);
333 TLI.getStrictFPOperationAction(Node->getOpcode(), ValVT) ==
336 if (TLI.getOperationAction(Node->getOpcode(), EltVT)
338 TLI.getStrictFPOperationAction(Node->getOpcode(), EltVT)
461 Action = TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0));
471 unsigned Scale = Node->getConstantOperandVal(2);
472 Action = TLI.getFixedPointOperationAction(Node->getOpcode(),
473 Node->getValueType(0), Scale);
495 Action = TLI.getOperationAction(Node->getOpcode(),
496 Node->getOperand(0).getValueType());
500 Action = TLI.getOperationAction(Node->getOpcode(),
501 Node->getOperand(1).getValueType());
504 MVT OpVT = Node->getOperand(0).getSimpleValueType();
505 ISD::CondCode CCCode = cast<CondCodeSDNode>(Node->getOperand(2))->get();
508 Action = TLI.getOperationAction(Node->getOpcode(), OpVT);
514 EVT LegalizeVT = LEGALPOS < 0 ? Node->getValueType(-(1 + LEGALPOS)) \
515 : Node->getOperand(LEGALPOS).getValueType(); \
517 ISD::CondCode CCCode = cast<CondCodeSDNode>(Node->getOperand(2))->get(); \
523 if (!Node->getValueType(0).isVector() && \
524 Node->getValueType(0) != MVT::Other) { \
528 Action = TLI.getOperationAction(Node->getOpcode(), LegalizeVT); \
533 LLVM_DEBUG(dbgs() << "\nLegalizing vector op: "; Node->dump(&DAG));
542 Promote(Node, ResultVals);
550 if (LowerOperationWrapper(Node, ResultVals))
556 Expand(Node, ResultVals);
561 return TranslateLegalizeResults(Op, Node);
569 bool VectorLegalizer::LowerOperationWrapper(SDNode *Node,
571 SDValue Res = TLI.LowerOperation(SDValue(Node, 0), DAG);
576 if (Res == SDValue(Node, 0))
581 if (Node->getNumValues() == 1) {
588 assert((Node->getNumValues() == Res->getNumValues()) &&
592 for (unsigned I = 0, E = Node->getNumValues(); I != E; ++I)
598 void VectorLegalizer::PromoteSETCC(SDNode *Node,
600 MVT VecVT = Node->getOperand(0).getSimpleValueType();
601 MVT NewVecVT = TLI.getTypeToPromoteTo(Node->getOpcode(), VecVT);
605 SDLoc DL(Node);
606 SmallVector<SDValue, 5> Operands(Node->getNumOperands());
608 Operands[0] = DAG.getNode(ExtOp, DL, NewVecVT, Node->getOperand(0));
609 Operands[1] = DAG.getNode(ExtOp, DL, NewVecVT, Node->getOperand(1));
610 Operands[2] = Node->getOperand(2);
612 if (Node->getOpcode() == ISD::VP_SETCC) {
613 Operands[3] = Node->getOperand(3); // mask
614 Operands[4] = Node->getOperand(4); // evl
617 SDValue Res = DAG.getNode(Node->getOpcode(), DL, Node->getSimpleValueType(0),
618 Operands, Node->getFlags());
623 void VectorLegalizer::PromoteSTRICT(SDNode *Node,
625 MVT VecVT = Node->getOperand(1).getSimpleValueType();
626 MVT NewVecVT = TLI.getTypeToPromoteTo(Node->getOpcode(), VecVT);
630 SDLoc DL(Node);
631 SmallVector<SDValue, 5> Operands(Node->getNumOperands());
634 for (unsigned j = 1; j != Node->getNumOperands(); ++j)
635 if (Node->getOperand(j).getValueType().isVector() &&
636 !(ISD::isVPOpcode(Node->getOpcode()) &&
637 ISD::getVPMaskIdx(Node->getOpcode()) == j)) // Skip mask operand.
642 {Node->getOperand(0), Node->getOperand(j)});
646 Operands[j] = Node->getOperand(j); // Skip no vector operand.
648 SDVTList VTs = DAG.getVTList(NewVecVT, Node->getValueType(1));
653 DAG.getNode(Node->getOpcode(), DL, VTs, Operands, Node->getFlags());
664 void VectorLegalizer::Promote(SDNode *Node, SmallVectorImpl<SDValue> &Results) {
667 switch (Node->getOpcode()) {
673 PromoteINT_TO_FP(Node, Results);
680 PromoteFP_TO_INT(Node, Results);
685 PromoteSETCC(Node, Results);
693 PromoteSTRICT(Node, Results);
707 assert(Node->getNumValues() == 1 &&
709 MVT VT = Node->getSimpleValueType(0);
710 MVT NVT = TLI.getTypeToPromoteTo(Node->getOpcode(), VT);
711 SDLoc dl(Node);
712 SmallVector<SDValue, 4> Operands(Node->getNumOperands());
714 for (unsigned j = 0; j != Node->getNumOperands(); ++j) {
716 bool SkipPromote = ISD::isVPOpcode(Node->getOpcode()) &&
717 ISD::getVPMaskIdx(Node->getOpcode()) == j;
718 if (Node->getOperand(j).getValueType().isVector() && !SkipPromote)
719 if (Node->getOperand(j)
724 Operands[j] = DAG.getNode(ISD::FP_EXTEND, dl, NVT, Node->getOperand(j));
726 Operands[j] = DAG.getNode(ISD::BITCAST, dl, NVT, Node->getOperand(j));
728 Operands[j] = Node->getOperand(j);
732 DAG.getNode(Node->getOpcode(), dl, NVT, Operands, Node->getFlags());
745 void VectorLegalizer::PromoteINT_TO_FP(SDNode *Node,
749 bool IsStrict = Node->isStrictFPOpcode();
750 MVT VT = Node->getOperand(IsStrict ? 1 : 0).getSimpleValueType();
751 MVT NVT = TLI.getTypeToPromoteTo(Node->getOpcode(), VT);
755 SDLoc dl(Node);
756 SmallVector<SDValue, 4> Operands(Node->getNumOperands());
758 unsigned Opc = (Node->getOpcode() == ISD::UINT_TO_FP ||
759 Node->getOpcode() == ISD::STRICT_UINT_TO_FP)
762 for (unsigned j = 0; j != Node->getNumOperands(); ++j) {
763 if (Node->getOperand(j).getValueType().isVector())
764 Operands[j] = DAG.getNode(Opc, dl, NVT, Node->getOperand(j));
766 Operands[j] = Node->getOperand(j);
770 SDValue Res = DAG.getNode(Node->getOpcode(), dl,
771 {Node->getValueType(0), MVT::Other}, Operands);
778 DAG.getNode(Node->getOpcode(), dl, Node->getValueType(0), Operands);
786 void VectorLegalizer::PromoteFP_TO_INT(SDNode *Node,
788 MVT VT = Node->getSimpleValueType(0);
789 MVT NVT = TLI.getTypeToPromoteTo(Node->getOpcode(), VT);
790 bool IsStrict = Node->isStrictFPOpcode();
794 unsigned NewOpc = Node->getOpcode();
805 SDLoc dl(Node);
809 {Node->getOperand(0), Node->getOperand(1)});
812 Promoted = DAG.getNode(NewOpc, dl, NVT, Node->getOperand(0));
817 if (Node->getOpcode() == ISD::FP_TO_UINT ||
818 Node->getOpcode() == ISD::STRICT_FP_TO_UINT)
842 void VectorLegalizer::Expand(SDNode *Node, SmallVectorImpl<SDValue> &Results) {
843 switch (Node->getOpcode()) {
845 std::pair<SDValue, SDValue> Tmp = ExpandLoad(Node);
851 Results.push_back(ExpandStore(Node));
854 for (unsigned i = 0, e = Node->getNumValues(); i != e; ++i)
855 Results.push_back(Node->getOperand(i));
858 Results.push_back(ExpandSEXTINREG(Node));
861 Results.push_back(ExpandANY_EXTEND_VECTOR_INREG(Node));
864 Results.push_back(ExpandSIGN_EXTEND_VECTOR_INREG(Node));
867 Results.push_back(ExpandZERO_EXTEND_VECTOR_INREG(Node));
870 Results.push_back(ExpandBSWAP(Node));
873 Results.push_back(TLI.expandVPBSWAP(Node, DAG));
876 Results.push_back(ExpandVSELECT(Node));
879 Results.push_back(ExpandVP_SELECT(Node));
883 if (SDValue Expanded = ExpandVP_REM(Node)) {
889 Results.push_back(ExpandSELECT(Node));
892 if (Node->getValueType(0).isScalableVector()) {
894 DAG.getDataLayout(), *DAG.getContext(), Node->getValueType(0));
896 DAG.getNode(ISD::SETCC, SDLoc(Node), CondVT, Node->getOperand(0),
897 Node->getOperand(1), Node->getOperand(4));
898 Results.push_back(DAG.getSelect(SDLoc(Node), Node->getValueType(0), SetCC,
899 Node->getOperand(2),
900 Node->getOperand(3)));
906 ExpandFP_TO_UINT(Node, Results);
909 ExpandUINT_TO_FLOAT(Node, Results);
912 Results.push_back(ExpandFNEG(Node));
915 ExpandFSUB(Node, Results);
919 ExpandSETCC(Node, Results);
922 if (SDValue Expanded = TLI.expandABS(Node, DAG)) {
929 if (SDValue Expanded = TLI.expandABD(Node, DAG)) {
938 if (SDValue Expanded = TLI.expandAVG(Node, DAG)) {
944 ExpandBITREVERSE(Node, Results);
947 if (SDValue Expanded = TLI.expandVPBITREVERSE(Node, DAG)) {
953 if (SDValue Expanded = TLI.expandCTPOP(Node, DAG)) {
959 if (SDValue Expanded = TLI.expandVPCTPOP(Node, DAG)) {
966 if (SDValue Expanded = TLI.expandCTLZ(Node, DAG)) {
973 if (SDValue Expanded = TLI.expandVPCTLZ(Node, DAG)) {
980 if (SDValue Expanded = TLI.expandCTTZ(Node, DAG)) {
987 if (SDValue Expanded = TLI.expandVPCTTZ(Node, DAG)) {
996 if (SDValue Expanded = TLI.expandFunnelShift(Node, DAG)) {
1003 if (SDValue Expanded = TLI.expandROT(Node, false /*AllowVectorOps*/, DAG)) {
1010 if (SDValue Expanded = TLI.expandFMINNUM_FMAXNUM(Node, DAG)) {
1017 Results.push_back(TLI.expandFMINIMUM_FMAXIMUM(Node, DAG));
1023 if (SDValue Expanded = TLI.expandIntMINMAX(Node, DAG)) {
1030 ExpandUADDSUBO(Node, Results);
1034 ExpandSADDSUBO(Node, Results);
1038 ExpandMULO(Node, Results);
1044 if (SDValue Expanded = TLI.expandAddSubSat(Node, DAG)) {
1051 if (SDValue Expanded = TLI.expandShlSat(Node, DAG)) {
1059 if (Node->getValueType(0).isScalableVector()) {
1060 if (SDValue Expanded = TLI.expandFP_TO_INT_SAT(Node, DAG)) {
1068 if (SDValue Expanded = TLI.expandFixedPointMul(Node, DAG)) {
1082 ExpandFixedPointDiv(Node, Results);
1090 ExpandStrictFPOp(Node, Results);
1107 Results.push_back(TLI.expandVecReduce(Node, DAG));
1111 Results.push_back(TLI.expandVecReduceSeq(Node, DAG));
1115 ExpandREM(Node, Results);
1118 Results.push_back(ExpandVP_MERGE(Node));
1121 if (tryExpandVecMathCall(Node, RTLIB::REM_F32, RTLIB::REM_F64,
1128 Results.push_back(TLI.expandVECTOR_COMPRESS(Node, DAG));
1132 SDValue Unrolled = DAG.UnrollVectorOp(Node);
1133 if (Node->getNumValues() == 1) {
1136 assert(Node->getNumValues() == Unrolled->getNumValues() &&
1143 SDValue VectorLegalizer::ExpandSELECT(SDNode *Node) {
1147 EVT VT = Node->getValueType(0);
1148 SDLoc DL(Node);
1150 SDValue Mask = Node->getOperand(0);
1151 SDValue Op1 = Node->getOperand(1);
1152 SDValue Op2 = Node->getOperand(2);
1171 return DAG.UnrollVectorOp(Node);
1196 return DAG.getNode(ISD::BITCAST, DL, Node->getValueType(0), Val);
1199 SDValue VectorLegalizer::ExpandSEXTINREG(SDNode *Node) {
1200 EVT VT = Node->getValueType(0);
1205 return DAG.UnrollVectorOp(Node);
1207 SDLoc DL(Node);
1208 EVT OrigTy = cast<VTSDNode>(Node->getOperand(1))->getVT();
1214 SDValue Op = DAG.getNode(ISD::SHL, DL, VT, Node->getOperand(0), ShiftSz);
1220 SDValue VectorLegalizer::ExpandANY_EXTEND_VECTOR_INREG(SDNode *Node) {
1221 SDLoc DL(Node);
1222 EVT VT = Node->getValueType(0);
1224 SDValue Src = Node->getOperand(0);
1255 SDValue VectorLegalizer::ExpandSIGN_EXTEND_VECTOR_INREG(SDNode *Node) {
1256 SDLoc DL(Node);
1257 EVT VT = Node->getValueType(0);
1258 SDValue Src = Node->getOperand(0);
1279 SDValue VectorLegalizer::ExpandZERO_EXTEND_VECTOR_INREG(SDNode *Node) {
1280 SDLoc DL(Node);
1281 EVT VT = Node->getValueType(0);
1283 SDValue Src = Node->getOperand(0);
1322 SDValue VectorLegalizer::ExpandBSWAP(SDNode *Node) {
1323 EVT VT = Node->getValueType(0);
1327 return TLI.expandBSWAP(Node, DAG);
1336 SDLoc DL(Node);
1337 SDValue Op = DAG.getNode(ISD::BITCAST, DL, ByteVT, Node->getOperand(0));
1348 return TLI.expandBSWAP(Node, DAG);
1351 return DAG.UnrollVectorOp(Node);
1354 void VectorLegalizer::ExpandBITREVERSE(SDNode *Node,
1356 EVT VT = Node->getValueType(0);
1360 Results.push_back(TLI.expandBITREVERSE(Node, DAG));
1366 SDValue Tmp = DAG.UnrollVectorOp(Node);
1386 SDLoc DL(Node);
1387 SDValue Op = DAG.getNode(ISD::BITCAST, DL, ByteVT, Node->getOperand(0));
1403 Results.push_back(TLI.expandBITREVERSE(Node, DAG));
1408 SDValue Tmp = DAG.UnrollVectorOp(Node);
1412 SDValue VectorLegalizer::ExpandVSELECT(SDNode *Node) {
1415 SDLoc DL(Node);
1417 SDValue Mask = Node->getOperand(0);
1418 SDValue Op1 = Node->getOperand(1);
1419 SDValue Op2 = Node->getOperand(2);
1430 return DAG.UnrollVectorOp(Node);
1440 return DAG.UnrollVectorOp(Node);
1446 return DAG.UnrollVectorOp(Node);
1459 return DAG.getNode(ISD::BITCAST, DL, Node->getValueType(0), Val);
1462 SDValue VectorLegalizer::ExpandVP_SELECT(SDNode *Node) {
1465 SDLoc DL(Node);
1467 SDValue Mask = Node->getOperand(0);
1468 SDValue Op1 = Node->getOperand(1);
1469 SDValue Op2 = Node->getOperand(2);
1470 SDValue EVL = Node->getOperand(3);
1479 return DAG.UnrollVectorOp(Node);
1483 return DAG.UnrollVectorOp(Node);
1493 SDValue VectorLegalizer::ExpandVP_MERGE(SDNode *Node) {
1498 SDLoc DL(Node);
1500 SDValue Mask = Node->getOperand(0);
1501 SDValue Op1 = Node->getOperand(1);
1502 SDValue Op2 = Node->getOperand(2);
1503 SDValue EVL = Node->getOperand(3);
1517 return DAG.UnrollVectorOp(Node);
1523 return DAG.UnrollVectorOp(Node);
1531 return DAG.getSelect(DL, Node->getValueType(0), FullMask, Op1, Op2);
1534 SDValue VectorLegalizer::ExpandVP_REM(SDNode *Node) {
1536 EVT VT = Node->getValueType(0);
1538 unsigned DivOpc = Node->getOpcode() == ISD::VP_SREM ? ISD::VP_SDIV : ISD::VP_UDIV;
1545 SDLoc DL(Node);
1547 SDValue Dividend = Node->getOperand(0);
1548 SDValue Divisor = Node->getOperand(1);
1549 SDValue Mask = Node->getOperand(2);
1550 SDValue EVL = Node->getOperand(3);
1558 void VectorLegalizer::ExpandFP_TO_UINT(SDNode *Node,
1562 if (TLI.expandFP_TO_UINT(Node, Result, Chain, DAG)) {
1564 if (Node->isStrictFPOpcode())
1570 if (Node->isStrictFPOpcode()) {
1571 UnrollStrictFPOp(Node, Results);
1575 Results.push_back(DAG.UnrollVectorOp(Node));
1578 void VectorLegalizer::ExpandUINT_TO_FLOAT(SDNode *Node,
1580 bool IsStrict = Node->isStrictFPOpcode();
1582 SDValue Src = Node->getOperand(OpNo);
1584 SDLoc DL(Node);
1589 if (TLI.expandUINT_TO_FP(Node, Result, Chain, DAG)) {
1603 UnrollStrictFPOp(Node, Results);
1607 Results.push_back(DAG.UnrollVectorOp(Node));
1625 DAG.getConstantFP(1ULL << (BW / 2), DL, Node->getValueType(0));
1636 {Node->getValueType(0), MVT::Other},
1637 {Node->getOperand(0), HI});
1638 fHI = DAG.getNode(ISD::STRICT_FMUL, DL, {Node->getValueType(0), MVT::Other},
1641 {Node->getValueType(0), MVT::Other},
1642 {Node->getOperand(0), LO});
1649 DAG.getNode(ISD::STRICT_FADD, DL, {Node->getValueType(0), MVT::Other},
1660 SDValue fHI = DAG.getNode(ISD::SINT_TO_FP, DL, Node->getValueType(0), HI);
1661 fHI = DAG.getNode(ISD::FMUL, DL, Node->getValueType(0), fHI, TWOHW);
1662 SDValue fLO = DAG.getNode(ISD::SINT_TO_FP, DL, Node->getValueType(0), LO);
1666 DAG.getNode(ISD::FADD, DL, Node->getValueType(0), fHI, fLO));
1669 SDValue VectorLegalizer::ExpandFNEG(SDNode *Node) {
1670 if (TLI.isOperationLegalOrCustom(ISD::FSUB, Node->getValueType(0))) {
1671 SDLoc DL(Node);
1672 SDValue Zero = DAG.getConstantFP(-0.0, DL, Node->getValueType(0));
1674 return DAG.getNode(ISD::FSUB, DL, Node->getValueType(0), Zero,
1675 Node->getOperand(0));
1677 return DAG.UnrollVectorOp(Node);
1680 void VectorLegalizer::ExpandFSUB(SDNode *Node,
1685 EVT VT = Node->getValueType(0);
1690 SDValue Tmp = DAG.UnrollVectorOp(Node);
1694 void VectorLegalizer::ExpandSETCC(SDNode *Node,
1697 bool IsVP = Node->getOpcode() == ISD::VP_SETCC;
1698 bool IsStrict = Node->getOpcode() == ISD::STRICT_FSETCC ||
1699 Node->getOpcode() == ISD::STRICT_FSETCCS;
1700 bool IsSignaling = Node->getOpcode() == ISD::STRICT_FSETCCS;
1703 SDValue Chain = IsStrict ? Node->getOperand(0) : SDValue();
1704 SDValue LHS = Node->getOperand(0 + Offset);
1705 SDValue RHS = Node->getOperand(1 + Offset);
1706 SDValue CC = Node->getOperand(2 + Offset);
1713 UnrollStrictFPOp(Node, Results);
1716 Results.push_back(UnrollVSETCC(Node));
1722 Mask = Node->getOperand(3 + Offset);
1723 EVL = Node->getOperand(4 + Offset);
1726 SDLoc dl(Node);
1728 TLI.LegalizeSetCCCondCode(DAG, Node->getValueType(0), LHS, RHS, CC, Mask,
1736 LHS = DAG.getNode(Node->getOpcode(), dl, Node->getVTList(),
1737 {Chain, LHS, RHS, CC}, Node->getFlags());
1740 LHS = DAG.getNode(ISD::VP_SETCC, dl, Node->getValueType(0),
1741 {LHS, RHS, CC, Mask, EVL}, Node->getFlags());
1743 LHS = DAG.getNode(ISD::SETCC, dl, Node->getValueType(0), LHS, RHS, CC,
1744 Node->getFlags());
1761 EVT VT = Node->getValueType(0);
1766 LHS->setFlags(Node->getFlags());
1774 void VectorLegalizer::ExpandUADDSUBO(SDNode *Node,
1777 TLI.expandUADDSUBO(Node, Result, Overflow, DAG);
1782 void VectorLegalizer::ExpandSADDSUBO(SDNode *Node,
1785 TLI.expandSADDSUBO(Node, Result, Overflow, DAG);
1790 void VectorLegalizer::ExpandMULO(SDNode *Node,
1793 if (!TLI.expandMULO(Node, Result, Overflow, DAG))
1794 std::tie(Result, Overflow) = DAG.UnrollVectorOverflowOp(Node);
1800 void VectorLegalizer::ExpandFixedPointDiv(SDNode *Node,
1802 SDNode *N = Node;
1808 void VectorLegalizer::ExpandStrictFPOp(SDNode *Node,
1810 if (Node->getOpcode() == ISD::STRICT_UINT_TO_FP) {
1811 ExpandUINT_TO_FLOAT(Node, Results);
1814 if (Node->getOpcode() == ISD::STRICT_FP_TO_UINT) {
1815 ExpandFP_TO_UINT(Node, Results);
1819 if (Node->getOpcode() == ISD::STRICT_FSETCC ||
1820 Node->getOpcode() == ISD::STRICT_FSETCCS) {
1821 ExpandSETCC(Node, Results);
1825 UnrollStrictFPOp(Node, Results);
1828 void VectorLegalizer::ExpandREM(SDNode *Node,
1830 assert((Node->getOpcode() == ISD::SREM || Node->getOpcode() == ISD::UREM) &&
1834 if (!TLI.expandREM(Node, Result, DAG))
1835 Result = DAG.UnrollVectorOp(Node);
1840 // LibFunc equivalent of the passed in Node, which is used to lookup mappings
1845 bool VectorLegalizer::tryExpandVecMathCall(SDNode *Node, RTLIB::Libcall LC,
1849 assert(!Node->isStrictFPOpcode() && "Unexpected strict fp operation!");
1856 EVT VT = Node->getValueType(0);
1872 // Construct a scalar function type based on Node's operands.
1874 for (unsigned i = 0; i < Node->getNumOperands(); ++i) {
1875 assert(Node->getOperand(i).getValueType() == VT &&
1892 Node->getNumOperands() + VD->isMasked())
1897 SDLoc DL(Node);
1907 Entry.Node = DAG.getBoolConstant(true, DL, MaskVT, VT);
1917 Entry.Node = Node->getOperand(OpNum++);
1937 SDNode *Node, RTLIB::Libcall Call_F32, RTLIB::Libcall Call_F64,
1941 Node->getValueType(0).getVectorElementType(), Call_F32, Call_F64,
1947 return tryExpandVecMathCall(Node, LC, Results);
1950 void VectorLegalizer::UnrollStrictFPOp(SDNode *Node,
1952 EVT VT = Node->getValueType(0);
1955 unsigned NumOpers = Node->getNumOperands();
1959 if (Node->getOpcode() == ISD::STRICT_FSETCC ||
1960 Node->getOpcode() == ISD::STRICT_FSETCCS)
1965 SDValue Chain = Node->getOperand(0);
1966 SDLoc dl(Node);
1979 SDValue Oper = Node->getOperand(j);
1989 SDValue ScalarOp = DAG.getNode(Node->getOpcode(), dl, ValueVTs, Opers);
1993 if (Node->getOpcode() == ISD::STRICT_FSETCC ||
1994 Node->getOpcode() == ISD::STRICT_FSETCCS)
2010 SDValue VectorLegalizer::UnrollVSETCC(SDNode *Node) {
2011 EVT VT = Node->getValueType(0);
2014 SDValue LHS = Node->getOperand(0);
2015 SDValue RHS = Node->getOperand(1);
2016 SDValue CC = Node->getOperand(2);
2018 SDLoc dl(Node);