• Home
  • Raw
  • Download

Lines Matching refs:N0

252     SDValue visitANDLike(SDValue N0, SDValue N1, SDNode *LocReference);
254 SDValue visitORLike(SDValue N0, SDValue N1, SDNode *LocReference);
339 SDValue SimplifySelect(const SDLoc &DL, SDValue N0, SDValue N1, SDValue N2);
340 SDValue SimplifySelectCC(const SDLoc &DL, SDValue N0, SDValue N1,
343 SDValue SimplifySetCC(EVT VT, SDValue N0, SDValue N1, ISD::CondCode Cond,
367 SDValue MatchBSwapHWordLow(SDNode *N, SDValue N0, SDValue N1,
369 SDValue MatchBSwapHWord(SDNode *N, SDValue N0, SDValue N1);
762 SDValue N0, N1, N2; in isOneUseSetCC() local
763 if (isSetCCEquivalent(N, N0, N1, N2) && N.getNode()->hasOneUse()) in isOneUseSetCC()
816 SDValue DAGCombiner::ReassociateOps(unsigned Opc, const SDLoc &DL, SDValue N0, in ReassociateOps() argument
818 EVT VT = N0.getValueType(); in ReassociateOps()
819 if (N0.getOpcode() == Opc) { in ReassociateOps()
820 if (SDNode *L = DAG.isConstantIntBuildVectorOrConstantInt(N0.getOperand(1))) { in ReassociateOps()
824 return DAG.getNode(Opc, DL, VT, N0.getOperand(0), OpNode); in ReassociateOps()
827 if (N0.hasOneUse()) { in ReassociateOps()
830 SDValue OpNode = DAG.getNode(Opc, SDLoc(N0), VT, N0.getOperand(0), N1); in ReassociateOps()
834 return DAG.getNode(Opc, DL, VT, OpNode, N0.getOperand(1)); in ReassociateOps()
841 if (SDNode *L = DAG.isConstantIntBuildVectorOrConstantInt(N0)) { in ReassociateOps()
850 SDValue OpNode = DAG.getNode(Opc, SDLoc(N0), VT, N0, N1.getOperand(0)); in ReassociateOps()
1048 SDValue N0 = Op.getOperand(0); in PromoteIntBinOp() local
1049 SDValue NN0 = PromoteOperand(N0, PVT, Replace0); in PromoteIntBinOp()
1056 if (N0 == N1) in PromoteIntBinOp()
1069 ReplaceLoadWithPromotedLoad(N0.getNode(), NN0.getNode()); in PromoteIntBinOp()
1106 SDValue N0 = Op.getOperand(0); in PromoteIntShiftOp() local
1108 N0 = SExtPromoteOperand(Op.getOperand(0), PVT); in PromoteIntShiftOp()
1110 N0 = ZExtPromoteOperand(Op.getOperand(0), PVT); in PromoteIntShiftOp()
1112 N0 = PromoteOperand(N0, PVT, Replace); in PromoteIntShiftOp()
1113 if (!N0.getNode()) in PromoteIntShiftOp()
1116 AddToWorklist(N0.getNode()); in PromoteIntShiftOp()
1118 ReplaceLoadWithPromotedLoad(Op.getOperand(0).getNode(), N0.getNode()); in PromoteIntShiftOp()
1124 DAG.getNode(Opc, dl, PVT, N0, Op.getOperand(1))); in PromoteIntShiftOp()
1500 SDValue N0 = N->getOperand(0); in combine() local
1504 if (isa<ConstantSDNode>(N0) || !isa<ConstantSDNode>(N1)) { in combine()
1505 SDValue Ops[] = {N1, N0}; in combine()
1634 SDValue N0 = N->getOperand(0); in visitADD() local
1636 EVT VT = N0.getValueType(); in visitADD()
1645 return N0; in visitADD()
1646 if (ISD::isBuildVectorAllZeros(N0.getNode())) in visitADD()
1651 if (N0.isUndef()) in visitADD()
1652 return N0; in visitADD()
1655 if (DAG.isConstantIntBuildVectorOrConstantInt(N0)) { in visitADD()
1658 return DAG.getNode(ISD::ADD, SDLoc(N), VT, N1, N0); in visitADD()
1661 N0.getNode(), N1.getNode()); in visitADD()
1665 return N0; in visitADD()
1668 if (N0.getOpcode() == ISD::SUB) in visitADD()
1669 if (ConstantSDNode *N0C = getAsNonOpaqueConstant(N0.getOperand(0))) { in visitADD()
1674 N0.getOperand(1)); in visitADD()
1678 if (SDValue RADD = ReassociateOps(ISD::ADD, SDLoc(N), N0, N1)) in visitADD()
1681 if (N0.getOpcode() == ISD::SUB && isNullConstant(N0.getOperand(0))) in visitADD()
1682 return DAG.getNode(ISD::SUB, SDLoc(N), VT, N1, N0.getOperand(1)); in visitADD()
1685 return DAG.getNode(ISD::SUB, SDLoc(N), VT, N0, N1.getOperand(1)); in visitADD()
1687 if (N1.getOpcode() == ISD::SUB && N0 == N1.getOperand(1)) in visitADD()
1690 if (N0.getOpcode() == ISD::SUB && N1 == N0.getOperand(1)) in visitADD()
1691 return N0.getOperand(0); in visitADD()
1694 N0 == N1.getOperand(1).getOperand(0)) in visitADD()
1699 N0 == N1.getOperand(1).getOperand(1)) in visitADD()
1705 N0 == N1.getOperand(0).getOperand(1)) in visitADD()
1710 if (N0.getOpcode() == ISD::SUB && N1.getOpcode() == ISD::SUB) { in visitADD()
1711 SDValue N00 = N0.getOperand(0); in visitADD()
1712 SDValue N01 = N0.getOperand(1); in visitADD()
1718 DAG.getNode(ISD::ADD, SDLoc(N0), VT, N00, N10), in visitADD()
1727 VT.isInteger() && !VT.isVector() && DAG.haveNoCommonBitsSet(N0, N1)) in visitADD()
1728 return DAG.getNode(ISD::OR, SDLoc(N), VT, N0, N1); in visitADD()
1733 return DAG.getNode(ISD::SUB, SDLoc(N), VT, N0, in visitADD()
1737 if (N0.getOpcode() == ISD::SHL && N0.getOperand(0).getOpcode() == ISD::SUB && in visitADD()
1738 isNullConstant(N0.getOperand(0).getOperand(0))) in visitADD()
1741 N0.getOperand(0).getOperand(1), in visitADD()
1742 N0.getOperand(1))); in visitADD()
1758 if (N0.getOpcode() == ISD::SIGN_EXTEND && in visitADD()
1759 N0.getOperand(0).getValueType() == MVT::i1 && in visitADD()
1762 SDValue ZExt = DAG.getNode(ISD::ZERO_EXTEND, DL, VT, N0.getOperand(0)); in visitADD()
1773 return DAG.getNode(ISD::SUB, DL, VT, N0, ZExt); in visitADD()
1781 SDValue N0 = N->getOperand(0); in visitADDC() local
1783 EVT VT = N0.getValueType(); in visitADDC()
1787 return CombineTo(N, DAG.getNode(ISD::ADD, SDLoc(N), VT, N0, N1), in visitADDC()
1792 ConstantSDNode *N0C = dyn_cast<ConstantSDNode>(N0); in visitADDC()
1795 return DAG.getNode(ISD::ADDC, SDLoc(N), N->getVTList(), N1, N0); in visitADDC()
1799 return CombineTo(N, N0, DAG.getNode(ISD::CARRY_FALSE, in visitADDC()
1805 DAG.computeKnownBits(N0, LHSZero, LHSOne); in visitADDC()
1813 return CombineTo(N, DAG.getNode(ISD::OR, SDLoc(N), VT, N0, N1), in visitADDC()
1822 SDValue N0 = N->getOperand(0); in visitADDE() local
1827 ConstantSDNode *N0C = dyn_cast<ConstantSDNode>(N0); in visitADDE()
1831 N1, N0, CarryIn); in visitADDE()
1835 return DAG.getNode(ISD::ADDC, SDLoc(N), N->getVTList(), N0, N1); in visitADDE()
1853 SDValue N0 = N->getOperand(0); in visitSUB() local
1855 EVT VT = N0.getValueType(); in visitSUB()
1864 return N0; in visitSUB()
1869 if (N0 == N1) in visitSUB()
1871 if (DAG.isConstantIntBuildVectorOrConstantInt(N0) && in visitSUB()
1875 N0.getNode(), N1.getNode()); in visitSUB()
1877 ConstantSDNode *N0C = getAsNonOpaqueConstant(N0); in visitSUB()
1882 return DAG.getNode(ISD::ADD, DL, VT, N0, in visitSUB()
1886 if (isAllOnesConstant(N0)) in visitSUB()
1887 return DAG.getNode(ISD::XOR, SDLoc(N), VT, N1, N0); in visitSUB()
1889 if (N1.getOpcode() == ISD::SUB && N0 == N1.getOperand(0)) in visitSUB()
1892 if (N0.getOpcode() == ISD::ADD && N0.getOperand(0) == N1) in visitSUB()
1893 return N0.getOperand(1); in visitSUB()
1895 if (N0.getOpcode() == ISD::ADD && N0.getOperand(1) == N1) in visitSUB()
1896 return N0.getOperand(0); in visitSUB()
1908 if (N0.getOpcode() == ISD::ADD && in visitSUB()
1909 (N0.getOperand(1).getOpcode() == ISD::SUB || in visitSUB()
1910 N0.getOperand(1).getOpcode() == ISD::ADD) && in visitSUB()
1911 N0.getOperand(1).getOperand(0) == N1) in visitSUB()
1912 return DAG.getNode(N0.getOperand(1).getOpcode(), SDLoc(N), VT, in visitSUB()
1913 N0.getOperand(0), N0.getOperand(1).getOperand(1)); in visitSUB()
1915 if (N0.getOpcode() == ISD::ADD && in visitSUB()
1916 N0.getOperand(1).getOpcode() == ISD::ADD && in visitSUB()
1917 N0.getOperand(1).getOperand(1) == N1) in visitSUB()
1919 N0.getOperand(0), N0.getOperand(1).getOperand(0)); in visitSUB()
1921 if (N0.getOpcode() == ISD::SUB && in visitSUB()
1922 N0.getOperand(1).getOpcode() == ISD::SUB && in visitSUB()
1923 N0.getOperand(1).getOperand(1) == N1) in visitSUB()
1925 N0.getOperand(0), N0.getOperand(1).getOperand(0)); in visitSUB()
1928 if (N0.isUndef()) in visitSUB()
1929 return N0; in visitSUB()
1934 if (GlobalAddressSDNode *GA = dyn_cast<GlobalAddressSDNode>(N0)) in visitSUB()
1955 return DAG.getNode(ISD::ADD, DL, VT, N0, ZExt); in visitSUB()
1963 SDValue N0 = N->getOperand(0); in visitSUBC() local
1965 EVT VT = N0.getValueType(); in visitSUBC()
1970 return CombineTo(N, DAG.getNode(ISD::SUB, DL, VT, N0, N1), in visitSUBC()
1974 if (N0 == N1) in visitSUBC()
1980 return CombineTo(N, N0, DAG.getNode(ISD::CARRY_FALSE, DL, MVT::Glue)); in visitSUBC()
1983 if (isAllOnesConstant(N0)) in visitSUBC()
1984 return CombineTo(N, DAG.getNode(ISD::XOR, DL, VT, N1, N0), in visitSUBC()
1991 SDValue N0 = N->getOperand(0); in visitSUBE() local
1997 return DAG.getNode(ISD::SUBC, SDLoc(N), N->getVTList(), N0, N1); in visitSUBE()
2003 SDValue N0 = N->getOperand(0); in visitMUL() local
2005 EVT VT = N0.getValueType(); in visitMUL()
2008 if (N0.isUndef() || N1.isUndef()) in visitMUL()
2021 N0IsConst = ISD::isConstantSplatVector(N0.getNode(), ConstValue0); in visitMUL()
2024 N0IsConst = isa<ConstantSDNode>(N0); in visitMUL()
2026 ConstValue0 = cast<ConstantSDNode>(N0)->getAPIntValue(); in visitMUL()
2027 N0IsOpaqueConst = cast<ConstantSDNode>(N0)->isOpaque(); in visitMUL()
2039 N0.getNode(), N1.getNode()); in visitMUL()
2042 if (DAG.isConstantIntBuildVectorOrConstantInt(N0) && in visitMUL()
2044 return DAG.getNode(ISD::MUL, SDLoc(N), VT, N1, N0); in visitMUL()
2054 return N0; in visitMUL()
2059 DAG.getConstant(0, DL, VT), N0); in visitMUL()
2065 return DAG.getNode(ISD::SHL, DL, VT, N0, in visitMUL()
2067 getShiftAmountTy(N0.getValueType()))); in visitMUL()
2078 DAG.getNode(ISD::SHL, DL, VT, N0, in visitMUL()
2080 getShiftAmountTy(N0.getValueType())))); in visitMUL()
2085 if (N1IsConst && N0.getOpcode() == ISD::SHL && in visitMUL()
2086 (ISD::isConstantSplatVector(N0.getOperand(1).getNode(), Val) || in visitMUL()
2087 isa<ConstantSDNode>(N0.getOperand(1)))) { in visitMUL()
2088 SDValue C3 = DAG.getNode(ISD::SHL, SDLoc(N), VT, N1, N0.getOperand(1)); in visitMUL()
2090 return DAG.getNode(ISD::MUL, SDLoc(N), VT, N0.getOperand(0), C3); in visitMUL()
2098 if (N0.getOpcode() == ISD::SHL && in visitMUL()
2099 (ISD::isConstantSplatVector(N0.getOperand(1).getNode(), Val) || in visitMUL()
2100 isa<ConstantSDNode>(N0.getOperand(1))) && in visitMUL()
2101 N0.getNode()->hasOneUse()) { in visitMUL()
2102 Sh = N0; Y = N1; in visitMUL()
2106 Sh = N1; Y = N0; in visitMUL()
2117 N0.getOpcode() == ISD::ADD && in visitMUL()
2118 DAG.isConstantIntBuildVectorOrConstantInt(N0.getOperand(1)) && in visitMUL()
2119 isMulAddWithConstProfitable(N, N0, N1)) in visitMUL()
2121 DAG.getNode(ISD::MUL, SDLoc(N0), VT, in visitMUL()
2122 N0.getOperand(0), N1), in visitMUL()
2124 N0.getOperand(1), N1)); in visitMUL()
2127 if (SDValue RMUL = ReassociateOps(ISD::MUL, SDLoc(N), N0, N1)) in visitMUL()
2223 SDValue N0 = N->getOperand(0); in visitSDIV() local
2235 ConstantSDNode *N0C = isConstOrConstSplat(N0); in visitSDIV()
2241 return N0; in visitSDIV()
2245 DAG.getConstant(0, DL, VT), N0); in visitSDIV()
2250 if (DAG.SignBitIsZero(N1) && DAG.SignBitIsZero(N0)) in visitSDIV()
2251 return DAG.getNode(ISD::UDIV, DL, N1.getValueType(), N0, N1); in visitSDIV()
2270 DAG.getNode(ISD::SRA, DL, VT, N0, in visitSDIV()
2272 getShiftAmountTy(N0.getValueType()))); in visitSDIV()
2280 SDValue ADD = DAG.getNode(ISD::ADD, DL, VT, N0, SRL); in visitSDIV()
2312 if (N0.isUndef()) in visitSDIV()
2322 SDValue N0 = N->getOperand(0); in visitUDIV() local
2334 ConstantSDNode *N0C = isConstOrConstSplat(N0); in visitUDIV()
2342 return DAG.getNode(ISD::SRL, DL, VT, N0, in visitUDIV()
2344 getShiftAmountTy(N0.getValueType()))); in visitUDIV()
2357 return DAG.getNode(ISD::SRL, DL, VT, N0, Add); in visitUDIV()
2376 if (N0.isUndef()) in visitUDIV()
2388 SDValue N0 = N->getOperand(0); in visitREM() local
2395 ConstantSDNode *N0C = isConstOrConstSplat(N0); in visitREM()
2405 if (DAG.SignBitIsZero(N1) && DAG.SignBitIsZero(N0)) in visitREM()
2406 return DAG.getNode(ISD::UREM, DL, VT, N0, N1); in visitREM()
2412 return DAG.getNode(ISD::AND, DL, VT, N0, in visitREM()
2423 return DAG.getNode(ISD::AND, DL, VT, N0, Add); in visitREM()
2440 SDValue Div = DAG.getNode(DivOpcode, DL, VT, N0, N1); in visitREM()
2447 SDValue Sub = DAG.getNode(ISD::SUB, DL, VT, N0, Mul); in visitREM()
2458 if (N0.isUndef()) in visitREM()
2468 SDValue N0 = N->getOperand(0); in visitMULHS() local
2479 return DAG.getNode(ISD::SRA, DL, N0.getValueType(), N0, in visitMULHS()
2480 DAG.getConstant(N0.getValueType().getSizeInBits() - 1, in visitMULHS()
2482 getShiftAmountTy(N0.getValueType()))); in visitMULHS()
2485 if (N0.isUndef() || N1.isUndef()) in visitMULHS()
2495 N0 = DAG.getNode(ISD::SIGN_EXTEND, DL, NewVT, N0); in visitMULHS()
2497 N1 = DAG.getNode(ISD::MUL, DL, NewVT, N0, N1); in visitMULHS()
2509 SDValue N0 = N->getOperand(0); in visitMULHU() local
2519 return DAG.getConstant(0, DL, N0.getValueType()); in visitMULHU()
2521 if (N0.isUndef() || N1.isUndef()) in visitMULHU()
2531 N0 = DAG.getNode(ISD::ZERO_EXTEND, DL, NewVT, N0); in visitMULHU()
2533 N1 = DAG.getNode(ISD::MUL, DL, NewVT, N0, N1); in visitMULHU()
2678 SDValue N0 = N->getOperand(0); in visitIMINMAX() local
2680 EVT VT = N0.getValueType(); in visitIMINMAX()
2688 ConstantSDNode *N0C = getAsNonOpaqueConstant(N0); in visitIMINMAX()
2694 if (DAG.isConstantIntBuildVectorOrConstantInt(N0) && in visitIMINMAX()
2696 return DAG.getNode(N->getOpcode(), SDLoc(N), VT, N1, N0); in visitIMINMAX()
2704 SDValue N0 = N->getOperand(0), N1 = N->getOperand(1); in SimplifyBinOpWithSameOpcodeHands() local
2705 EVT VT = N0.getValueType(); in SimplifyBinOpWithSameOpcodeHands()
2706 assert(N0.getOpcode() == N1.getOpcode() && "Bad input!"); in SimplifyBinOpWithSameOpcodeHands()
2709 if (N0.getNode()->getNumOperands() == 0) return SDValue(); in SimplifyBinOpWithSameOpcodeHands()
2720 EVT Op0VT = N0.getOperand(0).getValueType(); in SimplifyBinOpWithSameOpcodeHands()
2721 if ((N0.getOpcode() == ISD::ZERO_EXTEND || in SimplifyBinOpWithSameOpcodeHands()
2722 N0.getOpcode() == ISD::SIGN_EXTEND || in SimplifyBinOpWithSameOpcodeHands()
2723 N0.getOpcode() == ISD::BSWAP || in SimplifyBinOpWithSameOpcodeHands()
2725 (N0.getOpcode() == ISD::ANY_EXTEND && in SimplifyBinOpWithSameOpcodeHands()
2727 (N0.getOpcode() == ISD::TRUNCATE && in SimplifyBinOpWithSameOpcodeHands()
2734 SDValue ORNode = DAG.getNode(N->getOpcode(), SDLoc(N0), in SimplifyBinOpWithSameOpcodeHands()
2735 N0.getOperand(0).getValueType(), in SimplifyBinOpWithSameOpcodeHands()
2736 N0.getOperand(0), N1.getOperand(0)); in SimplifyBinOpWithSameOpcodeHands()
2738 return DAG.getNode(N0.getOpcode(), SDLoc(N), VT, ORNode); in SimplifyBinOpWithSameOpcodeHands()
2745 if ((N0.getOpcode() == ISD::SHL || N0.getOpcode() == ISD::SRL || in SimplifyBinOpWithSameOpcodeHands()
2746 N0.getOpcode() == ISD::SRA || N0.getOpcode() == ISD::AND) && in SimplifyBinOpWithSameOpcodeHands()
2747 N0.getOperand(1) == N1.getOperand(1)) { in SimplifyBinOpWithSameOpcodeHands()
2748 SDValue ORNode = DAG.getNode(N->getOpcode(), SDLoc(N0), in SimplifyBinOpWithSameOpcodeHands()
2749 N0.getOperand(0).getValueType(), in SimplifyBinOpWithSameOpcodeHands()
2750 N0.getOperand(0), N1.getOperand(0)); in SimplifyBinOpWithSameOpcodeHands()
2752 return DAG.getNode(N0.getOpcode(), SDLoc(N), VT, in SimplifyBinOpWithSameOpcodeHands()
2753 ORNode, N0.getOperand(1)); in SimplifyBinOpWithSameOpcodeHands()
2763 if ((N0.getOpcode() == ISD::BITCAST || in SimplifyBinOpWithSameOpcodeHands()
2764 N0.getOpcode() == ISD::SCALAR_TO_VECTOR) && in SimplifyBinOpWithSameOpcodeHands()
2766 SDValue In0 = N0.getOperand(0); in SimplifyBinOpWithSameOpcodeHands()
2775 SDValue BC = DAG.getNode(N0.getOpcode(), DL, VT, Op); in SimplifyBinOpWithSameOpcodeHands()
2793 if (N0.getOpcode() == ISD::VECTOR_SHUFFLE && Level < AfterLegalizeDAG) { in SimplifyBinOpWithSameOpcodeHands()
2794 ShuffleVectorSDNode *SVN0 = cast<ShuffleVectorSDNode>(N0); in SimplifyBinOpWithSameOpcodeHands()
2797 assert(N0.getOperand(0).getValueType() == N1.getOperand(0).getValueType() && in SimplifyBinOpWithSameOpcodeHands()
2806 SDValue ShOp = N0->getOperand(1); in SimplifyBinOpWithSameOpcodeHands()
2820 if (N0.getOperand(1) == N1.getOperand(1) && ShOp.getNode()) { in SimplifyBinOpWithSameOpcodeHands()
2822 N0->getOperand(0), N1->getOperand(0)); in SimplifyBinOpWithSameOpcodeHands()
2830 ShOp = N0->getOperand(0); in SimplifyBinOpWithSameOpcodeHands()
2841 if (N0->getOperand(0) == N1->getOperand(0) && ShOp.getNode()) { in SimplifyBinOpWithSameOpcodeHands()
2843 N0->getOperand(1), N1->getOperand(1)); in SimplifyBinOpWithSameOpcodeHands()
2858 SDValue DAGCombiner::visitANDLike(SDValue N0, SDValue N1, in visitANDLike() argument
2863 if (N0.isUndef() || N1.isUndef()) in visitANDLike()
2867 if (isSetCCEquivalent(N0, LL, LR, CC0) && isSetCCEquivalent(N1, RL, RR, CC1)){ in visitANDLike()
2875 SDValue ORNode = DAG.getNode(ISD::OR, SDLoc(N0), in visitANDLike()
2883 SDValue ANDNode = DAG.getNode(ISD::AND, SDLoc(N0), in visitANDLike()
2890 SDValue ORNode = DAG.getNode(ISD::OR, SDLoc(N0), in visitANDLike()
2902 SDLoc DL(N0); in visitANDLike()
2924 if (N0.getValueType() == CCVT || in visitANDLike()
2925 (!LegalOperations && N0.getValueType() == MVT::i1)) in visitANDLike()
2926 return DAG.getSetCC(SDLoc(LocReference), N0.getValueType(), in visitANDLike()
2932 if (N0.getOpcode() == ISD::ADD && N1.getOpcode() == ISD::SRL && in visitANDLike()
2934 if (ConstantSDNode *ADDI = dyn_cast<ConstantSDNode>(N0.getOperand(1))) { in visitANDLike()
2944 if (DAG.MaskedValueIsZero(N0.getOperand(1), Mask)) { in visitANDLike()
2947 SDLoc DL(N0); in visitANDLike()
2950 N0.getOperand(0), DAG.getConstant(ADDC, DL, VT)); in visitANDLike()
2951 CombineTo(N0.getNode(), NewAdd); in visitANDLike()
2964 if (N0.getOpcode() == ISD::SRL && N0.hasOneUse()) { in visitANDLike()
2966 if (ConstantSDNode *CShift = dyn_cast<ConstantSDNode>(N0.getOperand(1))) { in visitANDLike()
2987 SDValue SL(N0); in visitANDLike()
2993 N0.getOperand(0)); in visitANDLike()
3049 SDValue N0 = N->getOperand(0); in visitAND() local
3059 if (ISD::isBuildVectorAllZeros(N0.getNode())) in visitAND()
3063 N0.getValueType().getScalarType().getSizeInBits()), in visitAND()
3064 SDLoc(N), N0.getValueType()); in visitAND()
3073 if (ISD::isBuildVectorAllOnes(N0.getNode())) in visitAND()
3076 return N0; in visitAND()
3080 ConstantSDNode *N0C = getAsNonOpaqueConstant(N0); in visitAND()
3085 if (DAG.isConstantIntBuildVectorOrConstantInt(N0) && in visitAND()
3087 return DAG.getNode(ISD::AND, SDLoc(N), VT, N1, N0); in visitAND()
3090 return N0; in visitAND()
3097 if (SDValue RAND = ReassociateOps(ISD::AND, SDLoc(N), N0, N1)) in visitAND()
3100 if (N1C && N0.getOpcode() == ISD::OR) in visitAND()
3101 if (ConstantSDNode *ORI = dyn_cast<ConstantSDNode>(N0.getOperand(1))) in visitAND()
3105 if (N1C && N0.getOpcode() == ISD::ANY_EXTEND) { in visitAND()
3106 SDValue N0Op0 = N0.getOperand(0); in visitAND()
3111 N0.getValueType(), N0Op0); in visitAND()
3119 CombineTo(N0.getNode(), Zext); in visitAND()
3129 if ((N0.getOpcode() == ISD::EXTRACT_VECTOR_ELT && in visitAND()
3130 N0.getValueSizeInBits() == N0.getOperand(0).getScalarValueSizeInBits() && in visitAND()
3131 N0.getOperand(0).getOpcode() == ISD::LOAD && in visitAND()
3132 N0.getOperand(0).getResNo() == 0) || in visitAND()
3133 (N0.getOpcode() == ISD::LOAD && N0.getResNo() == 0)) { in visitAND()
3134 LoadSDNode *Load = cast<LoadSDNode>( (N0.getOpcode() == ISD::LOAD) ? in visitAND()
3135 N0 : N0.getOperand(0) ); in visitAND()
3224 CombineTo(N, (N0.getNode() == Load) ? NewLoad : N0); in visitAND()
3233 if (N1C && (N0.getOpcode() == ISD::LOAD || in visitAND()
3234 (N0.getOpcode() == ISD::ANY_EXTEND && in visitAND()
3235 N0.getOperand(0).getOpcode() == ISD::LOAD))) { in visitAND()
3236 bool HasAnyExt = N0.getOpcode() == ISD::ANY_EXTEND; in visitAND()
3238 ? cast<LoadSDNode>(N0.getOperand(0)) in visitAND()
3239 : cast<LoadSDNode>(N0); in visitAND()
3241 LN0->isUnindexed() && N0.hasOneUse() && SDValue(LN0, 0).hasOneUse()) { in visitAND()
3290 if (SDValue Combined = visitANDLike(N0, N1, N)) in visitAND()
3294 if (N0.getOpcode() == N1.getOpcode()) in visitAND()
3305 if (ISD::isEXTLoad(N0.getNode()) && ISD::isUNINDEXEDLoad(N0.getNode())) { in visitAND()
3306 LoadSDNode *LN0 = cast<LoadSDNode>(N0); in visitAND()
3315 SDValue ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, SDLoc(N0), VT, in visitAND()
3319 CombineTo(N0.getNode(), ExtLoad, ExtLoad.getValue(1)); in visitAND()
3324 if (ISD::isSEXTLoad(N0.getNode()) && ISD::isUNINDEXEDLoad(N0.getNode()) && in visitAND()
3325 N0.hasOneUse()) { in visitAND()
3326 LoadSDNode *LN0 = cast<LoadSDNode>(N0); in visitAND()
3335 SDValue ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, SDLoc(N0), VT, in visitAND()
3339 CombineTo(N0.getNode(), ExtLoad, ExtLoad.getValue(1)); in visitAND()
3344 if (N1C && N1C->getAPIntValue() == 0xffff && N0.getOpcode() == ISD::OR) { in visitAND()
3345 if (SDValue BSwap = MatchBSwapHWordLow(N0.getNode(), N0.getOperand(0), in visitAND()
3346 N0.getOperand(1), false)) in visitAND()
3354 SDValue DAGCombiner::MatchBSwapHWordLow(SDNode *N, SDValue N0, SDValue N1, in MatchBSwapHWordLow() argument
3368 if (N0.getOpcode() == ISD::AND && N0.getOperand(0).getOpcode() == ISD::SRL) in MatchBSwapHWordLow()
3369 std::swap(N0, N1); in MatchBSwapHWordLow()
3371 std::swap(N0, N1); in MatchBSwapHWordLow()
3372 if (N0.getOpcode() == ISD::AND) { in MatchBSwapHWordLow()
3373 if (!N0.getNode()->hasOneUse()) in MatchBSwapHWordLow()
3375 ConstantSDNode *N01C = dyn_cast<ConstantSDNode>(N0.getOperand(1)); in MatchBSwapHWordLow()
3378 N0 = N0.getOperand(0); in MatchBSwapHWordLow()
3392 if (N0.getOpcode() == ISD::SRL && N1.getOpcode() == ISD::SHL) in MatchBSwapHWordLow()
3393 std::swap(N0, N1); in MatchBSwapHWordLow()
3394 if (N0.getOpcode() != ISD::SHL || N1.getOpcode() != ISD::SRL) in MatchBSwapHWordLow()
3396 if (!N0.getNode()->hasOneUse() || in MatchBSwapHWordLow()
3400 ConstantSDNode *N01C = dyn_cast<ConstantSDNode>(N0.getOperand(1)); in MatchBSwapHWordLow()
3408 SDValue N00 = N0->getOperand(0); in MatchBSwapHWordLow()
3490 SDValue N0 = N.getOperand(0); in isBSwapHWordElement() local
3495 if (N0.getOpcode() != ISD::SRL) in isBSwapHWordElement()
3497 ConstantSDNode *C = dyn_cast<ConstantSDNode>(N0.getOperand(1)); in isBSwapHWordElement()
3503 if (N0.getOpcode() != ISD::SHL) in isBSwapHWordElement()
3505 ConstantSDNode *C = dyn_cast<ConstantSDNode>(N0.getOperand(1)); in isBSwapHWordElement()
3530 Parts[Num] = N0.getOperand(0).getNode(); in isBSwapHWordElement()
3540 SDValue DAGCombiner::MatchBSwapHWord(SDNode *N, SDValue N0, SDValue N1) { in MatchBSwapHWord() argument
3553 if (N0.getOpcode() != ISD::OR) in MatchBSwapHWord()
3555 SDValue N00 = N0.getOperand(0); in MatchBSwapHWord()
3556 SDValue N01 = N0.getOperand(1); in MatchBSwapHWord()
3613 SDValue DAGCombiner::visitORLike(SDValue N0, SDValue N1, SDNode *LocReference) { in visitORLike() argument
3617 (N0.isUndef() || N1.isUndef())) { in visitORLike()
3624 if (isSetCCEquivalent(N0, LL, LR, CC0) && isSetCCEquivalent(N1, RL, RR, CC1)){ in visitORLike()
3659 if (N0.getValueType() == CCVT || in visitORLike()
3660 (!LegalOperations && N0.getValueType() == MVT::i1)) in visitORLike()
3661 return DAG.getSetCC(SDLoc(LocReference), N0.getValueType(), in visitORLike()
3668 if (N0.getOpcode() == ISD::AND && N1.getOpcode() == ISD::AND && in visitORLike()
3670 (N0.getNode()->hasOneUse() || N1.getNode()->hasOneUse())) { in visitORLike()
3674 getAsNonOpaqueConstant(N0.getOperand(1))) { in visitORLike()
3682 if (DAG.MaskedValueIsZero(N0.getOperand(0), RHSMask&~LHSMask) && in visitORLike()
3684 SDValue X = DAG.getNode(ISD::OR, SDLoc(N0), VT, in visitORLike()
3685 N0.getOperand(0), N1.getOperand(0)); in visitORLike()
3695 if (N0.getOpcode() == ISD::AND && in visitORLike()
3697 N0.getOperand(0) == N1.getOperand(0) && in visitORLike()
3699 (N0.getNode()->hasOneUse() || N1.getNode()->hasOneUse())) { in visitORLike()
3700 SDValue X = DAG.getNode(ISD::OR, SDLoc(N0), VT, in visitORLike()
3701 N0.getOperand(1), N1.getOperand(1)); in visitORLike()
3702 return DAG.getNode(ISD::AND, SDLoc(LocReference), VT, N0.getOperand(0), X); in visitORLike()
3709 SDValue N0 = N->getOperand(0); in visitOR() local
3719 if (ISD::isBuildVectorAllZeros(N0.getNode())) in visitOR()
3722 return N0; in visitOR()
3725 if (ISD::isBuildVectorAllOnes(N0.getNode())) in visitOR()
3729 N0.getValueType().getScalarType().getSizeInBits()), in visitOR()
3730 SDLoc(N), N0.getValueType()); in visitOR()
3740 if (isa<ShuffleVectorSDNode>(N0) && in visitOR()
3744 bool ZeroN00 = ISD::isBuildVectorAllZeros(N0.getOperand(0).getNode()); in visitOR()
3745 bool ZeroN01 = ISD::isBuildVectorAllZeros(N0.getOperand(1).getNode()); in visitOR()
3752 const ShuffleVectorSDNode *SV0 = cast<ShuffleVectorSDNode>(N0); in visitOR()
3789 SDValue NewLHS = ZeroN00 ? N0.getOperand(1) : N0.getOperand(0); in visitOR()
3807 ConstantSDNode *N0C = getAsNonOpaqueConstant(N0); in visitOR()
3812 if (DAG.isConstantIntBuildVectorOrConstantInt(N0) && in visitOR()
3814 return DAG.getNode(ISD::OR, SDLoc(N), VT, N1, N0); in visitOR()
3817 return N0; in visitOR()
3822 if (N1C && DAG.MaskedValueIsZero(N0, ~N1C->getAPIntValue())) in visitOR()
3825 if (SDValue Combined = visitORLike(N0, N1, N)) in visitOR()
3829 if (SDValue BSwap = MatchBSwapHWord(N, N0, N1)) in visitOR()
3831 if (SDValue BSwap = MatchBSwapHWordLow(N, N0, N1)) in visitOR()
3835 if (SDValue ROR = ReassociateOps(ISD::OR, SDLoc(N), N0, N1)) in visitOR()
3839 if (N1C && N0.getOpcode() == ISD::AND && N0.getNode()->hasOneUse() && in visitOR()
3840 isa<ConstantSDNode>(N0.getOperand(1))) { in visitOR()
3841 ConstantSDNode *C1 = cast<ConstantSDNode>(N0.getOperand(1)); in visitOR()
3847 DAG.getNode(ISD::OR, SDLoc(N0), VT, N0.getOperand(0), N1), COR); in visitOR()
3852 if (N0.getOpcode() == N1.getOpcode()) in visitOR()
3857 if (SDNode *Rot = MatchRotate(N0, N1, SDLoc(N))) in visitOR()
4128 SDValue N0 = N->getOperand(0); in visitXOR() local
4130 EVT VT = N0.getValueType(); in visitXOR()
4138 if (ISD::isBuildVectorAllZeros(N0.getNode())) in visitXOR()
4141 return N0; in visitXOR()
4145 if (N0.isUndef() && N1.isUndef()) in visitXOR()
4148 if (N0.isUndef()) in visitXOR()
4149 return N0; in visitXOR()
4153 ConstantSDNode *N0C = getAsNonOpaqueConstant(N0); in visitXOR()
4158 if (DAG.isConstantIntBuildVectorOrConstantInt(N0) && in visitXOR()
4160 return DAG.getNode(ISD::XOR, SDLoc(N), VT, N1, N0); in visitXOR()
4163 return N0; in visitXOR()
4165 if (SDValue RXOR = ReassociateOps(ISD::XOR, SDLoc(N), N0, N1)) in visitXOR()
4170 if (TLI.isConstTrueVal(N1.getNode()) && isSetCCEquivalent(N0, LHS, RHS, CC)) { in visitXOR()
4177 switch (N0.getOpcode()) { in visitXOR()
4183 return DAG.getSelectCC(SDLoc(N), LHS, RHS, N0.getOperand(2), in visitXOR()
4184 N0.getOperand(3), NotCC); in visitXOR()
4190 if (isOneConstant(N1) && N0.getOpcode() == ISD::ZERO_EXTEND && in visitXOR()
4191 N0.getNode()->hasOneUse() && in visitXOR()
4192 isSetCCEquivalent(N0.getOperand(0), LHS, RHS, CC)){ in visitXOR()
4193 SDValue V = N0.getOperand(0); in visitXOR()
4194 SDLoc DL(N0); in visitXOR()
4203 (N0.getOpcode() == ISD::OR || N0.getOpcode() == ISD::AND)) { in visitXOR()
4204 SDValue LHS = N0.getOperand(0), RHS = N0.getOperand(1); in visitXOR()
4206 unsigned NewOpcode = N0.getOpcode() == ISD::AND ? ISD::OR : ISD::AND; in visitXOR()
4215 (N0.getOpcode() == ISD::OR || N0.getOpcode() == ISD::AND)) { in visitXOR()
4216 SDValue LHS = N0.getOperand(0), RHS = N0.getOperand(1); in visitXOR()
4218 unsigned NewOpcode = N0.getOpcode() == ISD::AND ? ISD::OR : ISD::AND; in visitXOR()
4226 if (N0.getOpcode() == ISD::AND && N0.getNode()->hasOneUse() && in visitXOR()
4227 N0->getOperand(1) == N1) { in visitXOR()
4228 SDValue X = N0->getOperand(0); in visitXOR()
4234 if (N1C && N0.getOpcode() == ISD::XOR) { in visitXOR()
4235 if (const ConstantSDNode *N00C = getAsNonOpaqueConstant(N0.getOperand(0))) { in visitXOR()
4237 return DAG.getNode(ISD::XOR, DL, VT, N0.getOperand(1), in visitXOR()
4241 if (const ConstantSDNode *N01C = getAsNonOpaqueConstant(N0.getOperand(1))) { in visitXOR()
4243 return DAG.getNode(ISD::XOR, DL, VT, N0.getOperand(0), in visitXOR()
4249 if (N0 == N1) in visitXOR()
4270 if (TLI.isOperationLegalOrCustom(ISD::ROTL, VT) && N0.getOpcode() == ISD::SHL in visitXOR()
4271 && isAllOnesConstant(N1) && isOneConstant(N0.getOperand(0))) { in visitXOR()
4274 N0.getOperand(1)); in visitXOR()
4278 if (N0.getOpcode() == N1.getOpcode()) in visitXOR()
4403 SDValue N0 = N->getOperand(0); in visitSHL() local
4405 EVT VT = N0.getValueType(); in visitSHL()
4418 if (N0.getOpcode() == ISD::AND) { in visitSHL()
4419 SDValue N00 = N0->getOperand(0); in visitSHL()
4420 SDValue N01 = N0->getOperand(1); in visitSHL()
4437 ConstantSDNode *N0C = getAsNonOpaqueConstant(N0); in visitSHL()
4441 if (isNullConstant(N0)) in visitSHL()
4442 return N0; in visitSHL()
4448 return N0; in visitSHL()
4450 if (N0.isUndef()) in visitSHL()
4460 return DAG.getNode(ISD::SHL, SDLoc(N), VT, N0, NewOp1); in visitSHL()
4467 if (N1C && N0.getOpcode() == ISD::SHL) { in visitSHL()
4468 if (ConstantSDNode *N0C1 = isConstOrConstSplat(N0.getOperand(1))) { in visitSHL()
4474 return DAG.getNode(ISD::SHL, DL, VT, N0.getOperand(0), in visitSHL()
4484 if (N1C && (N0.getOpcode() == ISD::ZERO_EXTEND || in visitSHL()
4485 N0.getOpcode() == ISD::ANY_EXTEND || in visitSHL()
4486 N0.getOpcode() == ISD::SIGN_EXTEND) && in visitSHL()
4487 N0.getOperand(0).getOpcode() == ISD::SHL) { in visitSHL()
4488 SDValue N0Op0 = N0.getOperand(0); in visitSHL()
4495 SDLoc DL(N0); in visitSHL()
4499 DAG.getNode(N0.getOpcode(), DL, VT, in visitSHL()
4509 if (N1C && N0.getOpcode() == ISD::ZERO_EXTEND && N0.hasOneUse() && in visitSHL()
4510 N0.getOperand(0).getOpcode() == ISD::SRL) { in visitSHL()
4511 SDValue N0Op0 = N0.getOperand(0); in visitSHL()
4517 SDValue NewOp0 = N0.getOperand(0); in visitSHL()
4524 return DAG.getNode(ISD::ZERO_EXTEND, SDLoc(N0), VT, NewSHL); in visitSHL()
4532 if (N1C && (N0.getOpcode() == ISD::SRL || N0.getOpcode() == ISD::SRA) && in visitSHL()
4533 cast<BinaryWithFlagsSDNode>(N0)->Flags.hasExact()) { in visitSHL()
4534 if (ConstantSDNode *N0C1 = isConstOrConstSplat(N0.getOperand(1))) { in visitSHL()
4539 return DAG.getNode(ISD::SHL, DL, VT, N0.getOperand(0), in visitSHL()
4541 return DAG.getNode(N0.getOpcode(), DL, VT, N0.getOperand(0), in visitSHL()
4550 if (N1C && N0.getOpcode() == ISD::SRL && N0.hasOneUse()) { in visitSHL()
4551 if (ConstantSDNode *N0C1 = isConstOrConstSplat(N0.getOperand(1))) { in visitSHL()
4560 Shift = DAG.getNode(ISD::SHL, DL, VT, N0.getOperand(0), in visitSHL()
4565 Shift = DAG.getNode(ISD::SRL, DL, VT, N0.getOperand(0), in visitSHL()
4568 SDLoc DL(N0); in visitSHL()
4575 if (N1C && N0.getOpcode() == ISD::SRA && N1 == N0.getOperand(1)) { in visitSHL()
4582 return DAG.getNode(ISD::AND, DL, VT, N0.getOperand(0), in visitSHL()
4590 if (N1C && N0.getOpcode() == ISD::ADD && N0.getNode()->hasOneUse() && in visitSHL()
4591 (isa<ConstantSDNode>(N0.getOperand(1)) || in visitSHL()
4592 ISD::isConstantSplatVector(N0.getOperand(1).getNode(), Val))) { in visitSHL()
4593 SDValue Shl0 = DAG.getNode(ISD::SHL, SDLoc(N0), VT, N0.getOperand(0), N1); in visitSHL()
4594 SDValue Shl1 = DAG.getNode(ISD::SHL, SDLoc(N1), VT, N0.getOperand(1), N1); in visitSHL()
4599 if (N1C && N0.getOpcode() == ISD::MUL && N0.getNode()->hasOneUse()) { in visitSHL()
4600 if (ConstantSDNode *N0C1 = isConstOrConstSplat(N0.getOperand(1))) { in visitSHL()
4603 return DAG.getNode(ISD::MUL, SDLoc(N), VT, N0.getOperand(0), Folded); in visitSHL()
4615 SDValue N0 = N->getOperand(0); in visitSRA() local
4617 EVT VT = N0.getValueType(); in visitSRA()
4630 ConstantSDNode *N0C = getAsNonOpaqueConstant(N0); in visitSRA()
4634 if (isNullConstant(N0)) in visitSRA()
4635 return N0; in visitSRA()
4637 if (isAllOnesConstant(N0)) in visitSRA()
4638 return N0; in visitSRA()
4644 return N0; in visitSRA()
4647 if (N1C && N0.getOpcode() == ISD::SHL && N1 == N0.getOperand(1)) { in visitSRA()
4656 N0.getOperand(0), DAG.getValueType(ExtVT)); in visitSRA()
4660 if (N1C && N0.getOpcode() == ISD::SRA) { in visitSRA()
4661 if (ConstantSDNode *C1 = isConstOrConstSplat(N0.getOperand(1))) { in visitSRA()
4666 return DAG.getNode(ISD::SRA, DL, VT, N0.getOperand(0), in visitSRA()
4676 if (N0.getOpcode() == ISD::SHL && N1C) { in visitSRA()
4678 const ConstantSDNode *N01C = isConstOrConstSplat(N0.getOperand(1)); in visitSRA()
4701 getShiftAmountTy(N0.getOperand(0).getValueType())); in visitSRA()
4703 N0.getOperand(0), Amt); in visitSRA()
4716 return DAG.getNode(ISD::SRA, SDLoc(N), VT, N0, NewOp1); in visitSRA()
4721 if (N0.getOpcode() == ISD::TRUNCATE && in visitSRA()
4722 (N0.getOperand(0).getOpcode() == ISD::SRL || in visitSRA()
4723 N0.getOperand(0).getOpcode() == ISD::SRA) && in visitSRA()
4724 N0.getOperand(0).hasOneUse() && in visitSRA()
4725 N0.getOperand(0).getOperand(1).hasOneUse() && in visitSRA()
4727 SDValue N0Op0 = N0.getOperand(0); in visitSRA()
4750 if (DAG.SignBitIsZero(N0)) in visitSRA()
4751 return DAG.getNode(ISD::SRL, SDLoc(N), VT, N0, N1); in visitSRA()
4761 SDValue N0 = N->getOperand(0); in visitSRL() local
4763 EVT VT = N0.getValueType(); in visitSRL()
4776 ConstantSDNode *N0C = getAsNonOpaqueConstant(N0); in visitSRL()
4780 if (isNullConstant(N0)) in visitSRL()
4781 return N0; in visitSRL()
4787 return N0; in visitSRL()
4794 if (N1C && N0.getOpcode() == ISD::SRL) { in visitSRL()
4795 if (ConstantSDNode *N01C = isConstOrConstSplat(N0.getOperand(1))) { in visitSRL()
4801 return DAG.getNode(ISD::SRL, DL, VT, N0.getOperand(0), in visitSRL()
4807 if (N1C && N0.getOpcode() == ISD::TRUNCATE && in visitSRL()
4808 N0.getOperand(0).getOpcode() == ISD::SRL && in visitSRL()
4809 isa<ConstantSDNode>(N0.getOperand(0)->getOperand(1))) { in visitSRL()
4811 cast<ConstantSDNode>(N0.getOperand(0)->getOperand(1))->getZExtValue(); in visitSRL()
4813 EVT InnerShiftVT = N0.getOperand(0).getValueType(); in visitSRL()
4814 EVT ShiftCountVT = N0.getOperand(0)->getOperand(1).getValueType(); in visitSRL()
4818 SDLoc DL(N0); in visitSRL()
4823 N0.getOperand(0)->getOperand(0), in visitSRL()
4830 if (N1C && N0.getOpcode() == ISD::SHL && N0.getOperand(1) == N1) { in visitSRL()
4831 unsigned BitSize = N0.getScalarValueSizeInBits(); in visitSRL()
4835 return DAG.getNode(ISD::AND, DL, VT, N0.getOperand(0), in visitSRL()
4841 if (N1C && N0.getOpcode() == ISD::ANY_EXTEND) { in visitSRL()
4843 EVT SmallVT = N0.getOperand(0).getValueType(); in visitSRL()
4850 SDLoc DL0(N0); in visitSRL()
4852 N0.getOperand(0), in visitSRL()
4867 if (N0.getOpcode() == ISD::SRA) in visitSRL()
4868 return DAG.getNode(ISD::SRL, SDLoc(N), VT, N0.getOperand(0), N1); in visitSRL()
4872 if (N1C && N0.getOpcode() == ISD::CTLZ && in visitSRL()
4875 DAG.computeKnownBits(N0.getOperand(0), KnownZero, KnownOne); in visitSRL()
4879 if (KnownOne.getBoolValue()) return DAG.getConstant(0, SDLoc(N0), VT); in visitSRL()
4884 if (UnknownBits == 0) return DAG.getConstant(1, SDLoc(N0), VT); in visitSRL()
4893 SDValue Op = N0.getOperand(0); in visitSRL()
4896 SDLoc DL(N0); in visitSRL()
4913 return DAG.getNode(ISD::SRL, SDLoc(N), VT, N0, NewOp1); in visitSRL()
4962 SDValue N0 = N->getOperand(0); in visitBSWAP() local
4966 if (DAG.isConstantIntBuildVectorOrConstantInt(N0)) in visitBSWAP()
4967 return DAG.getNode(ISD::BSWAP, SDLoc(N), VT, N0); in visitBSWAP()
4969 if (N0.getOpcode() == ISD::BSWAP) in visitBSWAP()
4970 return N0->getOperand(0); in visitBSWAP()
4975 SDValue N0 = N->getOperand(0); in visitBITREVERSE() local
4978 if (N0.getOpcode() == ISD::BITREVERSE) in visitBITREVERSE()
4979 return N0.getOperand(0); in visitBITREVERSE()
4984 SDValue N0 = N->getOperand(0); in visitCTLZ() local
4988 if (DAG.isConstantIntBuildVectorOrConstantInt(N0)) in visitCTLZ()
4989 return DAG.getNode(ISD::CTLZ, SDLoc(N), VT, N0); in visitCTLZ()
4994 SDValue N0 = N->getOperand(0); in visitCTLZ_ZERO_UNDEF() local
4998 if (DAG.isConstantIntBuildVectorOrConstantInt(N0)) in visitCTLZ_ZERO_UNDEF()
4999 return DAG.getNode(ISD::CTLZ_ZERO_UNDEF, SDLoc(N), VT, N0); in visitCTLZ_ZERO_UNDEF()
5004 SDValue N0 = N->getOperand(0); in visitCTTZ() local
5008 if (DAG.isConstantIntBuildVectorOrConstantInt(N0)) in visitCTTZ()
5009 return DAG.getNode(ISD::CTTZ, SDLoc(N), VT, N0); in visitCTTZ()
5014 SDValue N0 = N->getOperand(0); in visitCTTZ_ZERO_UNDEF() local
5018 if (DAG.isConstantIntBuildVectorOrConstantInt(N0)) in visitCTTZ_ZERO_UNDEF()
5019 return DAG.getNode(ISD::CTTZ_ZERO_UNDEF, SDLoc(N), VT, N0); in visitCTTZ_ZERO_UNDEF()
5024 SDValue N0 = N->getOperand(0); in visitCTPOP() local
5028 if (DAG.isConstantIntBuildVectorOrConstantInt(N0)) in visitCTPOP()
5029 return DAG.getNode(ISD::CTPOP, SDLoc(N), VT, N0); in visitCTPOP()
5071 SDValue N0 = N->getOperand(0); in visitSELECT() local
5075 EVT VT0 = N0.getValueType(); in visitSELECT()
5080 if (const ConstantSDNode *N0C = dyn_cast<const ConstantSDNode>(N0)) { in visitSELECT()
5087 return DAG.getNode(ISD::OR, SDLoc(N), VT, N0, N2); in visitSELECT()
5108 N0, DAG.getConstant(1, DL, VT0)); in visitSELECT()
5110 SDLoc DL0(N0); in visitSELECT()
5112 N0, DAG.getConstant(1, DL0, VT0)); in visitSELECT()
5120 SDValue NOTNode = DAG.getNOT(SDLoc(N0), N0, VT); in visitSELECT()
5126 SDValue NOTNode = DAG.getNOT(SDLoc(N0), N0, VT); in visitSELECT()
5132 return DAG.getNode(ISD::AND, SDLoc(N), VT, N0, N1); in visitSELECT()
5135 if (VT == MVT::i1 && (N0 == N1 || isOneConstant(N1))) in visitSELECT()
5136 return DAG.getNode(ISD::OR, SDLoc(N), VT, N0, N2); in visitSELECT()
5139 if (VT == MVT::i1 && (N0 == N2 || isNullConstant(N2))) in visitSELECT()
5140 return DAG.getNode(ISD::AND, SDLoc(N), VT, N0, N1); in visitSELECT()
5159 if (N0->getOpcode() == ISD::AND && N0->hasOneUse()) { in visitSELECT()
5160 SDValue Cond0 = N0->getOperand(0); in visitSELECT()
5161 SDValue Cond1 = N0->getOperand(1); in visitSELECT()
5169 if (N0->getOpcode() == ISD::OR && N0->hasOneUse()) { in visitSELECT()
5170 SDValue Cond0 = N0->getOperand(0); in visitSELECT()
5171 SDValue Cond1 = N0->getOperand(1); in visitSELECT()
5184 if (N1_2 == N2 && N0.getValueType() == N1_0.getValueType()) { in visitSELECT()
5187 SDValue And = DAG.getNode(ISD::AND, SDLoc(N), N0.getValueType(), in visitSELECT()
5188 N0, N1_0); in visitSELECT()
5193 if (SDValue Combined = visitANDLike(N0, N1_0, N)) in visitSELECT()
5203 if (N2_1 == N1 && N0.getValueType() == N2_0.getValueType()) { in visitSELECT()
5206 SDValue Or = DAG.getNode(ISD::OR, SDLoc(N), N0.getValueType(), in visitSELECT()
5207 N0, N2_0); in visitSELECT()
5212 if (SDValue Combined = visitORLike(N0, N2_0, N)) in visitSELECT()
5220 if (N0.getOpcode() == ISD::SETCC) { in visitSELECT()
5232 VT.isFloatingPoint() && N0.hasOneUse() && in visitSELECT()
5234 ISD::CondCode CC = cast<CondCodeSDNode>(N0.getOperand(2))->get(); in visitSELECT()
5236 if (SDValue FMinMax = combineMinNumMaxNum(SDLoc(N), VT, N0.getOperand(0), in visitSELECT()
5237 N0.getOperand(1), N1, N2, CC, in visitSELECT()
5246 N0.getOperand(0), N0.getOperand(1), in visitSELECT()
5247 N1, N2, N0.getOperand(2)); in visitSELECT()
5248 return SimplifySelect(SDLoc(N), N0, N1, N2); in visitSELECT()
5625 SDValue N0 = N->getOperand(0); in visitVSELECT() local
5635 if (N0.getOpcode() == ISD::SETCC) { in visitVSELECT()
5636 SDValue LHS = N0.getOperand(0), RHS = N0.getOperand(1); in visitVSELECT()
5637 ISD::CondCode CC = cast<CondCodeSDNode>(N0.getOperand(2))->get(); in visitVSELECT()
5668 if (N0.getOpcode() == ISD::SETCC) { in visitVSELECT()
5677 std::tie(CCLo, CCHi) = SplitVSETCC(N0.getNode(), DAG); in visitVSELECT()
5693 if (ISD::isBuildVectorAllOnes(N0.getNode())) in visitVSELECT()
5696 if (ISD::isBuildVectorAllZeros(N0.getNode())) in visitVSELECT()
5704 ISD::isBuildVectorOfConstantSDNodes(N0.getNode())) { in visitVSELECT()
5713 SDValue N0 = N->getOperand(0); in visitSELECT_CC() local
5725 if (SDValue SCC = SimplifySetCC(getSetCCResultType(N0.getValueType()), N0, N1, in visitSELECT_CC()
5751 return SimplifySelectCC(SDLoc(N), N0, N1, N2, N3, CC); in visitSELECT_CC()
5783 SDValue N0 = N->getOperand(0); in tryToFoldExtendOfConstant() local
5794 if (isa<ConstantSDNode>(N0)) in tryToFoldExtendOfConstant()
5795 return DAG.getNode(Opcode, SDLoc(N), VT, N0).getNode(); in tryToFoldExtendOfConstant()
5803 ISD::isBuildVectorOfConstantSDNodes(N0.getNode()))) in tryToFoldExtendOfConstant()
5808 unsigned EVTBits = N0->getValueType(0).getScalarType().getSizeInBits(); in tryToFoldExtendOfConstant()
5814 SDValue Op = N0->getOperand(i); in tryToFoldExtendOfConstant()
5837 static bool ExtendUsesToFormExtLoad(SDNode *N, SDValue N0, in ExtendUsesToFormExtLoad() argument
5842 bool isTruncFree = TLI.isTruncateFree(N->getValueType(0), N0.getValueType()); in ExtendUsesToFormExtLoad()
5843 for (SDNode::use_iterator UI = N0.getNode()->use_begin(), in ExtendUsesToFormExtLoad()
5844 UE = N0.getNode()->use_end(); in ExtendUsesToFormExtLoad()
5849 if (UI.getUse().getResNo() != N0.getResNo()) in ExtendUsesToFormExtLoad()
5860 if (UseOp == N0) in ExtendUsesToFormExtLoad()
5920 SDValue N0 = N->getOperand(0); in CombineExtLoad() local
5922 EVT SrcVT = N0.getValueType(); in CombineExtLoad()
5945 if (N0->getOpcode() != ISD::LOAD) in CombineExtLoad()
5948 LoadSDNode *LN0 = cast<LoadSDNode>(N0); in CombineExtLoad()
5951 !N0.hasOneUse() || LN0->isVolatile() || !DstVT.isVector() || in CombineExtLoad()
5956 if (!ExtendUsesToFormExtLoad(N, N0, N->getOpcode(), SetCCs, TLI)) in CombineExtLoad()
6007 DAG.getNode(ISD::TRUNCATE, SDLoc(N0), N0.getValueType(), NewValue); in CombineExtLoad()
6008 CombineTo(N0.getNode(), Trunc, NewChain); in CombineExtLoad()
6015 SDValue N0 = N->getOperand(0); in visitSIGN_EXTEND() local
6024 if (N0.getOpcode() == ISD::SIGN_EXTEND || N0.getOpcode() == ISD::ANY_EXTEND) in visitSIGN_EXTEND()
6026 N0.getOperand(0)); in visitSIGN_EXTEND()
6028 if (N0.getOpcode() == ISD::TRUNCATE) { in visitSIGN_EXTEND()
6031 if (SDValue NarrowLoad = ReduceLoadWidth(N0.getNode())) { in visitSIGN_EXTEND()
6032 SDNode* oye = N0.getNode()->getOperand(0).getNode(); in visitSIGN_EXTEND()
6033 if (NarrowLoad.getNode() != N0.getNode()) { in visitSIGN_EXTEND()
6034 CombineTo(N0.getNode(), NarrowLoad); in visitSIGN_EXTEND()
6043 SDValue Op = N0.getOperand(0); in visitSIGN_EXTEND()
6045 unsigned MidBits = N0.getValueType().getScalarType().getSizeInBits(); in visitSIGN_EXTEND()
6068 N0.getValueType())) { in visitSIGN_EXTEND()
6070 Op = DAG.getNode(ISD::ANY_EXTEND, SDLoc(N0), VT, Op); in visitSIGN_EXTEND()
6072 Op = DAG.getNode(ISD::TRUNCATE, SDLoc(N0), VT, Op); in visitSIGN_EXTEND()
6074 DAG.getValueType(N0.getValueType())); in visitSIGN_EXTEND()
6081 if (ISD::isNON_EXTLoad(N0.getNode()) && ISD::isUNINDEXEDLoad(N0.getNode()) && in visitSIGN_EXTEND()
6083 !cast<LoadSDNode>(N0)->isVolatile()) || in visitSIGN_EXTEND()
6084 TLI.isLoadExtLegal(ISD::SEXTLOAD, VT, N0.getValueType()))) { in visitSIGN_EXTEND()
6087 if (!N0.hasOneUse()) in visitSIGN_EXTEND()
6088 DoXform = ExtendUsesToFormExtLoad(N, N0, ISD::SIGN_EXTEND, SetCCs, TLI); in visitSIGN_EXTEND()
6092 LoadSDNode *LN0 = cast<LoadSDNode>(N0); in visitSIGN_EXTEND()
6095 LN0->getBasePtr(), N0.getValueType(), in visitSIGN_EXTEND()
6098 SDValue Trunc = DAG.getNode(ISD::TRUNCATE, SDLoc(N0), in visitSIGN_EXTEND()
6099 N0.getValueType(), ExtLoad); in visitSIGN_EXTEND()
6100 CombineTo(N0.getNode(), Trunc, ExtLoad.getValue(1)); in visitSIGN_EXTEND()
6114 if ((ISD::isSEXTLoad(N0.getNode()) || ISD::isEXTLoad(N0.getNode())) && in visitSIGN_EXTEND()
6115 ISD::isUNINDEXEDLoad(N0.getNode()) && N0.hasOneUse()) { in visitSIGN_EXTEND()
6116 LoadSDNode *LN0 = cast<LoadSDNode>(N0); in visitSIGN_EXTEND()
6125 CombineTo(N0.getNode(), in visitSIGN_EXTEND()
6126 DAG.getNode(ISD::TRUNCATE, SDLoc(N0), in visitSIGN_EXTEND()
6127 N0.getValueType(), ExtLoad), in visitSIGN_EXTEND()
6135 if ((N0.getOpcode() == ISD::AND || N0.getOpcode() == ISD::OR || in visitSIGN_EXTEND()
6136 N0.getOpcode() == ISD::XOR) && in visitSIGN_EXTEND()
6137 isa<LoadSDNode>(N0.getOperand(0)) && in visitSIGN_EXTEND()
6138 N0.getOperand(1).getOpcode() == ISD::Constant && in visitSIGN_EXTEND()
6139 TLI.isLoadExtLegal(ISD::SEXTLOAD, VT, N0.getValueType()) && in visitSIGN_EXTEND()
6140 (!LegalOperations && TLI.isOperationLegal(N0.getOpcode(), VT))) { in visitSIGN_EXTEND()
6141 LoadSDNode *LN0 = cast<LoadSDNode>(N0.getOperand(0)); in visitSIGN_EXTEND()
6145 if (!N0.hasOneUse()) in visitSIGN_EXTEND()
6146 DoXform = ExtendUsesToFormExtLoad(N, N0.getOperand(0), ISD::SIGN_EXTEND, in visitSIGN_EXTEND()
6153 APInt Mask = cast<ConstantSDNode>(N0.getOperand(1))->getAPIntValue(); in visitSIGN_EXTEND()
6156 SDValue And = DAG.getNode(N0.getOpcode(), DL, VT, in visitSIGN_EXTEND()
6159 SDLoc(N0.getOperand(0)), in visitSIGN_EXTEND()
6160 N0.getOperand(0).getValueType(), ExtLoad); in visitSIGN_EXTEND()
6162 CombineTo(N0.getOperand(0).getNode(), Trunc, ExtLoad.getValue(1)); in visitSIGN_EXTEND()
6170 if (N0.getOpcode() == ISD::SETCC) { in visitSIGN_EXTEND()
6171 EVT N0VT = N0.getOperand(0).getValueType(); in visitSIGN_EXTEND()
6188 return DAG.getSetCC(SDLoc(N), VT, N0.getOperand(0), in visitSIGN_EXTEND()
6189 N0.getOperand(1), in visitSIGN_EXTEND()
6190 cast<CondCodeSDNode>(N0.getOperand(2))->get()); in visitSIGN_EXTEND()
6198 N0.getOperand(0), N0.getOperand(1), in visitSIGN_EXTEND()
6199 cast<CondCodeSDNode>(N0.getOperand(2))->get()); in visitSIGN_EXTEND()
6210 DL, N0.getOperand(0), N0.getOperand(1), NegOne, in visitSIGN_EXTEND()
6212 cast<CondCodeSDNode>(N0.getOperand(2))->get(), true)) in visitSIGN_EXTEND()
6216 EVT SetCCVT = getSetCCResultType(N0.getOperand(0).getValueType()); in visitSIGN_EXTEND()
6218 TLI.isOperationLegal(ISD::SETCC, N0.getOperand(0).getValueType())) { in visitSIGN_EXTEND()
6220 ISD::CondCode CC = cast<CondCodeSDNode>(N0.getOperand(2))->get(); in visitSIGN_EXTEND()
6222 N0.getOperand(0), N0.getOperand(1), CC); in visitSIGN_EXTEND()
6231 DAG.SignBitIsZero(N0)) in visitSIGN_EXTEND()
6232 return DAG.getNode(ISD::ZERO_EXTEND, SDLoc(N), VT, N0); in visitSIGN_EXTEND()
6274 SDValue N0 = N->getOperand(0); in visitZERO_EXTEND() local
6283 if (N0.getOpcode() == ISD::ZERO_EXTEND || N0.getOpcode() == ISD::ANY_EXTEND) in visitZERO_EXTEND()
6285 N0.getOperand(0)); in visitZERO_EXTEND()
6293 if (!VT.isVector() && isTruncateOf(DAG, N0, Op, KnownZero)) { in visitZERO_EXTEND()
6295 (Op.getValueSizeInBits() == N0.getValueSizeInBits()) ? in visitZERO_EXTEND()
6298 N0.getValueSizeInBits(), in visitZERO_EXTEND()
6313 if (N0.getOpcode() == ISD::TRUNCATE) { in visitZERO_EXTEND()
6314 if (SDValue NarrowLoad = ReduceLoadWidth(N0.getNode())) { in visitZERO_EXTEND()
6315 SDNode* oye = N0.getNode()->getOperand(0).getNode(); in visitZERO_EXTEND()
6316 if (NarrowLoad.getNode() != N0.getNode()) { in visitZERO_EXTEND()
6317 CombineTo(N0.getNode(), NarrowLoad); in visitZERO_EXTEND()
6326 if (N0.getOpcode() == ISD::TRUNCATE) { in visitZERO_EXTEND()
6329 if (SDValue NarrowLoad = ReduceLoadWidth(N0.getNode())) { in visitZERO_EXTEND()
6330 SDNode *oye = N0.getNode()->getOperand(0).getNode(); in visitZERO_EXTEND()
6331 if (NarrowLoad.getNode() != N0.getNode()) { in visitZERO_EXTEND()
6332 CombineTo(N0.getNode(), NarrowLoad); in visitZERO_EXTEND()
6339 EVT SrcVT = N0.getOperand(0).getValueType(); in visitZERO_EXTEND()
6340 EVT MinVT = N0.getValueType(); in visitZERO_EXTEND()
6347 SDValue Op = N0.getOperand(0); in visitZERO_EXTEND()
6355 SDValue Op = N0.getOperand(0); in visitZERO_EXTEND()
6369 if (N0.getOpcode() == ISD::AND && in visitZERO_EXTEND()
6370 N0.getOperand(0).getOpcode() == ISD::TRUNCATE && in visitZERO_EXTEND()
6371 N0.getOperand(1).getOpcode() == ISD::Constant && in visitZERO_EXTEND()
6372 (!TLI.isTruncateFree(N0.getOperand(0).getOperand(0).getValueType(), in visitZERO_EXTEND()
6373 N0.getValueType()) || in visitZERO_EXTEND()
6374 !TLI.isZExtFree(N0.getValueType(), VT))) { in visitZERO_EXTEND()
6375 SDValue X = N0.getOperand(0).getOperand(0); in visitZERO_EXTEND()
6381 APInt Mask = cast<ConstantSDNode>(N0.getOperand(1))->getAPIntValue(); in visitZERO_EXTEND()
6391 if (ISD::isNON_EXTLoad(N0.getNode()) && ISD::isUNINDEXEDLoad(N0.getNode()) && in visitZERO_EXTEND()
6393 !cast<LoadSDNode>(N0)->isVolatile()) || in visitZERO_EXTEND()
6394 TLI.isLoadExtLegal(ISD::ZEXTLOAD, VT, N0.getValueType()))) { in visitZERO_EXTEND()
6397 if (!N0.hasOneUse()) in visitZERO_EXTEND()
6398 DoXform = ExtendUsesToFormExtLoad(N, N0, ISD::ZERO_EXTEND, SetCCs, TLI); in visitZERO_EXTEND()
6402 LoadSDNode *LN0 = cast<LoadSDNode>(N0); in visitZERO_EXTEND()
6405 LN0->getBasePtr(), N0.getValueType(), in visitZERO_EXTEND()
6408 SDValue Trunc = DAG.getNode(ISD::TRUNCATE, SDLoc(N0), in visitZERO_EXTEND()
6409 N0.getValueType(), ExtLoad); in visitZERO_EXTEND()
6410 CombineTo(N0.getNode(), Trunc, ExtLoad.getValue(1)); in visitZERO_EXTEND()
6427 if ((N0.getOpcode() == ISD::AND || N0.getOpcode() == ISD::OR || in visitZERO_EXTEND()
6428 N0.getOpcode() == ISD::XOR) && in visitZERO_EXTEND()
6429 isa<LoadSDNode>(N0.getOperand(0)) && in visitZERO_EXTEND()
6430 N0.getOperand(1).getOpcode() == ISD::Constant && in visitZERO_EXTEND()
6431 TLI.isLoadExtLegal(ISD::ZEXTLOAD, VT, N0.getValueType()) && in visitZERO_EXTEND()
6432 (!LegalOperations && TLI.isOperationLegal(N0.getOpcode(), VT))) { in visitZERO_EXTEND()
6433 LoadSDNode *LN0 = cast<LoadSDNode>(N0.getOperand(0)); in visitZERO_EXTEND()
6437 if (!N0.hasOneUse()) { in visitZERO_EXTEND()
6438 if (N0.getOpcode() == ISD::AND) { in visitZERO_EXTEND()
6439 auto *AndC = cast<ConstantSDNode>(N0.getOperand(1)); in visitZERO_EXTEND()
6448 DoXform = ExtendUsesToFormExtLoad(N, N0.getOperand(0), in visitZERO_EXTEND()
6456 APInt Mask = cast<ConstantSDNode>(N0.getOperand(1))->getAPIntValue(); in visitZERO_EXTEND()
6459 SDValue And = DAG.getNode(N0.getOpcode(), DL, VT, in visitZERO_EXTEND()
6462 SDLoc(N0.getOperand(0)), in visitZERO_EXTEND()
6463 N0.getOperand(0).getValueType(), ExtLoad); in visitZERO_EXTEND()
6465 CombineTo(N0.getOperand(0).getNode(), Trunc, ExtLoad.getValue(1)); in visitZERO_EXTEND()
6475 if ((ISD::isZEXTLoad(N0.getNode()) || ISD::isEXTLoad(N0.getNode())) && in visitZERO_EXTEND()
6476 ISD::isUNINDEXEDLoad(N0.getNode()) && N0.hasOneUse()) { in visitZERO_EXTEND()
6477 LoadSDNode *LN0 = cast<LoadSDNode>(N0); in visitZERO_EXTEND()
6486 CombineTo(N0.getNode(), in visitZERO_EXTEND()
6487 DAG.getNode(ISD::TRUNCATE, SDLoc(N0), N0.getValueType(), in visitZERO_EXTEND()
6494 if (N0.getOpcode() == ISD::SETCC) { in visitZERO_EXTEND()
6497 N0.getValueType().getVectorElementType() == MVT::i1) { in visitZERO_EXTEND()
6498 EVT N00VT = N0.getOperand(0).getValueType(); in visitZERO_EXTEND()
6499 if (getSetCCResultType(N00VT) == N0.getValueType()) in visitZERO_EXTEND()
6511 SDValue VSetCC = DAG.getNode(ISD::SETCC, DL, VT, N0.getOperand(0), in visitZERO_EXTEND()
6512 N0.getOperand(1), N0.getOperand(2)); in visitZERO_EXTEND()
6524 DAG.getNode(ISD::SETCC, DL, MatchingVectorType, N0.getOperand(0), in visitZERO_EXTEND()
6525 N0.getOperand(1), N0.getOperand(2)); in visitZERO_EXTEND()
6533 DL, N0.getOperand(0), N0.getOperand(1), DAG.getConstant(1, DL, VT), in visitZERO_EXTEND()
6535 cast<CondCodeSDNode>(N0.getOperand(2))->get(), true)) in visitZERO_EXTEND()
6540 if ((N0.getOpcode() == ISD::SHL || N0.getOpcode() == ISD::SRL) && in visitZERO_EXTEND()
6541 isa<ConstantSDNode>(N0.getOperand(1)) && in visitZERO_EXTEND()
6542 N0.getOperand(0).getOpcode() == ISD::ZERO_EXTEND && in visitZERO_EXTEND()
6543 N0.hasOneUse()) { in visitZERO_EXTEND()
6544 SDValue ShAmt = N0.getOperand(1); in visitZERO_EXTEND()
6546 if (N0.getOpcode() == ISD::SHL) { in visitZERO_EXTEND()
6547 SDValue InnerZExt = N0.getOperand(0); in visitZERO_EXTEND()
6562 return DAG.getNode(N0.getOpcode(), DL, VT, in visitZERO_EXTEND()
6563 DAG.getNode(ISD::ZERO_EXTEND, DL, VT, N0.getOperand(0)), in visitZERO_EXTEND()
6571 SDValue N0 = N->getOperand(0); in visitANY_EXTEND() local
6581 if (N0.getOpcode() == ISD::ANY_EXTEND || in visitANY_EXTEND()
6582 N0.getOpcode() == ISD::ZERO_EXTEND || in visitANY_EXTEND()
6583 N0.getOpcode() == ISD::SIGN_EXTEND) in visitANY_EXTEND()
6584 return DAG.getNode(N0.getOpcode(), SDLoc(N), VT, N0.getOperand(0)); in visitANY_EXTEND()
6588 if (N0.getOpcode() == ISD::TRUNCATE) { in visitANY_EXTEND()
6589 if (SDValue NarrowLoad = ReduceLoadWidth(N0.getNode())) { in visitANY_EXTEND()
6590 SDNode* oye = N0.getNode()->getOperand(0).getNode(); in visitANY_EXTEND()
6591 if (NarrowLoad.getNode() != N0.getNode()) { in visitANY_EXTEND()
6592 CombineTo(N0.getNode(), NarrowLoad); in visitANY_EXTEND()
6601 if (N0.getOpcode() == ISD::TRUNCATE) { in visitANY_EXTEND()
6602 SDValue TruncOp = N0.getOperand(0); in visitANY_EXTEND()
6612 if (N0.getOpcode() == ISD::AND && in visitANY_EXTEND()
6613 N0.getOperand(0).getOpcode() == ISD::TRUNCATE && in visitANY_EXTEND()
6614 N0.getOperand(1).getOpcode() == ISD::Constant && in visitANY_EXTEND()
6615 !TLI.isTruncateFree(N0.getOperand(0).getOperand(0).getValueType(), in visitANY_EXTEND()
6616 N0.getValueType())) { in visitANY_EXTEND()
6617 SDValue X = N0.getOperand(0).getOperand(0); in visitANY_EXTEND()
6623 APInt Mask = cast<ConstantSDNode>(N0.getOperand(1))->getAPIntValue(); in visitANY_EXTEND()
6634 if (ISD::isNON_EXTLoad(N0.getNode()) && !VT.isVector() && in visitANY_EXTEND()
6635 ISD::isUNINDEXEDLoad(N0.getNode()) && in visitANY_EXTEND()
6636 TLI.isLoadExtLegal(ISD::EXTLOAD, VT, N0.getValueType())) { in visitANY_EXTEND()
6639 if (!N0.hasOneUse()) in visitANY_EXTEND()
6640 DoXform = ExtendUsesToFormExtLoad(N, N0, ISD::ANY_EXTEND, SetCCs, TLI); in visitANY_EXTEND()
6642 LoadSDNode *LN0 = cast<LoadSDNode>(N0); in visitANY_EXTEND()
6645 LN0->getBasePtr(), N0.getValueType(), in visitANY_EXTEND()
6648 SDValue Trunc = DAG.getNode(ISD::TRUNCATE, SDLoc(N0), in visitANY_EXTEND()
6649 N0.getValueType(), ExtLoad); in visitANY_EXTEND()
6650 CombineTo(N0.getNode(), Trunc, ExtLoad.getValue(1)); in visitANY_EXTEND()
6660 if (N0.getOpcode() == ISD::LOAD && in visitANY_EXTEND()
6661 !ISD::isNON_EXTLoad(N0.getNode()) && ISD::isUNINDEXEDLoad(N0.getNode()) && in visitANY_EXTEND()
6662 N0.hasOneUse()) { in visitANY_EXTEND()
6663 LoadSDNode *LN0 = cast<LoadSDNode>(N0); in visitANY_EXTEND()
6671 CombineTo(N0.getNode(), in visitANY_EXTEND()
6672 DAG.getNode(ISD::TRUNCATE, SDLoc(N0), in visitANY_EXTEND()
6673 N0.getValueType(), ExtLoad), in visitANY_EXTEND()
6679 if (N0.getOpcode() == ISD::SETCC) { in visitANY_EXTEND()
6686 EVT N0VT = N0.getOperand(0).getValueType(); in visitANY_EXTEND()
6693 return DAG.getSetCC(SDLoc(N), VT, N0.getOperand(0), in visitANY_EXTEND()
6694 N0.getOperand(1), in visitANY_EXTEND()
6695 cast<CondCodeSDNode>(N0.getOperand(2))->get()); in visitANY_EXTEND()
6702 DAG.getSetCC(SDLoc(N), MatchingVectorType, N0.getOperand(0), in visitANY_EXTEND()
6703 N0.getOperand(1), in visitANY_EXTEND()
6704 cast<CondCodeSDNode>(N0.getOperand(2))->get()); in visitANY_EXTEND()
6712 DL, N0.getOperand(0), N0.getOperand(1), DAG.getConstant(1, DL, VT), in visitANY_EXTEND()
6714 cast<CondCodeSDNode>(N0.getOperand(2))->get(), true)) in visitANY_EXTEND()
6772 SDValue N0 = N->getOperand(0); in ReduceLoadWidth() local
6788 N0 = SDValue(N, 0); in ReduceLoadWidth()
6789 ConstantSDNode *N01 = dyn_cast<ConstantSDNode>(N0.getOperand(1)); in ReduceLoadWidth()
6805 if (N0.getOpcode() == ISD::SRL && N0.hasOneUse()) { in ReduceLoadWidth()
6806 if (ConstantSDNode *N01 = dyn_cast<ConstantSDNode>(N0.getOperand(1))) { in ReduceLoadWidth()
6810 N0 = N0.getOperand(0); in ReduceLoadWidth()
6812 if ((N0.getValueType().getSizeInBits() & (EVTBits-1)) != 0) in ReduceLoadWidth()
6817 if (!isa<LoadSDNode>(N0)) return SDValue(); in ReduceLoadWidth()
6822 if (cast<LoadSDNode>(N0)->getExtensionType() == ISD::SEXTLOAD) in ReduceLoadWidth()
6828 if (ShAmt >= cast<LoadSDNode>(N0)->getMemoryVT().getSizeInBits()) in ReduceLoadWidth()
6836 if (ShAmt == 0 && N0.getOpcode() == ISD::SHL && N0.hasOneUse() && in ReduceLoadWidth()
6837 ExtVT == VT && TLI.isNarrowingProfitable(N0.getValueType(), VT)) { in ReduceLoadWidth()
6838 if (ConstantSDNode *N01 = dyn_cast<ConstantSDNode>(N0.getOperand(1))) { in ReduceLoadWidth()
6840 N0 = N0.getOperand(0); in ReduceLoadWidth()
6846 if (!isa<LoadSDNode>(N0) || !N0.hasOneUse()) in ReduceLoadWidth()
6850 LoadSDNode *LN0 = cast<LoadSDNode>(N0); in ReduceLoadWidth()
6876 EVT PtrType = N0.getOperand(1).getValueType(); in ReduceLoadWidth()
6904 Load = DAG.getLoad(VT, SDLoc(N0), LN0->getChain(), NewPtr, in ReduceLoadWidth()
6909 Load = DAG.getExtLoad(ExtType, SDLoc(N0), VT, LN0->getChain(),NewPtr, in ReduceLoadWidth()
6916 DAG.ReplaceAllUsesOfValueWith(N0.getValue(1), Load.getValue(1)); in ReduceLoadWidth()
6928 SDLoc DL(N0); in ReduceLoadWidth()
6941 SDValue N0 = N->getOperand(0); in visitSIGN_EXTEND_INREG() local
6948 if (N0.isUndef()) in visitSIGN_EXTEND_INREG()
6952 if (DAG.isConstantIntBuildVectorOrConstantInt(N0)) in visitSIGN_EXTEND_INREG()
6953 return DAG.getNode(ISD::SIGN_EXTEND_INREG, SDLoc(N), VT, N0, N1); in visitSIGN_EXTEND_INREG()
6956 if (DAG.ComputeNumSignBits(N0) >= VTBits-EVTBits+1) in visitSIGN_EXTEND_INREG()
6957 return N0; in visitSIGN_EXTEND_INREG()
6960 if (N0.getOpcode() == ISD::SIGN_EXTEND_INREG && in visitSIGN_EXTEND_INREG()
6961 EVT.bitsLT(cast<VTSDNode>(N0.getOperand(1))->getVT())) in visitSIGN_EXTEND_INREG()
6963 N0.getOperand(0), N1); in visitSIGN_EXTEND_INREG()
6968 if (N0.getOpcode() == ISD::SIGN_EXTEND || N0.getOpcode() == ISD::ANY_EXTEND) { in visitSIGN_EXTEND_INREG()
6969 SDValue N00 = N0.getOperand(0); in visitSIGN_EXTEND_INREG()
6976 if (DAG.MaskedValueIsZero(N0, APInt::getBitsSet(VTBits, EVTBits-1, EVTBits))) in visitSIGN_EXTEND_INREG()
6977 return DAG.getZeroExtendInReg(N0, SDLoc(N), EVT); in visitSIGN_EXTEND_INREG()
6992 if (N0.getOpcode() == ISD::SRL) { in visitSIGN_EXTEND_INREG()
6993 if (ConstantSDNode *ShAmt = dyn_cast<ConstantSDNode>(N0.getOperand(1))) in visitSIGN_EXTEND_INREG()
6997 unsigned InSignBits = DAG.ComputeNumSignBits(N0.getOperand(0)); in visitSIGN_EXTEND_INREG()
7000 N0.getOperand(0), N0.getOperand(1)); in visitSIGN_EXTEND_INREG()
7005 if (ISD::isEXTLoad(N0.getNode()) && in visitSIGN_EXTEND_INREG()
7006 ISD::isUNINDEXEDLoad(N0.getNode()) && in visitSIGN_EXTEND_INREG()
7007 EVT == cast<LoadSDNode>(N0)->getMemoryVT() && in visitSIGN_EXTEND_INREG()
7008 ((!LegalOperations && !cast<LoadSDNode>(N0)->isVolatile()) || in visitSIGN_EXTEND_INREG()
7010 LoadSDNode *LN0 = cast<LoadSDNode>(N0); in visitSIGN_EXTEND_INREG()
7016 CombineTo(N0.getNode(), ExtLoad, ExtLoad.getValue(1)); in visitSIGN_EXTEND_INREG()
7021 if (ISD::isZEXTLoad(N0.getNode()) && ISD::isUNINDEXEDLoad(N0.getNode()) && in visitSIGN_EXTEND_INREG()
7022 N0.hasOneUse() && in visitSIGN_EXTEND_INREG()
7023 EVT == cast<LoadSDNode>(N0)->getMemoryVT() && in visitSIGN_EXTEND_INREG()
7024 ((!LegalOperations && !cast<LoadSDNode>(N0)->isVolatile()) || in visitSIGN_EXTEND_INREG()
7026 LoadSDNode *LN0 = cast<LoadSDNode>(N0); in visitSIGN_EXTEND_INREG()
7032 CombineTo(N0.getNode(), ExtLoad, ExtLoad.getValue(1)); in visitSIGN_EXTEND_INREG()
7037 if (EVTBits <= 16 && N0.getOpcode() == ISD::OR) { in visitSIGN_EXTEND_INREG()
7038 if (SDValue BSwap = MatchBSwapHWordLow(N0.getNode(), N0.getOperand(0), in visitSIGN_EXTEND_INREG()
7039 N0.getOperand(1), false)) in visitSIGN_EXTEND_INREG()
7048 SDValue N0 = N->getOperand(0); in visitSIGN_EXTEND_VECTOR_INREG() local
7051 if (N0.isUndef()) in visitSIGN_EXTEND_VECTOR_INREG()
7062 SDValue N0 = N->getOperand(0); in visitZERO_EXTEND_VECTOR_INREG() local
7065 if (N0.isUndef()) in visitZERO_EXTEND_VECTOR_INREG()
7076 SDValue N0 = N->getOperand(0); in visitTRUNCATE() local
7081 if (N0.getValueType() == N->getValueType(0)) in visitTRUNCATE()
7082 return N0; in visitTRUNCATE()
7084 if (DAG.isConstantIntBuildVectorOrConstantInt(N0)) in visitTRUNCATE()
7085 return DAG.getNode(ISD::TRUNCATE, SDLoc(N), VT, N0); in visitTRUNCATE()
7087 if (N0.getOpcode() == ISD::TRUNCATE) in visitTRUNCATE()
7088 return DAG.getNode(ISD::TRUNCATE, SDLoc(N), VT, N0.getOperand(0)); in visitTRUNCATE()
7090 if (N0.getOpcode() == ISD::ZERO_EXTEND || in visitTRUNCATE()
7091 N0.getOpcode() == ISD::SIGN_EXTEND || in visitTRUNCATE()
7092 N0.getOpcode() == ISD::ANY_EXTEND) { in visitTRUNCATE()
7094 if (N0.getOperand(0).getValueType().bitsLT(VT)) in visitTRUNCATE()
7095 return DAG.getNode(N0.getOpcode(), SDLoc(N), VT, N0.getOperand(0)); in visitTRUNCATE()
7097 if (N0.getOperand(0).getValueType().bitsGT(VT)) in visitTRUNCATE()
7098 return DAG.getNode(ISD::TRUNCATE, SDLoc(N), VT, N0.getOperand(0)); in visitTRUNCATE()
7101 return N0.getOperand(0); in visitTRUNCATE()
7114 if (N0.getOpcode() == ISD::EXTRACT_VECTOR_ELT && in visitTRUNCATE()
7115 LegalTypes && !LegalOperations && N0->hasOneUse() && VT != MVT::i1) { in visitTRUNCATE()
7117 EVT VecTy = N0.getOperand(0).getValueType(); in visitTRUNCATE()
7118 EVT ExTy = N0.getValueType(); in visitTRUNCATE()
7127 SDValue EltNo = N0->getOperand(1); in visitTRUNCATE()
7135 DAG.getBitcast(NVT, N0.getOperand(0)), in visitTRUNCATE()
7141 if (N0.getOpcode() == ISD::SELECT) { in visitTRUNCATE()
7142 EVT SrcVT = N0.getValueType(); in visitTRUNCATE()
7145 SDLoc SL(N0); in visitTRUNCATE()
7146 SDValue Cond = N0.getOperand(0); in visitTRUNCATE()
7147 SDValue TruncOp0 = DAG.getNode(ISD::TRUNCATE, SL, VT, N0.getOperand(1)); in visitTRUNCATE()
7148 SDValue TruncOp1 = DAG.getNode(ISD::TRUNCATE, SL, VT, N0.getOperand(2)); in visitTRUNCATE()
7154 if (N0.getOpcode() == ISD::SHL && N0.hasOneUse() && in visitTRUNCATE()
7157 if (const ConstantSDNode *CAmt = isConstOrConstSplat(N0.getOperand(1))) { in visitTRUNCATE()
7165 SDValue Trunc = DAG.getNode(ISD::TRUNCATE, SL, VT, N0.getOperand(0)); in visitTRUNCATE()
7177 N0.getOpcode() == ISD::BITCAST && N0.hasOneUse() && in visitTRUNCATE()
7178 N0.getOperand(0).getOpcode() == ISD::BUILD_VECTOR && in visitTRUNCATE()
7179 N0.getOperand(0).hasOneUse()) { in visitTRUNCATE()
7181 SDValue BuildVect = N0.getOperand(0); in visitTRUNCATE()
7210 GetDemandedBits(N0, APInt::getLowBitsSet(N0.getValueSizeInBits(), in visitTRUNCATE()
7216 if (!LegalTypes || TLI.isTypeDesirableForOp(N0.getOpcode(), VT)) { in visitTRUNCATE()
7222 if (N0.hasOneUse() && ISD::isUNINDEXEDLoad(N0.getNode())) { in visitTRUNCATE()
7223 LoadSDNode *LN0 = cast<LoadSDNode>(N0); in visitTRUNCATE()
7230 DAG.ReplaceAllUsesOfValueWith(N0.getValue(1), NewLoad.getValue(1)); in visitTRUNCATE()
7237 if (N0.getOpcode() == ISD::CONCAT_VECTORS && !LegalTypes) { in visitTRUNCATE()
7243 for (unsigned i = 0, e = N0.getNumOperands(); i != e; ++i) { in visitTRUNCATE()
7244 SDValue X = N0.getOperand(i); in visitTRUNCATE()
7281 if (N0.getOpcode() == ISD::BITCAST && !VT.isVector()) { in visitTRUNCATE()
7282 SDValue VecSrc = N0.getOperand(0); in visitTRUNCATE()
7354 SDValue N0 = N->getOperand(0); in foldBitcastedFPLogic() local
7355 EVT SourceVT = N0.getValueType(); in foldBitcastedFPLogic()
7361 switch (N0.getOpcode()) { in foldBitcastedFPLogic()
7377 SDValue LogicOp0 = N0.getOperand(0); in foldBitcastedFPLogic()
7378 ConstantSDNode *LogicOp1 = dyn_cast<ConstantSDNode>(N0.getOperand(1)); in foldBitcastedFPLogic()
7388 SDValue N0 = N->getOperand(0); in visitBITCAST() local
7396 N0.getOpcode() == ISD::BUILD_VECTOR && N0.getNode()->hasOneUse() && in visitBITCAST()
7398 bool isSimple = cast<BuildVectorSDNode>(N0)->isConstant(); in visitBITCAST()
7404 return ConstantFoldBITCASTofBUILD_VECTOR(N0.getNode(), DestEltVT); in visitBITCAST()
7408 if (isa<ConstantSDNode>(N0) || isa<ConstantFPSDNode>(N0)) { in visitBITCAST()
7413 (isa<ConstantSDNode>(N0) && VT.isFloatingPoint() && !VT.isVector() && in visitBITCAST()
7415 (isa<ConstantFPSDNode>(N0) && VT.isInteger() && !VT.isVector() && in visitBITCAST()
7417 return DAG.getBitcast(VT, N0); in visitBITCAST()
7421 if (N0.getOpcode() == ISD::BITCAST) in visitBITCAST()
7422 return DAG.getBitcast(VT, N0.getOperand(0)); in visitBITCAST()
7426 if (ISD::isNormalLoad(N0.getNode()) && N0.hasOneUse() && in visitBITCAST()
7428 !cast<LoadSDNode>(N0)->isVolatile() && in visitBITCAST()
7430 TLI.hasBigEndianPartOrdering(N0.getValueType(), DAG.getDataLayout()) == in visitBITCAST()
7433 TLI.isLoadBitCastBeneficial(N0.getValueType(), VT)) { in visitBITCAST()
7434 LoadSDNode *LN0 = cast<LoadSDNode>(N0); in visitBITCAST()
7446 DAG.ReplaceAllUsesOfValueWith(N0.getValue(1), Load.getValue(1)); in visitBITCAST()
7466 if (((N0.getOpcode() == ISD::FNEG && !TLI.isFNegFree(N0.getValueType())) || in visitBITCAST()
7467 (N0.getOpcode() == ISD::FABS && !TLI.isFAbsFree(N0.getValueType()))) && in visitBITCAST()
7468 N0.getNode()->hasOneUse() && VT.isInteger() && in visitBITCAST()
7469 !VT.isVector() && !N0.getValueType().isVector()) { in visitBITCAST()
7470 SDValue NewConv = DAG.getBitcast(VT, N0.getOperand(0)); in visitBITCAST()
7474 if (N0.getValueType() == MVT::ppcf128 && !LegalTypes) { in visitBITCAST()
7477 APInt::getSignBit(VT.getSizeInBits() / 2), SDLoc(N0), MVT::i64); in visitBITCAST()
7479 if (N0.getOpcode() == ISD::FNEG) { in visitBITCAST()
7483 assert(N0.getOpcode() == ISD::FABS); in visitBITCAST()
7489 FlipBit = DAG.getNode(ISD::AND, SDLoc(N0), MVT::i64, Hi, SignBit); in visitBITCAST()
7493 DAG.getNode(ISD::BUILD_PAIR, SDLoc(N0), VT, FlipBit, FlipBit); in visitBITCAST()
7498 if (N0.getOpcode() == ISD::FNEG) in visitBITCAST()
7501 assert(N0.getOpcode() == ISD::FABS); in visitBITCAST()
7517 if (N0.getOpcode() == ISD::FCOPYSIGN && N0.getNode()->hasOneUse() && in visitBITCAST()
7518 isa<ConstantFPSDNode>(N0.getOperand(0)) && in visitBITCAST()
7520 unsigned OrigXWidth = N0.getOperand(1).getValueType().getSizeInBits(); in visitBITCAST()
7523 SDValue X = DAG.getBitcast(IntXVT, N0.getOperand(1)); in visitBITCAST()
7544 if (N0.getValueType() == MVT::ppcf128 && !LegalTypes) { in visitBITCAST()
7546 SDValue Cst = DAG.getBitcast(VT, N0.getOperand(0)); in visitBITCAST()
7548 SDValue X = DAG.getBitcast(VT, N0.getOperand(1)); in visitBITCAST()
7550 SDValue XorResult = DAG.getNode(ISD::XOR, SDLoc(N0), VT, Cst, X); in visitBITCAST()
7562 DAG.getNode(ISD::BUILD_PAIR, SDLoc(N0), VT, FlipBit, FlipBit); in visitBITCAST()
7571 SDValue Cst = DAG.getBitcast(VT, N0.getOperand(0)); in visitBITCAST()
7581 if (N0.getOpcode() == ISD::BUILD_PAIR) in visitBITCAST()
7582 if (SDValue CombineLD = CombineConsecutiveLoads(N0.getNode(), VT)) in visitBITCAST()
7590 N0->getOpcode() == ISD::VECTOR_SHUFFLE && in visitBITCAST()
7591 VT.getVectorNumElements() >= N0.getValueType().getVectorNumElements() && in visitBITCAST()
7592 !(VT.getVectorNumElements() % N0.getValueType().getVectorNumElements())) { in visitBITCAST()
7593 ShuffleVectorSDNode *SVN = cast<ShuffleVectorSDNode>(N0); in visitBITCAST()
7607 SDValue SV0 = PeekThroughBitcast(N0->getOperand(0)); in visitBITCAST()
7608 SDValue SV1 = PeekThroughBitcast(N0->getOperand(1)); in visitBITCAST()
7613 VT.getVectorNumElements() / N0.getValueType().getVectorNumElements(); in visitBITCAST()
7762 SDValue N0 = N->getOperand(0); in visitFADDForFMACombine() local
7795 if (Aggressive && N0.getOpcode() == ISD::FMUL && in visitFADDForFMACombine()
7797 if (N0.getNode()->use_size() > N1.getNode()->use_size()) in visitFADDForFMACombine()
7798 std::swap(N0, N1); in visitFADDForFMACombine()
7802 if (N0.getOpcode() == ISD::FMUL && in visitFADDForFMACombine()
7803 (Aggressive || N0->hasOneUse())) { in visitFADDForFMACombine()
7805 N0.getOperand(0), N0.getOperand(1), N1); in visitFADDForFMACombine()
7813 N1.getOperand(0), N1.getOperand(1), N0); in visitFADDForFMACombine()
7819 if (N0.getOpcode() == ISD::FP_EXTEND) { in visitFADDForFMACombine()
7820 SDValue N00 = N0.getOperand(0); in visitFADDForFMACombine()
7838 N10.getOperand(1)), N0); in visitFADDForFMACombine()
7845 if (N0.getOpcode() == PreferredFusedOpcode && in visitFADDForFMACombine()
7846 N0.getOperand(2).getOpcode() == ISD::FMUL) { in visitFADDForFMACombine()
7848 N0.getOperand(0), N0.getOperand(1), in visitFADDForFMACombine()
7850 N0.getOperand(2).getOperand(0), in visitFADDForFMACombine()
7851 N0.getOperand(2).getOperand(1), in visitFADDForFMACombine()
7863 N0)); in visitFADDForFMACombine()
7877 if (N0.getOpcode() == PreferredFusedOpcode) { in visitFADDForFMACombine()
7878 SDValue N02 = N0.getOperand(2); in visitFADDForFMACombine()
7882 return FoldFAddFMAFPExtFMul(N0.getOperand(0), N0.getOperand(1), in visitFADDForFMACombine()
7903 if (N0.getOpcode() == ISD::FP_EXTEND) { in visitFADDForFMACombine()
7904 SDValue N00 = N0.getOperand(0); in visitFADDForFMACombine()
7923 N0); in visitFADDForFMACombine()
7939 N0); in visitFADDForFMACombine()
7950 SDValue N0 = N->getOperand(0); in visitFSUBForFMACombine() local
7981 if (N0.getOpcode() == ISD::FMUL && in visitFSUBForFMACombine()
7982 (Aggressive || N0->hasOneUse())) { in visitFSUBForFMACombine()
7984 N0.getOperand(0), N0.getOperand(1), in visitFSUBForFMACombine()
7995 N1.getOperand(1), N0); in visitFSUBForFMACombine()
7998 if (N0.getOpcode() == ISD::FNEG && in visitFSUBForFMACombine()
7999 N0.getOperand(0).getOpcode() == ISD::FMUL && in visitFSUBForFMACombine()
8000 (Aggressive || (N0->hasOneUse() && N0.getOperand(0).hasOneUse()))) { in visitFSUBForFMACombine()
8001 SDValue N00 = N0.getOperand(0).getOperand(0); in visitFSUBForFMACombine()
8002 SDValue N01 = N0.getOperand(0).getOperand(1); in visitFSUBForFMACombine()
8012 if (N0.getOpcode() == ISD::FP_EXTEND) { in visitFSUBForFMACombine()
8013 SDValue N00 = N0.getOperand(0); in visitFSUBForFMACombine()
8035 N0); in visitFSUBForFMACombine()
8044 if (N0.getOpcode() == ISD::FP_EXTEND) { in visitFSUBForFMACombine()
8045 SDValue N00 = N0.getOperand(0); in visitFSUBForFMACombine()
8066 if (N0.getOpcode() == ISD::FNEG) { in visitFSUBForFMACombine()
8067 SDValue N00 = N0.getOperand(0); in visitFSUBForFMACombine()
8088 if (N0.getOpcode() == PreferredFusedOpcode && in visitFSUBForFMACombine()
8089 N0.getOperand(2).getOpcode() == ISD::FMUL) { in visitFSUBForFMACombine()
8091 N0.getOperand(0), N0.getOperand(1), in visitFSUBForFMACombine()
8093 N0.getOperand(2).getOperand(0), in visitFSUBForFMACombine()
8094 N0.getOperand(2).getOperand(1), in visitFSUBForFMACombine()
8112 N21, N0)); in visitFSUBForFMACombine()
8118 if (N0.getOpcode() == PreferredFusedOpcode) { in visitFSUBForFMACombine()
8119 SDValue N02 = N0.getOperand(2); in visitFSUBForFMACombine()
8124 N0.getOperand(0), N0.getOperand(1), in visitFSUBForFMACombine()
8141 if (N0.getOpcode() == ISD::FP_EXTEND) { in visitFSUBForFMACombine()
8142 SDValue N00 = N0.getOperand(0); in visitFSUBForFMACombine()
8178 N0)); in visitFSUBForFMACombine()
8207 N0)); in visitFSUBForFMACombine()
8218 SDValue N0 = N->getOperand(0); in visitFMULForFMACombine() local
8259 if (SDValue FMA = FuseFADD(N0, N1)) in visitFMULForFMACombine()
8261 if (SDValue FMA = FuseFADD(N1, N0)) in visitFMULForFMACombine()
8290 if (SDValue FMA = FuseFSUB(N0, N1)) in visitFMULForFMACombine()
8292 if (SDValue FMA = FuseFSUB(N1, N0)) in visitFMULForFMACombine()
8299 SDValue N0 = N->getOperand(0); in visitFADD() local
8301 bool N0CFP = isConstantFPBuildVectorOrConstantFP(N0); in visitFADD()
8315 return DAG.getNode(ISD::FADD, DL, VT, N0, N1, Flags); in visitFADD()
8319 return DAG.getNode(ISD::FADD, DL, VT, N1, N0, Flags); in visitFADD()
8324 return DAG.getNode(ISD::FSUB, DL, VT, N0, in visitFADD()
8329 isNegatibleForFree(N0, LegalOperations, TLI, &Options) == 2) in visitFADD()
8331 GetNegatedExpression(N0, DAG, LegalOperations), Flags); in visitFADD()
8342 return N0; in visitFADD()
8345 if (N1CFP && N0.getOpcode() == ISD::FADD && N0.getNode()->hasOneUse() && in visitFADD()
8346 isConstantFPBuildVectorOrConstantFP(N0.getOperand(1))) in visitFADD()
8347 return DAG.getNode(ISD::FADD, DL, VT, N0.getOperand(0), in visitFADD()
8348 DAG.getNode(ISD::FADD, DL, VT, N0.getOperand(1), N1, in visitFADD()
8353 if (AllowNewConst && N0.getOpcode() == ISD::FNEG && N0.getOperand(0) == N1) in visitFADD()
8357 if (AllowNewConst && N1.getOpcode() == ISD::FNEG && N1.getOperand(0) == N0) in visitFADD()
8364 if (N0.getOpcode() == ISD::FMUL) { in visitFADD()
8365 bool CFP00 = isConstantFPBuildVectorOrConstantFP(N0.getOperand(0)); in visitFADD()
8366 bool CFP01 = isConstantFPBuildVectorOrConstantFP(N0.getOperand(1)); in visitFADD()
8369 if (CFP01 && !CFP00 && N0.getOperand(0) == N1) { in visitFADD()
8370 SDValue NewCFP = DAG.getNode(ISD::FADD, DL, VT, N0.getOperand(1), in visitFADD()
8378 N0.getOperand(0) == N1.getOperand(0)) { in visitFADD()
8379 SDValue NewCFP = DAG.getNode(ISD::FADD, DL, VT, N0.getOperand(1), in visitFADD()
8381 return DAG.getNode(ISD::FMUL, DL, VT, N0.getOperand(0), NewCFP, Flags); in visitFADD()
8390 if (CFP11 && !CFP10 && N1.getOperand(0) == N0) { in visitFADD()
8393 return DAG.getNode(ISD::FMUL, DL, VT, N0, NewCFP, Flags); in visitFADD()
8397 if (CFP11 && !CFP10 && N0.getOpcode() == ISD::FADD && in visitFADD()
8398 N0.getOperand(0) == N0.getOperand(1) && in visitFADD()
8399 N1.getOperand(0) == N0.getOperand(0)) { in visitFADD()
8406 if (N0.getOpcode() == ISD::FADD && AllowNewConst) { in visitFADD()
8407 bool CFP00 = isConstantFPBuildVectorOrConstantFP(N0.getOperand(0)); in visitFADD()
8409 if (!CFP00 && N0.getOperand(0) == N0.getOperand(1) && in visitFADD()
8410 (N0.getOperand(0) == N1)) { in visitFADD()
8420 N1.getOperand(0) == N0) { in visitFADD()
8422 N0, DAG.getConstantFP(3.0, DL, VT), Flags); in visitFADD()
8428 N0.getOpcode() == ISD::FADD && N1.getOpcode() == ISD::FADD && in visitFADD()
8429 N0.getOperand(0) == N0.getOperand(1) && in visitFADD()
8431 N0.getOperand(0) == N1.getOperand(0)) { in visitFADD()
8432 return DAG.getNode(ISD::FMUL, DL, VT, N0.getOperand(0), in visitFADD()
8447 SDValue N0 = N->getOperand(0); in visitFSUB() local
8449 ConstantFPSDNode *N0CFP = isConstOrConstSplatFP(N0); in visitFSUB()
8463 return DAG.getNode(ISD::FSUB, dl, VT, N0, N1, Flags); in visitFSUB()
8467 return DAG.getNode(ISD::FADD, dl, VT, N0, in visitFSUB()
8474 return N0; in visitFSUB()
8485 if (N0 == N1) in visitFSUB()
8494 if (N10 == N0 && isNegatibleForFree(N11, LegalOperations, TLI, &Options)) in visitFSUB()
8497 if (N11 == N0 && isNegatibleForFree(N10, LegalOperations, TLI, &Options)) in visitFSUB()
8512 SDValue N0 = N->getOperand(0); in visitFMUL() local
8514 ConstantFPSDNode *N0CFP = isConstOrConstSplatFP(N0); in visitFMUL()
8530 return DAG.getNode(ISD::FMUL, DL, VT, N0, N1, Flags); in visitFMUL()
8533 if (isConstantFPBuildVectorOrConstantFP(N0) && in visitFMUL()
8535 return DAG.getNode(ISD::FMUL, DL, VT, N1, N0, Flags); in visitFMUL()
8539 return N0; in visitFMUL()
8547 if (N0.getOpcode() == ISD::FMUL) { in visitFMUL()
8551 SDValue N00 = N0.getOperand(0); in visitFMUL()
8552 SDValue N01 = N0.getOperand(1); in visitFMUL()
8574 if (N0.getOpcode() == ISD::FADD && in visitFMUL()
8575 (N0.getOperand(0) == N0.getOperand(1)) && in visitFMUL()
8576 N0.hasOneUse()) { in visitFMUL()
8579 return DAG.getNode(ISD::FMUL, DL, VT, N0.getOperand(0), MulConsts, Flags); in visitFMUL()
8585 return DAG.getNode(ISD::FADD, DL, VT, N0, N0, Flags); in visitFMUL()
8590 return DAG.getNode(ISD::FNEG, DL, VT, N0); in visitFMUL()
8593 if (char LHSNeg = isNegatibleForFree(N0, LegalOperations, TLI, &Options)) { in visitFMUL()
8599 GetNegatedExpression(N0, DAG, LegalOperations), in visitFMUL()
8615 SDValue N0 = N->getOperand(0); in visitFMA() local
8618 ConstantFPSDNode *N0CFP = dyn_cast<ConstantFPSDNode>(N0); in visitFMA()
8625 if (isa<ConstantFPSDNode>(N0) && in visitFMA()
8628 return DAG.getNode(ISD::FMA, dl, VT, N0, N1, N2); in visitFMA()
8641 return DAG.getNode(ISD::FADD, SDLoc(N), VT, N0, N2); in visitFMA()
8644 if (isConstantFPBuildVectorOrConstantFP(N0) && in visitFMA()
8646 return DAG.getNode(ISD::FMA, SDLoc(N), VT, N1, N0, N2); in visitFMA()
8655 if (N2.getOpcode() == ISD::FMUL && N0 == N2.getOperand(0) && in visitFMA()
8658 return DAG.getNode(ISD::FMUL, dl, VT, N0, in visitFMA()
8664 if (N0.getOpcode() == ISD::FMUL && in visitFMA()
8666 isConstantFPBuildVectorOrConstantFP(N0.getOperand(1))) { in visitFMA()
8668 N0.getOperand(0), in visitFMA()
8669 DAG.getNode(ISD::FMUL, dl, VT, N1, N0.getOperand(1), in visitFMA()
8680 return DAG.getNode(ISD::FADD, dl, VT, N0, N2); in visitFMA()
8684 SDValue RHSNeg = DAG.getNode(ISD::FNEG, dl, VT, N0); in visitFMA()
8693 if (N1CFP && N0 == N2) { in visitFMA()
8694 return DAG.getNode(ISD::FMUL, dl, VT, N0, in visitFMA()
8701 if (N1CFP && N2.getOpcode() == ISD::FNEG && N2.getOperand(0) == N0) { in visitFMA()
8702 return DAG.getNode(ISD::FMUL, dl, VT, N0, in visitFMA()
8726 SDValue N0 = N->getOperand(0); in combineRepeatedFPDivisors() local
8727 ConstantFPSDNode *N0CFP = dyn_cast<ConstantFPSDNode>(N0); in combineRepeatedFPDivisors()
8777 SDValue N0 = N->getOperand(0); in visitFDIV() local
8779 ConstantFPSDNode *N0CFP = dyn_cast<ConstantFPSDNode>(N0); in visitFDIV()
8793 return DAG.getNode(ISD::FDIV, SDLoc(N), VT, N0, N1, Flags); in visitFDIV()
8811 return DAG.getNode(ISD::FMUL, DL, VT, N0, in visitFDIV()
8819 return DAG.getNode(ISD::FMUL, DL, VT, N0, RV, Flags); in visitFDIV()
8827 return DAG.getNode(ISD::FMUL, DL, VT, N0, RV, Flags); in visitFDIV()
8835 return DAG.getNode(ISD::FMUL, DL, VT, N0, RV, Flags); in visitFDIV()
8855 return DAG.getNode(ISD::FMUL, DL, VT, N0, RV, Flags); in visitFDIV()
8863 return DAG.getNode(ISD::FMUL, DL, VT, N0, RV, Flags); in visitFDIV()
8868 if (char LHSNeg = isNegatibleForFree(N0, LegalOperations, TLI, &Options)) { in visitFDIV()
8874 GetNegatedExpression(N0, DAG, LegalOperations), in visitFDIV()
8887 SDValue N0 = N->getOperand(0); in visitFREM() local
8889 ConstantFPSDNode *N0CFP = dyn_cast<ConstantFPSDNode>(N0); in visitFREM()
8895 return DAG.getNode(ISD::FREM, SDLoc(N), VT, N0, N1, in visitFREM()
8930 SDValue N0 = N->getOperand(0); in visitFCOPYSIGN() local
8932 ConstantFPSDNode *N0CFP = dyn_cast<ConstantFPSDNode>(N0); in visitFCOPYSIGN()
8937 return DAG.getNode(ISD::FCOPYSIGN, SDLoc(N), VT, N0, N1); in visitFCOPYSIGN()
8945 return DAG.getNode(ISD::FABS, SDLoc(N), VT, N0); in visitFCOPYSIGN()
8949 DAG.getNode(ISD::FABS, SDLoc(N0), VT, N0)); in visitFCOPYSIGN()
8956 if (N0.getOpcode() == ISD::FABS || N0.getOpcode() == ISD::FNEG || in visitFCOPYSIGN()
8957 N0.getOpcode() == ISD::FCOPYSIGN) in visitFCOPYSIGN()
8959 N0.getOperand(0), N1); in visitFCOPYSIGN()
8963 return DAG.getNode(ISD::FABS, SDLoc(N), VT, N0); in visitFCOPYSIGN()
8968 N0, N1.getOperand(1)); in visitFCOPYSIGN()
8974 N0, N1.getOperand(0)); in visitFCOPYSIGN()
8980 SDValue N0 = N->getOperand(0); in visitSINT_TO_FP() local
8982 EVT OpVT = N0.getValueType(); in visitSINT_TO_FP()
8985 if (DAG.isConstantIntBuildVectorOrConstantInt(N0) && in visitSINT_TO_FP()
8989 return DAG.getNode(ISD::SINT_TO_FP, SDLoc(N), VT, N0); in visitSINT_TO_FP()
8996 if (DAG.SignBitIsZero(N0)) in visitSINT_TO_FP()
8997 return DAG.getNode(ISD::UINT_TO_FP, SDLoc(N), VT, N0); in visitSINT_TO_FP()
9003 if (N0.getOpcode() == ISD::SETCC && N0.getValueType() == MVT::i1 && in visitSINT_TO_FP()
9009 { N0.getOperand(0), N0.getOperand(1), in visitSINT_TO_FP()
9011 N0.getOperand(2) }; in visitSINT_TO_FP()
9017 if (N0.getOpcode() == ISD::ZERO_EXTEND && in visitSINT_TO_FP()
9018 N0.getOperand(0).getOpcode() == ISD::SETCC &&!VT.isVector() && in visitSINT_TO_FP()
9023 { N0.getOperand(0).getOperand(0), N0.getOperand(0).getOperand(1), in visitSINT_TO_FP()
9025 N0.getOperand(0).getOperand(2) }; in visitSINT_TO_FP()
9034 SDValue N0 = N->getOperand(0); in visitUINT_TO_FP() local
9036 EVT OpVT = N0.getValueType(); in visitUINT_TO_FP()
9039 if (DAG.isConstantIntBuildVectorOrConstantInt(N0) && in visitUINT_TO_FP()
9043 return DAG.getNode(ISD::UINT_TO_FP, SDLoc(N), VT, N0); in visitUINT_TO_FP()
9050 if (DAG.SignBitIsZero(N0)) in visitUINT_TO_FP()
9051 return DAG.getNode(ISD::SINT_TO_FP, SDLoc(N), VT, N0); in visitUINT_TO_FP()
9058 if (N0.getOpcode() == ISD::SETCC && !VT.isVector() && in visitUINT_TO_FP()
9063 { N0.getOperand(0), N0.getOperand(1), in visitUINT_TO_FP()
9065 N0.getOperand(2) }; in visitUINT_TO_FP()
9075 SDValue N0 = N->getOperand(0); in FoldIntToFPToInt() local
9078 if (N0.getOpcode() != ISD::UINT_TO_FP && N0.getOpcode() != ISD::SINT_TO_FP) in FoldIntToFPToInt()
9081 SDValue Src = N0.getOperand(0); in FoldIntToFPToInt()
9083 bool IsInputSigned = N0.getOpcode() == ISD::SINT_TO_FP; in FoldIntToFPToInt()
9098 const fltSemantics &sem = DAG.EVTToAPFloatSemantics(N0.getValueType()); in FoldIntToFPToInt()
9116 SDValue N0 = N->getOperand(0); in visitFP_TO_SINT() local
9120 if (isConstantFPBuildVectorOrConstantFP(N0)) in visitFP_TO_SINT()
9121 return DAG.getNode(ISD::FP_TO_SINT, SDLoc(N), VT, N0); in visitFP_TO_SINT()
9127 SDValue N0 = N->getOperand(0); in visitFP_TO_UINT() local
9131 if (isConstantFPBuildVectorOrConstantFP(N0)) in visitFP_TO_UINT()
9132 return DAG.getNode(ISD::FP_TO_UINT, SDLoc(N), VT, N0); in visitFP_TO_UINT()
9138 SDValue N0 = N->getOperand(0); in visitFP_ROUND() local
9140 ConstantFPSDNode *N0CFP = dyn_cast<ConstantFPSDNode>(N0); in visitFP_ROUND()
9145 return DAG.getNode(ISD::FP_ROUND, SDLoc(N), VT, N0, N1); in visitFP_ROUND()
9148 if (N0.getOpcode() == ISD::FP_EXTEND && VT == N0.getOperand(0).getValueType()) in visitFP_ROUND()
9149 return N0.getOperand(0); in visitFP_ROUND()
9152 if (N0.getOpcode() == ISD::FP_ROUND) { in visitFP_ROUND()
9154 const bool N0IsTrunc = N0.getNode()->getConstantOperandVal(1) == 1; in visitFP_ROUND()
9163 if (N0.getOperand(0).getValueType() == MVT::f80 && VT == MVT::f16) in visitFP_ROUND()
9173 return DAG.getNode(ISD::FP_ROUND, DL, VT, N0.getOperand(0), in visitFP_ROUND()
9179 if (N0.getOpcode() == ISD::FCOPYSIGN && N0.getNode()->hasOneUse()) { in visitFP_ROUND()
9180 SDValue Tmp = DAG.getNode(ISD::FP_ROUND, SDLoc(N0), VT, in visitFP_ROUND()
9181 N0.getOperand(0), N1); in visitFP_ROUND()
9184 Tmp, N0.getOperand(1)); in visitFP_ROUND()
9191 SDValue N0 = N->getOperand(0); in visitFP_ROUND_INREG() local
9194 ConstantFPSDNode *N0CFP = dyn_cast<ConstantFPSDNode>(N0); in visitFP_ROUND_INREG()
9207 SDValue N0 = N->getOperand(0); in visitFP_EXTEND() local
9216 if (isConstantFPBuildVectorOrConstantFP(N0)) in visitFP_EXTEND()
9217 return DAG.getNode(ISD::FP_EXTEND, SDLoc(N), VT, N0); in visitFP_EXTEND()
9220 if (N0.getOpcode() == ISD::FP16_TO_FP && in visitFP_EXTEND()
9222 return DAG.getNode(ISD::FP16_TO_FP, SDLoc(N), VT, N0.getOperand(0)); in visitFP_EXTEND()
9226 if (N0.getOpcode() == ISD::FP_ROUND in visitFP_EXTEND()
9227 && N0.getNode()->getConstantOperandVal(1) == 1) { in visitFP_EXTEND()
9228 SDValue In = N0.getOperand(0); in visitFP_EXTEND()
9232 In, N0.getOperand(1)); in visitFP_EXTEND()
9237 if (ISD::isNormalLoad(N0.getNode()) && N0.hasOneUse() && in visitFP_EXTEND()
9238 TLI.isLoadExtLegal(ISD::EXTLOAD, VT, N0.getValueType())) { in visitFP_EXTEND()
9239 LoadSDNode *LN0 = cast<LoadSDNode>(N0); in visitFP_EXTEND()
9242 LN0->getBasePtr(), N0.getValueType(), in visitFP_EXTEND()
9245 CombineTo(N0.getNode(), in visitFP_EXTEND()
9246 DAG.getNode(ISD::FP_ROUND, SDLoc(N0), in visitFP_EXTEND()
9247 N0.getValueType(), ExtLoad, in visitFP_EXTEND()
9248 DAG.getIntPtrConstant(1, SDLoc(N0))), in visitFP_EXTEND()
9257 SDValue N0 = N->getOperand(0); in visitFCEIL() local
9261 if (isConstantFPBuildVectorOrConstantFP(N0)) in visitFCEIL()
9262 return DAG.getNode(ISD::FCEIL, SDLoc(N), VT, N0); in visitFCEIL()
9268 SDValue N0 = N->getOperand(0); in visitFTRUNC() local
9272 if (isConstantFPBuildVectorOrConstantFP(N0)) in visitFTRUNC()
9273 return DAG.getNode(ISD::FTRUNC, SDLoc(N), VT, N0); in visitFTRUNC()
9279 SDValue N0 = N->getOperand(0); in visitFFLOOR() local
9283 if (isConstantFPBuildVectorOrConstantFP(N0)) in visitFFLOOR()
9284 return DAG.getNode(ISD::FFLOOR, SDLoc(N), VT, N0); in visitFFLOOR()
9291 SDValue N0 = N->getOperand(0); in visitFNEG() local
9295 if (isConstantFPBuildVectorOrConstantFP(N0)) in visitFNEG()
9296 return DAG.getNode(ISD::FNEG, SDLoc(N), VT, N0); in visitFNEG()
9298 if (isNegatibleForFree(N0, LegalOperations, DAG.getTargetLoweringInfo(), in visitFNEG()
9300 return GetNegatedExpression(N0, DAG, LegalOperations); in visitFNEG()
9305 N0.getOpcode() == ISD::BITCAST && in visitFNEG()
9306 N0.getNode()->hasOneUse()) { in visitFNEG()
9307 SDValue Int = N0.getOperand(0); in visitFNEG()
9311 if (N0.getValueType().isVector()) { in visitFNEG()
9314 SignMask = APInt::getSignBit(N0.getValueType().getScalarSizeInBits()); in visitFNEG()
9320 SDLoc DL0(N0); in visitFNEG()
9329 if (N0.getOpcode() == ISD::FMUL && in visitFNEG()
9330 (N0.getNode()->hasOneUse() || !TLI.isFNegFree(VT))) { in visitFNEG()
9331 ConstantFPSDNode *CFP1 = dyn_cast<ConstantFPSDNode>(N0.getOperand(1)); in visitFNEG()
9338 return DAG.getNode(ISD::FMUL, SDLoc(N), VT, N0.getOperand(0), in visitFNEG()
9340 N0.getOperand(1)), in visitFNEG()
9341 &cast<BinaryWithFlagsSDNode>(N0)->Flags); in visitFNEG()
9349 SDValue N0 = N->getOperand(0); in visitFMINNUM() local
9352 const ConstantFPSDNode *N0CFP = isConstOrConstSplatFP(N0); in visitFMINNUM()
9362 if (isConstantFPBuildVectorOrConstantFP(N0) && in visitFMINNUM()
9364 return DAG.getNode(ISD::FMINNUM, SDLoc(N), VT, N1, N0); in visitFMINNUM()
9370 SDValue N0 = N->getOperand(0); in visitFMAXNUM() local
9373 const ConstantFPSDNode *N0CFP = isConstOrConstSplatFP(N0); in visitFMAXNUM()
9383 if (isConstantFPBuildVectorOrConstantFP(N0) && in visitFMAXNUM()
9385 return DAG.getNode(ISD::FMAXNUM, SDLoc(N), VT, N1, N0); in visitFMAXNUM()
9391 SDValue N0 = N->getOperand(0); in visitFABS() local
9395 if (isConstantFPBuildVectorOrConstantFP(N0)) in visitFABS()
9396 return DAG.getNode(ISD::FABS, SDLoc(N), VT, N0); in visitFABS()
9399 if (N0.getOpcode() == ISD::FABS) in visitFABS()
9404 if (N0.getOpcode() == ISD::FNEG || N0.getOpcode() == ISD::FCOPYSIGN) in visitFABS()
9405 return DAG.getNode(ISD::FABS, SDLoc(N), VT, N0.getOperand(0)); in visitFABS()
9410 N0.getOpcode() == ISD::BITCAST && in visitFABS()
9411 N0.getNode()->hasOneUse()) { in visitFABS()
9412 SDValue Int = N0.getOperand(0); in visitFABS()
9416 if (N0.getValueType().isVector()) { in visitFABS()
9419 SignMask = ~APInt::getSignBit(N0.getValueType().getScalarSizeInBits()); in visitFABS()
9425 SDLoc DL(N0); in visitFABS()
10895 SDValue N0 = Value.getOperand(0); in ReduceLoadOpStoreWidth() local
10896 if (ISD::isNormalLoad(N0.getNode()) && N0.hasOneUse() && in ReduceLoadOpStoreWidth()
10897 Chain == SDValue(N0.getNode(), 1)) { in ReduceLoadOpStoreWidth()
10898 LoadSDNode *LD = cast<LoadSDNode>(N0); in ReduceLoadOpStoreWidth()
10953 SDValue NewLD = DAG.getLoad(NewVT, SDLoc(N0), in ReduceLoadOpStoreWidth()
10971 DAG.ReplaceAllUsesOfValueWith(N0.getValue(1), NewLD.getValue(1)); in ReduceLoadOpStoreWidth()
13318 static SDValue simplifyShuffleOperands(ShuffleVectorSDNode *SVN, SDValue N0, in simplifyShuffleOperands() argument
13329 SDValue S0 = simplifyShuffleOperandRecursively(N0UsedElements, N0, DAG); in simplifyShuffleOperands()
13331 if (S0 == N0 && S1 == N1) in simplifyShuffleOperands()
13343 SDValue N0 = N->getOperand(0); in partitionShuffleOfConcats() local
13348 EVT ConcatVT = N0.getOperand(0).getValueType(); in partitionShuffleOfConcats()
13358 N0 = DAG.getVectorShuffle(ConcatVT, SDLoc(N), N0.getOperand(0), N0.getOperand(1), in partitionShuffleOfConcats()
13361 return DAG.getNode(ISD::CONCAT_VECTORS, SDLoc(N), VT, N0, N1); in partitionShuffleOfConcats()
13386 if (FirstElt < N0.getNumOperands()) in partitionShuffleOfConcats()
13387 Ops.push_back(N0.getOperand(FirstElt)); in partitionShuffleOfConcats()
13389 Ops.push_back(N1.getOperand(FirstElt - N0.getNumOperands())); in partitionShuffleOfConcats()
13392 Ops.push_back(DAG.getUNDEF(N0.getOperand(0).getValueType())); in partitionShuffleOfConcats()
13405 SDValue N0 = N->getOperand(0); in visitVECTOR_SHUFFLE() local
13408 assert(N0.getValueType() == VT && "Vector shuffle must be normalized in DAG"); in visitVECTOR_SHUFFLE()
13411 if (N0.isUndef() && N1.isUndef()) in visitVECTOR_SHUFFLE()
13417 if (N0 == N1) { in visitVECTOR_SHUFFLE()
13424 return DAG.getVectorShuffle(VT, SDLoc(N), N0, DAG.getUNDEF(VT), NewMask); in visitVECTOR_SHUFFLE()
13428 if (N0.isUndef()) in visitVECTOR_SHUFFLE()
13444 return DAG.getVectorShuffle(VT, SDLoc(N), N0, N1, NewMask); in visitVECTOR_SHUFFLE()
13450 SDNode *V = N0.getNode(); in visitVECTOR_SHUFFLE()
13475 return N0; in visitVECTOR_SHUFFLE()
13484 return N0; in visitVECTOR_SHUFFLE()
13502 if (SDValue S = simplifyShuffleOperands(SVN, N0, N1, DAG)) in visitVECTOR_SHUFFLE()
13505 if (N0.getOpcode() == ISD::CONCAT_VECTORS && in visitVECTOR_SHUFFLE()
13509 N0.getOperand(0).getValueType() == N1.getOperand(0).getValueType()))) { in visitVECTOR_SHUFFLE()
13522 SDValue &S = (M < (int)NumElts ? N0 : N1); in visitVECTOR_SHUFFLE()
13554 if (N0.getOpcode() == ISD::BITCAST && N0.hasOneUse() && in visitVECTOR_SHUFFLE()
13559 SDValue BC0 = N0; in visitVECTOR_SHUFFLE()
13630 N0.getOpcode() != ISD::VECTOR_SHUFFLE && Level < AfterLegalizeDAG && in visitVECTOR_SHUFFLE()
13639 bool HasSameOp0 = N0 == SV0; in visitVECTOR_SHUFFLE()
13641 if (HasSameOp0 || IsSV1Undef || N0 == SV1) in visitVECTOR_SHUFFLE()
13653 if (N0.getOpcode() == ISD::VECTOR_SHUFFLE && N->isOnlyUserOf(N0.getNode()) && in visitVECTOR_SHUFFLE()
13655 ShuffleVectorSDNode *OtherSV = cast<ShuffleVectorSDNode>(N0); in visitVECTOR_SHUFFLE()
13783 SDValue N0 = N->getOperand(0); in visitINSERT_SUBVECTOR() local
13787 if (N0.getValueType() != N1.getValueType()) in visitINSERT_SUBVECTOR()
13792 if (N0.getOpcode() == ISD::CONCAT_VECTORS && N0->getNumOperands() == 2 && in visitINSERT_SUBVECTOR()
13801 N0.getOperand(1)); in visitINSERT_SUBVECTOR()
13806 return DAG.getNode(ISD::CONCAT_VECTORS, SDLoc(N), VT, N0.getOperand(0), in visitINSERT_SUBVECTOR()
13814 SDValue N0 = N->getOperand(0); in visitFP_TO_FP16() local
13817 if (N0->getOpcode() == ISD::FP16_TO_FP) in visitFP_TO_FP16()
13818 return N0->getOperand(0); in visitFP_TO_FP16()
13824 SDValue N0 = N->getOperand(0); in visitFP16_TO_FP() local
13827 if (N0->getOpcode() == ISD::AND) { in visitFP16_TO_FP()
13828 ConstantSDNode *AndConst = getAsNonOpaqueConstant(N0.getOperand(1)); in visitFP16_TO_FP()
13831 N0.getOperand(0)); in visitFP16_TO_FP()
13976 SDValue DAGCombiner::SimplifySelect(const SDLoc &DL, SDValue N0, SDValue N1, in SimplifySelect() argument
13978 assert(N0.getOpcode() ==ISD::SETCC && "First argument must be a SetCC node!"); in SimplifySelect()
13980 SDValue SCC = SimplifySelectCC(DL, N0.getOperand(0), N0.getOperand(1), N1, N2, in SimplifySelect()
13981 cast<CondCodeSDNode>(N0.getOperand(2))->get()); in SimplifySelect()
13990 SDValue SETCC = DAG.getNode(ISD::SETCC, SDLoc(N0), in SimplifySelect()
13991 N0.getValueType(), in SimplifySelect()
14160 SDValue DAGCombiner::SimplifySelectCC(const SDLoc &DL, SDValue N0, SDValue N1, in SimplifySelectCC() argument
14171 SDValue SCC = SimplifySetCC(getSetCCResultType(N0.getValueType()), in SimplifySelectCC()
14172 N0, N1, CC, DL, false); in SimplifySelectCC()
14187 N0 == N2 && N3.getOpcode() == ISD::FNEG && in SimplifySelectCC()
14189 return DAG.getNode(ISD::FABS, DL, VT, N0); in SimplifySelectCC()
14193 N0 == N3 && N2.getOpcode() == ISD::FNEG && in SimplifySelectCC()
14238 getSetCCResultType(N0.getValueType()), in SimplifySelectCC()
14239 N0, N1, CC); in SimplifySelectCC()
14258 (isOneConstant(N1) && N0 == N2))) { // (a < 1) ? a : 0 in SimplifySelectCC()
14259 EVT XType = N0.getValueType(); in SimplifySelectCC()
14267 SDValue ShCt = DAG.getConstant(ShCtV, SDLoc(N0), in SimplifySelectCC()
14268 getShiftAmountTy(N0.getValueType())); in SimplifySelectCC()
14269 SDValue Shift = DAG.getNode(ISD::SRL, SDLoc(N0), in SimplifySelectCC()
14270 XType, N0, ShCt); in SimplifySelectCC()
14281 SDValue Shift = DAG.getNode(ISD::SRA, SDLoc(N0), in SimplifySelectCC()
14282 XType, N0, in SimplifySelectCC()
14284 SDLoc(N0), in SimplifySelectCC()
14285 getShiftAmountTy(N0.getValueType()))); in SimplifySelectCC()
14303 if (CC == ISD::SETEQ && N0->getOpcode() == ISD::AND && in SimplifySelectCC()
14304 N0->getValueType(0) == VT && isNullConstant(N1) && isNullConstant(N2)) { in SimplifySelectCC()
14305 SDValue AndLHS = N0->getOperand(0); in SimplifySelectCC()
14306 ConstantSDNode *ConstAndRHS = dyn_cast<ConstantSDNode>(N0->getOperand(1)); in SimplifySelectCC()
14313 SDValue Shl = DAG.getNode(ISD::SHL, SDLoc(N0), VT, AndLHS, ShlAmt); in SimplifySelectCC()
14320 SDValue Shr = DAG.getNode(ISD::SRA, SDLoc(N0), VT, Shl, ShrAmt); in SimplifySelectCC()
14328 TLI.getBooleanContents(N0.getValueType()) == in SimplifySelectCC()
14339 TLI.isOperationLegal(ISD::SETCC, N0.getValueType())) { in SimplifySelectCC()
14343 SCC = DAG.getSetCC(DL, getSetCCResultType(N0.getValueType()), in SimplifySelectCC()
14344 N0, N1, CC); in SimplifySelectCC()
14352 SCC = DAG.getSetCC(SDLoc(N0), MVT::i1, N0, N1, CC); in SimplifySelectCC()
14381 N0 == N2 && N3.getOpcode() == ISD::SUB && N0 == N3.getOperand(1)) in SimplifySelectCC()
14385 N0 == N3 && N2.getOpcode() == ISD::SUB && N0 == N2.getOperand(1)) in SimplifySelectCC()
14388 EVT XType = N0.getValueType(); in SimplifySelectCC()
14390 SDLoc DL(N0); in SimplifySelectCC()
14392 N0, in SimplifySelectCC()
14394 getShiftAmountTy(N0.getValueType()))); in SimplifySelectCC()
14396 XType, N0, Shift); in SimplifySelectCC()
14424 N0 == Count.getOperand(0) && in SimplifySelectCC()
14426 return DAG.getNode(ISD::CTTZ, DL, VT, N0); in SimplifySelectCC()
14431 N0 == Count.getOperand(0) && in SimplifySelectCC()
14433 return DAG.getNode(ISD::CTLZ, DL, VT, N0); in SimplifySelectCC()
14442 SDValue DAGCombiner::SimplifySetCC(EVT VT, SDValue N0, SDValue N1, in SimplifySetCC() argument
14447 return TLI.SimplifySetCC(VT, N0, N1, Cond, foldBooleans, DagCombineInfo, DL); in SimplifySetCC()