• Home
  • Raw
  • Download

Lines Matching refs:N0

1281 SDValue TargetLowering::simplifySetCCWithAnd(EVT VT, SDValue N0, SDValue N1,  in simplifySetCCWithAnd()  argument
1288 if (N1.getOpcode() == ISD::AND && N0.getOpcode() != ISD::AND) in simplifySetCCWithAnd()
1289 std::swap(N0, N1); in simplifySetCCWithAnd()
1291 EVT OpVT = N0.getValueType(); in simplifySetCCWithAnd()
1292 if (N0.getOpcode() != ISD::AND || !OpVT.isInteger() || in simplifySetCCWithAnd()
1297 if (N0.getOperand(0) == N1) { in simplifySetCCWithAnd()
1298 X = N0.getOperand(1); in simplifySetCCWithAnd()
1299 Y = N0.getOperand(0); in simplifySetCCWithAnd()
1300 } else if (N0.getOperand(1) == N1) { in simplifySetCCWithAnd()
1301 X = N0.getOperand(0); in simplifySetCCWithAnd()
1302 Y = N0.getOperand(1); in simplifySetCCWithAnd()
1316 isCondCodeLegal(Cond, N0.getSimpleValueType())) in simplifySetCCWithAnd()
1317 return DAG.getSetCC(DL, VT, N0, Zero, Cond); in simplifySetCCWithAnd()
1318 } else if (N0.hasOneUse() && hasAndNotCompare(Y)) { in simplifySetCCWithAnd()
1333 SDValue NewAnd = DAG.getNode(ISD::AND, SDLoc(N0), OpVT, NotX, Y); in simplifySetCCWithAnd()
1342 SDValue TargetLowering::SimplifySetCC(EVT VT, SDValue N0, SDValue N1, in SimplifySetCC() argument
1356 getBooleanContents(N0->getValueType(0)); in SimplifySetCC()
1366 if (isa<ConstantSDNode>(N0.getNode()) && in SimplifySetCC()
1368 isCondCodeLegal(SwappedCC, N0.getSimpleValueType()))) in SimplifySetCC()
1369 return DAG.getSetCC(dl, VT, N1, N0, SwappedCC); in SimplifySetCC()
1377 if (N0.getOpcode() == ISD::SRL && (C1 == 0 || C1 == 1) && in SimplifySetCC()
1378 N0.getOperand(0).getOpcode() == ISD::CTLZ && in SimplifySetCC()
1379 N0.getOperand(1).getOpcode() == ISD::Constant) { in SimplifySetCC()
1381 = cast<ConstantSDNode>(N0.getOperand(1))->getAPIntValue(); in SimplifySetCC()
1383 ShAmt == Log2_32(N0.getValueType().getSizeInBits())) { in SimplifySetCC()
1393 SDValue Zero = DAG.getConstant(0, dl, N0.getValueType()); in SimplifySetCC()
1394 return DAG.getSetCC(dl, VT, N0.getOperand(0).getOperand(0), in SimplifySetCC()
1399 SDValue CTPOP = N0; in SimplifySetCC()
1401 if (N0.hasOneUse() && N0.getOpcode() == ISD::TRUNCATE) in SimplifySetCC()
1402 CTPOP = N0.getOperand(0); in SimplifySetCC()
1405 (N0 == CTPOP || N0.getValueType().getSizeInBits() > in SimplifySetCC()
1426 DCI.isBeforeLegalize() && N0->hasOneUse()) { in SimplifySetCC()
1427 unsigned MinBits = N0.getValueSizeInBits(); in SimplifySetCC()
1430 if (N0->getOpcode() == ISD::ZERO_EXTEND) { in SimplifySetCC()
1432 MinBits = N0->getOperand(0).getValueSizeInBits(); in SimplifySetCC()
1433 PreExt = N0->getOperand(0); in SimplifySetCC()
1434 } else if (N0->getOpcode() == ISD::AND) { in SimplifySetCC()
1436 if (auto *C = dyn_cast<ConstantSDNode>(N0->getOperand(1))) in SimplifySetCC()
1439 PreExt = N0->getOperand(0); in SimplifySetCC()
1441 } else if (N0->getOpcode() == ISD::SIGN_EXTEND) { in SimplifySetCC()
1443 MinBits = N0->getOperand(0).getValueSizeInBits(); in SimplifySetCC()
1444 PreExt = N0->getOperand(0); in SimplifySetCC()
1446 } else if (auto *LN0 = dyn_cast<LoadSDNode>(N0)) { in SimplifySetCC()
1450 PreExt = N0; in SimplifySetCC()
1454 PreExt = N0; in SimplifySetCC()
1483 SDValue TopSetCC = N0->getOperand(0); in SimplifySetCC()
1484 unsigned N0Opc = N0->getOpcode(); in SimplifySetCC()
1490 isExtendedTrueVal(N1C, N0->getValueType(0), SExt))) { in SimplifySetCC()
1514 N0.getOpcode() == ISD::AND && C1 == 0 && in SimplifySetCC()
1515 N0.getNode()->hasOneUse() && in SimplifySetCC()
1516 isa<LoadSDNode>(N0.getOperand(0)) && in SimplifySetCC()
1517 N0.getOperand(0).getNode()->hasOneUse() && in SimplifySetCC()
1518 isa<ConstantSDNode>(N0.getOperand(1))) { in SimplifySetCC()
1519 LoadSDNode *Lod = cast<LoadSDNode>(N0.getOperand(0)); in SimplifySetCC()
1523 unsigned origWidth = N0.getValueType().getSizeInBits(); in SimplifySetCC()
1530 cast<ConstantSDNode>(N0.getOperand(1))->getAPIntValue(); in SimplifySetCC()
1569 if (N0.getOpcode() == ISD::ZERO_EXTEND) { in SimplifySetCC()
1570 unsigned InSize = N0.getOperand(0).getValueType().getSizeInBits(); in SimplifySetCC()
1604 EVT newVT = N0.getOperand(0).getValueType(); in SimplifySetCC()
1612 SDValue NewSetCC = DAG.getSetCC(dl, NewSetCCVT, N0.getOperand(0), in SimplifySetCC()
1614 return DAG.getBoolExtOrTrunc(NewSetCC, dl, VT, N0.getValueType()); in SimplifySetCC()
1621 } else if (N0.getOpcode() == ISD::SIGN_EXTEND_INREG && in SimplifySetCC()
1623 EVT ExtSrcTy = cast<VTSDNode>(N0.getOperand(1))->getVT(); in SimplifySetCC()
1625 EVT ExtDstTy = N0.getValueType(); in SimplifySetCC()
1634 EVT Op0Ty = N0.getOperand(0).getValueType(); in SimplifySetCC()
1636 ZextOp = N0.getOperand(0); in SimplifySetCC()
1639 ZextOp = DAG.getNode(ISD::AND, dl, Op0Ty, N0.getOperand(0), in SimplifySetCC()
1654 if (N0.getOpcode() == ISD::SETCC && in SimplifySetCC()
1655 isTypeLegal(VT) && VT.bitsLE(N0.getValueType())) { in SimplifySetCC()
1658 return DAG.getNode(ISD::TRUNCATE, dl, VT, N0); in SimplifySetCC()
1660 ISD::CondCode CC = cast<CondCodeSDNode>(N0.getOperand(2))->get(); in SimplifySetCC()
1662 N0.getOperand(0).getValueType().isInteger()); in SimplifySetCC()
1664 isCondCodeLegal(CC, N0.getOperand(0).getSimpleValueType())) in SimplifySetCC()
1665 return DAG.getSetCC(dl, VT, N0.getOperand(0), N0.getOperand(1), CC); in SimplifySetCC()
1668 if ((N0.getOpcode() == ISD::XOR || in SimplifySetCC()
1669 (N0.getOpcode() == ISD::AND && in SimplifySetCC()
1670 N0.getOperand(0).getOpcode() == ISD::XOR && in SimplifySetCC()
1671 N0.getOperand(1) == N0.getOperand(0).getOperand(1))) && in SimplifySetCC()
1672 isa<ConstantSDNode>(N0.getOperand(1)) && in SimplifySetCC()
1673 cast<ConstantSDNode>(N0.getOperand(1))->getAPIntValue() == 1) { in SimplifySetCC()
1676 unsigned BitWidth = N0.getValueSizeInBits(); in SimplifySetCC()
1677 if (DAG.MaskedValueIsZero(N0, in SimplifySetCC()
1682 if (N0.getOpcode() == ISD::XOR) in SimplifySetCC()
1683 Val = N0.getOperand(0); in SimplifySetCC()
1685 assert(N0.getOpcode() == ISD::AND && in SimplifySetCC()
1686 N0.getOperand(0).getOpcode() == ISD::XOR); in SimplifySetCC()
1688 Val = DAG.getNode(ISD::AND, dl, N0.getValueType(), in SimplifySetCC()
1689 N0.getOperand(0).getOperand(0), in SimplifySetCC()
1690 N0.getOperand(1)); in SimplifySetCC()
1698 getBooleanContents(N0->getValueType(0)) == in SimplifySetCC()
1700 SDValue Op0 = N0; in SimplifySetCC()
1757 return DAG.getSetCC(dl, VT, N0, in SimplifySetCC()
1772 return DAG.getSetCC(dl, VT, N0, in SimplifySetCC()
1789 return DAG.getSetCC(dl, VT, N0, N1, ISD::SETNE); in SimplifySetCC()
1792 return DAG.getSetCC(dl, VT, N0, N1, ISD::SETNE); in SimplifySetCC()
1796 return DAG.getSetCC(dl, VT, N0, in SimplifySetCC()
1797 DAG.getConstant(MinVal, dl, N0.getValueType()), in SimplifySetCC()
1801 return DAG.getSetCC(dl, VT, N0, in SimplifySetCC()
1802 DAG.getConstant(MaxVal, dl, N0.getValueType()), in SimplifySetCC()
1811 return DAG.getSetCC(dl, VT, N0, in SimplifySetCC()
1821 return DAG.getSetCC(dl, VT, N0, ConstMinusOne, ISD::SETGT); in SimplifySetCC()
1826 (VT == N0.getValueType() || in SimplifySetCC()
1827 (isTypeLegal(VT) && VT.bitsLE(N0.getValueType()))) && in SimplifySetCC()
1828 N0.getOpcode() == ISD::AND) { in SimplifySetCC()
1830 if (auto *AndRHS = dyn_cast<ConstantSDNode>(N0.getOperand(1))) { in SimplifySetCC()
1833 : getShiftAmountTy(N0.getValueType(), DL); in SimplifySetCC()
1838 DAG.getNode(ISD::SRL, dl, N0.getValueType(), N0, in SimplifySetCC()
1847 DAG.getNode(ISD::SRL, dl, N0.getValueType(), N0, in SimplifySetCC()
1859 N0.getOpcode() == ISD::AND && N0.hasOneUse()) { in SimplifySetCC()
1860 if (auto *AndRHS = dyn_cast<ConstantSDNode>(N0.getOperand(1))) { in SimplifySetCC()
1867 : getShiftAmountTy(N0.getValueType(), DL); in SimplifySetCC()
1868 EVT CmpTy = N0.getValueType(); in SimplifySetCC()
1869 SDValue Shift = DAG.getNode(ISD::SRL, dl, CmpTy, N0.getOperand(0), in SimplifySetCC()
1899 : getShiftAmountTy(N0.getValueType(), DL); in SimplifySetCC()
1900 EVT CmpTy = N0.getValueType(); in SimplifySetCC()
1901 SDValue Shift = DAG.getNode(ISD::SRL, dl, CmpTy, N0, in SimplifySetCC()
1910 if (isa<ConstantFPSDNode>(N0.getNode())) { in SimplifySetCC()
1912 SDValue O = DAG.FoldSetCC(VT, N0, N1, Cond, dl); in SimplifySetCC()
1935 return DAG.getSetCC(dl, VT, N0, N0, Cond); in SimplifySetCC()
1939 if (!isCondCodeLegal(Cond, N0.getSimpleValueType())) { in SimplifySetCC()
1946 isCondCodeLegal(ISD::SETOLE, N0.getSimpleValueType())) in SimplifySetCC()
1947 return DAG.getSetCC(dl, VT, N0, N1, ISD::SETOLE); in SimplifySetCC()
1949 isCondCodeLegal(ISD::SETOLE, N0.getSimpleValueType())) in SimplifySetCC()
1950 return DAG.getSetCC(dl, VT, N0, N1, ISD::SETULE); in SimplifySetCC()
1952 isCondCodeLegal(ISD::SETUGT, N0.getSimpleValueType())) in SimplifySetCC()
1953 return DAG.getSetCC(dl, VT, N0, N1, ISD::SETUGT); in SimplifySetCC()
1955 isCondCodeLegal(ISD::SETUGT, N0.getSimpleValueType())) in SimplifySetCC()
1956 return DAG.getSetCC(dl, VT, N0, N1, ISD::SETOGT); in SimplifySetCC()
1959 isCondCodeLegal(ISD::SETOGE, N0.getSimpleValueType())) in SimplifySetCC()
1960 return DAG.getSetCC(dl, VT, N0, N1, ISD::SETOGE); in SimplifySetCC()
1962 isCondCodeLegal(ISD::SETOGE, N0.getSimpleValueType())) in SimplifySetCC()
1963 return DAG.getSetCC(dl, VT, N0, N1, ISD::SETUGE); in SimplifySetCC()
1965 isCondCodeLegal(ISD::SETULT, N0.getSimpleValueType())) in SimplifySetCC()
1966 return DAG.getSetCC(dl, VT, N0, N1, ISD::SETULT); in SimplifySetCC()
1968 isCondCodeLegal(ISD::SETULT, N0.getSimpleValueType())) in SimplifySetCC()
1969 return DAG.getSetCC(dl, VT, N0, N1, ISD::SETOLT); in SimplifySetCC()
1975 if (N0 == N1) { in SimplifySetCC()
1979 switch (getBooleanContents(N0.getValueType())) { in SimplifySetCC()
1990 if (N0.getValueType().isInteger()) { in SimplifySetCC()
2002 getCondCodeAction(NewCond, N0.getSimpleValueType()) == Legal)) in SimplifySetCC()
2003 return DAG.getSetCC(dl, VT, N0, N1, NewCond); in SimplifySetCC()
2007 N0.getValueType().isInteger()) { in SimplifySetCC()
2008 if (N0.getOpcode() == ISD::ADD || N0.getOpcode() == ISD::SUB || in SimplifySetCC()
2009 N0.getOpcode() == ISD::XOR) { in SimplifySetCC()
2011 if (N0.getOpcode() == N1.getOpcode()) { in SimplifySetCC()
2012 if (N0.getOperand(0) == N1.getOperand(0)) in SimplifySetCC()
2013 return DAG.getSetCC(dl, VT, N0.getOperand(1), N1.getOperand(1), Cond); in SimplifySetCC()
2014 if (N0.getOperand(1) == N1.getOperand(1)) in SimplifySetCC()
2015 return DAG.getSetCC(dl, VT, N0.getOperand(0), N1.getOperand(0), Cond); in SimplifySetCC()
2016 if (DAG.isCommutativeBinOp(N0.getOpcode())) { in SimplifySetCC()
2018 if (N0.getOperand(0) == N1.getOperand(1)) in SimplifySetCC()
2019 return DAG.getSetCC(dl, VT, N0.getOperand(1), N1.getOperand(0), in SimplifySetCC()
2021 if (N0.getOperand(1) == N1.getOperand(0)) in SimplifySetCC()
2022 return DAG.getSetCC(dl, VT, N0.getOperand(0), N1.getOperand(1), in SimplifySetCC()
2032 if (auto *LHSR = dyn_cast<ConstantSDNode>(N0.getOperand(1))) { in SimplifySetCC()
2034 if (N0.getOpcode() == ISD::ADD && N0.getNode()->hasOneUse()) { in SimplifySetCC()
2035 return DAG.getSetCC(dl, VT, N0.getOperand(0), in SimplifySetCC()
2038 dl, N0.getValueType()), Cond); in SimplifySetCC()
2042 if (N0.getOpcode() == ISD::XOR) in SimplifySetCC()
2045 if (DAG.MaskedValueIsZero(N0.getOperand(0), ~LHSR->getAPIntValue())) in SimplifySetCC()
2047 DAG.getSetCC(dl, VT, N0.getOperand(0), in SimplifySetCC()
2050 dl, N0.getValueType()), in SimplifySetCC()
2055 if (auto *SUBC = dyn_cast<ConstantSDNode>(N0.getOperand(0))) { in SimplifySetCC()
2056 if (N0.getOpcode() == ISD::SUB && N0.getNode()->hasOneUse()) { in SimplifySetCC()
2058 DAG.getSetCC(dl, VT, N0.getOperand(1), in SimplifySetCC()
2061 dl, N0.getValueType()), in SimplifySetCC()
2075 if (!LegalRHSImm || N0.getNode()->hasOneUse()) { in SimplifySetCC()
2076 if (N0.getOperand(0) == N1) in SimplifySetCC()
2077 return DAG.getSetCC(dl, VT, N0.getOperand(1), in SimplifySetCC()
2078 DAG.getConstant(0, dl, N0.getValueType()), Cond); in SimplifySetCC()
2079 if (N0.getOperand(1) == N1) { in SimplifySetCC()
2080 if (DAG.isCommutativeBinOp(N0.getOpcode())) in SimplifySetCC()
2081 return DAG.getSetCC(dl, VT, N0.getOperand(0), in SimplifySetCC()
2082 DAG.getConstant(0, dl, N0.getValueType()), in SimplifySetCC()
2084 if (N0.getNode()->hasOneUse()) { in SimplifySetCC()
2085 assert(N0.getOpcode() == ISD::SUB && "Unexpected operation!"); in SimplifySetCC()
2094 return DAG.getSetCC(dl, VT, N0.getOperand(0), SH, Cond); in SimplifySetCC()
2103 if (N1.getOperand(0) == N0) in SimplifySetCC()
2106 if (N1.getOperand(1) == N0) { in SimplifySetCC()
2115 ISD::SHL, dl, N1.getValueType(), N0, in SimplifySetCC()
2116 DAG.getConstant(1, dl, getShiftAmountTy(N0.getValueType(), DL))); in SimplifySetCC()
2124 if (SDValue V = simplifySetCCWithAnd(VT, N0, N1, Cond, DCI, dl)) in SimplifySetCC()
2130 if (N0.getValueType() == MVT::i1 && foldBooleans) { in SimplifySetCC()
2134 Temp = DAG.getNode(ISD::XOR, dl, MVT::i1, N0, N1); in SimplifySetCC()
2135 N0 = DAG.getNOT(dl, Temp, MVT::i1); in SimplifySetCC()
2140 N0 = DAG.getNode(ISD::XOR, dl, MVT::i1, N0, N1); in SimplifySetCC()
2144 Temp = DAG.getNOT(dl, N0, MVT::i1); in SimplifySetCC()
2145 N0 = DAG.getNode(ISD::AND, dl, MVT::i1, N1, Temp); in SimplifySetCC()
2152 N0 = DAG.getNode(ISD::AND, dl, MVT::i1, N0, Temp); in SimplifySetCC()
2158 Temp = DAG.getNOT(dl, N0, MVT::i1); in SimplifySetCC()
2159 N0 = DAG.getNode(ISD::OR, dl, MVT::i1, N1, Temp); in SimplifySetCC()
2166 N0 = DAG.getNode(ISD::OR, dl, MVT::i1, N0, Temp); in SimplifySetCC()
2171 DCI.AddToWorklist(N0.getNode()); in SimplifySetCC()
2173 N0 = DAG.getNode(ISD::ZERO_EXTEND, dl, VT, N0); in SimplifySetCC()
2175 return N0; in SimplifySetCC()