Lines Matching refs:TLO

502                                             TargetLoweringOpt &TLO) const {  in ShrinkDemandedConstant()
507 if (targetShrinkDemandedConstant(Op, DemandedBits, DemandedElts, TLO)) in ShrinkDemandedConstant()
508 return TLO.New.getNode(); in ShrinkDemandedConstant()
528 SDValue NewC = TLO.DAG.getConstant(DemandedBits & C, DL, VT); in ShrinkDemandedConstant()
529 SDValue NewOp = TLO.DAG.getNode(Opcode, DL, VT, Op.getOperand(0), NewC); in ShrinkDemandedConstant()
530 return TLO.CombineTo(Op, NewOp); in ShrinkDemandedConstant()
542 TargetLoweringOpt &TLO) const { in ShrinkDemandedConstant()
547 return ShrinkDemandedConstant(Op, DemandedBits, DemandedElts, TLO); in ShrinkDemandedConstant()
555 TargetLoweringOpt &TLO) const { in ShrinkDemandedOp()
561 SelectionDAG &DAG = TLO.DAG; in ShrinkDemandedOp()
591 return TLO.CombineTo(Op, Z); in ShrinkDemandedOp()
600 TargetLoweringOpt TLO(DAG, !DCI.isBeforeLegalize(), in SimplifyDemandedBits() local
604 bool Simplified = SimplifyDemandedBits(Op, DemandedBits, Known, TLO); in SimplifyDemandedBits()
607 DCI.CommitTargetLoweringOpt(TLO); in SimplifyDemandedBits()
616 TargetLoweringOpt TLO(DAG, !DCI.isBeforeLegalize(), in SimplifyDemandedBits() local
621 SimplifyDemandedBits(Op, DemandedBits, DemandedElts, Known, TLO); in SimplifyDemandedBits()
624 DCI.CommitTargetLoweringOpt(TLO); in SimplifyDemandedBits()
631 TargetLoweringOpt &TLO, in SimplifyDemandedBits() argument
648 return SimplifyDemandedBits(Op, DemandedBits, DemandedElts, Known, TLO, Depth, in SimplifyDemandedBits()
1062 const APInt &OriginalDemandedElts, KnownBits &Known, TargetLoweringOpt &TLO, in SimplifyDemandedBits() argument
1078 bool IsLE = TLO.DAG.getDataLayout().isLittleEndian(); in SimplifyDemandedBits()
1086 auto &DL = TLO.DAG.getDataLayout(); in SimplifyDemandedBits()
1110 Known = TLO.DAG.computeKnownBits(Op, DemandedElts, Depth); in SimplifyDemandedBits()
1119 return TLO.CombineTo(Op, TLO.DAG.getUNDEF(VT)); in SimplifyDemandedBits()
1131 return TLO.CombineTo(Op, TLO.DAG.getUNDEF(VT)); in SimplifyDemandedBits()
1137 if (SimplifyDemandedBits(Src, SrcDemandedBits, SrcKnown, TLO, Depth + 1)) in SimplifyDemandedBits()
1149 Known = TLO.DAG.computeKnownBits(Op, DemandedElts, Depth); in SimplifyDemandedBits()
1154 Known = TLO.DAG.computeKnownBits(Op, DemandedElts, Depth); in SimplifyDemandedBits()
1181 return TLO.CombineTo(Op, Vec); in SimplifyDemandedBits()
1187 if (SimplifyDemandedBits(Scl, DemandedSclBits, KnownScl, TLO, Depth + 1)) in SimplifyDemandedBits()
1193 if (SimplifyDemandedBits(Vec, DemandedBits, DemandedVecElts, KnownVec, TLO, in SimplifyDemandedBits()
1214 if (SimplifyDemandedBits(Sub, DemandedBits, DemandedSubElts, KnownSub, TLO, in SimplifyDemandedBits()
1217 if (SimplifyDemandedBits(Src, DemandedBits, DemandedSrcElts, KnownSrc, TLO, in SimplifyDemandedBits()
1232 Sub, DemandedBits, DemandedSubElts, TLO.DAG, Depth + 1); in SimplifyDemandedBits()
1234 Src, DemandedBits, DemandedSrcElts, TLO.DAG, Depth + 1); in SimplifyDemandedBits()
1238 SDValue NewOp = TLO.DAG.getNode(Op.getOpcode(), dl, VT, NewSrc, NewSub, in SimplifyDemandedBits()
1240 return TLO.CombineTo(Op, NewOp); in SimplifyDemandedBits()
1254 if (SimplifyDemandedBits(Src, DemandedBits, DemandedSrcElts, Known, TLO, in SimplifyDemandedBits()
1261 Src, DemandedBits, DemandedSrcElts, TLO.DAG, Depth + 1); in SimplifyDemandedBits()
1263 SDValue NewOp = TLO.DAG.getNode(Op.getOpcode(), dl, VT, DemandedSrc, in SimplifyDemandedBits()
1265 return TLO.CombineTo(Op, NewOp); in SimplifyDemandedBits()
1280 Known2, TLO, Depth + 1)) in SimplifyDemandedBits()
1319 if (SimplifyDemandedBits(Op0, DemandedBits, DemandedLHS, Known2, TLO, in SimplifyDemandedBits()
1325 if (SimplifyDemandedBits(Op1, DemandedBits, DemandedRHS, Known2, TLO, in SimplifyDemandedBits()
1333 Op0, DemandedBits, DemandedLHS, TLO.DAG, Depth + 1); in SimplifyDemandedBits()
1335 Op1, DemandedBits, DemandedRHS, TLO.DAG, Depth + 1); in SimplifyDemandedBits()
1339 SDValue NewOp = TLO.DAG.getVectorShuffle(VT, dl, Op0, Op1, ShuffleMask); in SimplifyDemandedBits()
1340 return TLO.CombineTo(Op, NewOp); in SimplifyDemandedBits()
1355 KnownBits LHSKnown = TLO.DAG.computeKnownBits(Op0, DemandedElts, Depth); in SimplifyDemandedBits()
1359 return TLO.CombineTo(Op, Op0); in SimplifyDemandedBits()
1364 DemandedElts, TLO)) in SimplifyDemandedBits()
1374 SDValue Xor = TLO.DAG.getNode(ISD::XOR, dl, VT, Op0.getOperand(0), Op1); in SimplifyDemandedBits()
1375 return TLO.CombineTo(Op, Xor); in SimplifyDemandedBits()
1391 TLO.DAG.computeKnownBits(Op1, DemandedSub & DemandedElts, Depth + 1); in SimplifyDemandedBits()
1394 TLO.DAG.getNode(ISD::AND, dl, VT, Op0.getOperand(0), Op1); in SimplifyDemandedBits()
1396 TLO.DAG.getNode(ISD::INSERT_SUBVECTOR, dl, VT, NewAnd, in SimplifyDemandedBits()
1398 return TLO.CombineTo(Op, NewInsert); in SimplifyDemandedBits()
1402 if (SimplifyDemandedBits(Op1, DemandedBits, DemandedElts, Known, TLO, in SimplifyDemandedBits()
1407 Known2, TLO, Depth + 1)) in SimplifyDemandedBits()
1414 return TLO.CombineTo(Op, Op0); in SimplifyDemandedBits()
1416 return TLO.CombineTo(Op, Op1); in SimplifyDemandedBits()
1419 return TLO.CombineTo(Op, TLO.DAG.getConstant(0, dl, VT)); in SimplifyDemandedBits()
1422 TLO)) in SimplifyDemandedBits()
1425 if (ShrinkDemandedOp(Op, BitWidth, DemandedBits, TLO)) in SimplifyDemandedBits()
1431 Op0, DemandedBits, DemandedElts, TLO.DAG, Depth + 1); in SimplifyDemandedBits()
1433 Op1, DemandedBits, DemandedElts, TLO.DAG, Depth + 1); in SimplifyDemandedBits()
1437 SDValue NewOp = TLO.DAG.getNode(Op.getOpcode(), dl, VT, Op0, Op1); in SimplifyDemandedBits()
1438 return TLO.CombineTo(Op, NewOp); in SimplifyDemandedBits()
1449 if (SimplifyDemandedBits(Op1, DemandedBits, DemandedElts, Known, TLO, in SimplifyDemandedBits()
1454 Known2, TLO, Depth + 1)) in SimplifyDemandedBits()
1461 return TLO.CombineTo(Op, Op0); in SimplifyDemandedBits()
1463 return TLO.CombineTo(Op, Op1); in SimplifyDemandedBits()
1465 if (ShrinkDemandedConstant(Op, DemandedBits, DemandedElts, TLO)) in SimplifyDemandedBits()
1468 if (ShrinkDemandedOp(Op, BitWidth, DemandedBits, TLO)) in SimplifyDemandedBits()
1474 Op0, DemandedBits, DemandedElts, TLO.DAG, Depth + 1); in SimplifyDemandedBits()
1476 Op1, DemandedBits, DemandedElts, TLO.DAG, Depth + 1); in SimplifyDemandedBits()
1480 SDValue NewOp = TLO.DAG.getNode(Op.getOpcode(), dl, VT, Op0, Op1); in SimplifyDemandedBits()
1481 return TLO.CombineTo(Op, NewOp); in SimplifyDemandedBits()
1499 if (SDValue C12 = TLO.DAG.FoldConstantArithmetic(ISD::OR, dl, VT, in SimplifyDemandedBits()
1501 SDValue MaskX = TLO.DAG.getNode(ISD::AND, dl, VT, X, C12); in SimplifyDemandedBits()
1502 SDValue MaskY = TLO.DAG.getNode(ISD::AND, dl, VT, Y, C2); in SimplifyDemandedBits()
1503 return TLO.CombineTo( in SimplifyDemandedBits()
1504 Op, TLO.DAG.getNode(ISD::OR, dl, VT, MaskX, MaskY)); in SimplifyDemandedBits()
1519 if (SimplifyDemandedBits(Op1, DemandedBits, DemandedElts, Known, TLO, in SimplifyDemandedBits()
1523 if (SimplifyDemandedBits(Op0, DemandedBits, DemandedElts, Known2, TLO, in SimplifyDemandedBits()
1531 return TLO.CombineTo(Op, Op0); in SimplifyDemandedBits()
1533 return TLO.CombineTo(Op, Op1); in SimplifyDemandedBits()
1535 if (ShrinkDemandedOp(Op, BitWidth, DemandedBits, TLO)) in SimplifyDemandedBits()
1542 return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::OR, dl, VT, Op0, Op1)); in SimplifyDemandedBits()
1553 TLO.DAG.getConstant(~C->getAPIntValue() & DemandedBits, dl, VT); in SimplifyDemandedBits()
1554 return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::AND, dl, VT, Op0, ANDC)); in SimplifyDemandedBits()
1562 SDValue New = TLO.DAG.getNOT(dl, Op0, VT); in SimplifyDemandedBits()
1563 return TLO.CombineTo(Op, New); in SimplifyDemandedBits()
1577 const TargetLowering &TLI = TLO.DAG.getTargetLoweringInfo(); in SimplifyDemandedBits()
1584 SDValue Not = TLO.DAG.getNOT(dl, Op0.getOperand(0), VT); in SimplifyDemandedBits()
1585 return TLO.CombineTo(Op, TLO.DAG.getNode(Op0Opcode, dl, VT, Not, in SimplifyDemandedBits()
1595 if (ShrinkDemandedConstant(Op, DemandedBits, DemandedElts, TLO)) in SimplifyDemandedBits()
1601 Op0, DemandedBits, DemandedElts, TLO.DAG, Depth + 1); in SimplifyDemandedBits()
1603 Op1, DemandedBits, DemandedElts, TLO.DAG, Depth + 1); in SimplifyDemandedBits()
1607 SDValue NewOp = TLO.DAG.getNode(Op.getOpcode(), dl, VT, Op0, Op1); in SimplifyDemandedBits()
1608 return TLO.CombineTo(Op, NewOp); in SimplifyDemandedBits()
1616 if (SimplifyDemandedBits(Op.getOperand(2), DemandedBits, Known, TLO, in SimplifyDemandedBits()
1619 if (SimplifyDemandedBits(Op.getOperand(1), DemandedBits, Known2, TLO, in SimplifyDemandedBits()
1626 if (ShrinkDemandedConstant(Op, DemandedBits, DemandedElts, TLO)) in SimplifyDemandedBits()
1634 Known, TLO, Depth + 1)) in SimplifyDemandedBits()
1637 Known2, TLO, Depth + 1)) in SimplifyDemandedBits()
1646 if (SimplifyDemandedBits(Op.getOperand(3), DemandedBits, Known, TLO, in SimplifyDemandedBits()
1649 if (SimplifyDemandedBits(Op.getOperand(2), DemandedBits, Known2, TLO, in SimplifyDemandedBits()
1656 if (ShrinkDemandedConstant(Op, DemandedBits, DemandedElts, TLO)) in SimplifyDemandedBits()
1679 return TLO.CombineTo(Op, Op0); in SimplifyDemandedBits()
1696 TLO.DAG.getValidShiftAmountConstant(Op, DemandedElts)) { in SimplifyDemandedBits()
1699 return TLO.CombineTo(Op, Op0); in SimplifyDemandedBits()
1708 TLO.DAG.getValidShiftAmountConstant(Op0, DemandedElts)) { in SimplifyDemandedBits()
1716 SDValue NewSA = TLO.DAG.getConstant(Diff, dl, ShiftVT); in SimplifyDemandedBits()
1717 return TLO.CombineTo( in SimplifyDemandedBits()
1718 Op, TLO.DAG.getNode(Opc, dl, VT, Op0.getOperand(0), NewSA)); in SimplifyDemandedBits()
1736 TLO.DAG.getNode(ISD::SHL, dl, InnerVT, InnerOp, in SimplifyDemandedBits()
1737 TLO.DAG.getConstant(ShAmt, dl, ShTy)); in SimplifyDemandedBits()
1738 return TLO.CombineTo( in SimplifyDemandedBits()
1739 Op, TLO.DAG.getNode(ISD::ANY_EXTEND, dl, VT, NarrowShl)); in SimplifyDemandedBits()
1751 TLO.DAG.getValidShiftAmountConstant(InnerOp, DemandedElts)) { in SimplifyDemandedBits()
1758 TLO.DAG.getConstant(ShAmt - InnerShAmt, dl, ShiftVT); in SimplifyDemandedBits()
1759 SDValue NewExt = TLO.DAG.getNode(ISD::ANY_EXTEND, dl, VT, in SimplifyDemandedBits()
1761 return TLO.CombineTo( in SimplifyDemandedBits()
1762 Op, TLO.DAG.getNode(ISD::SHL, dl, VT, NewExt, NewSA)); in SimplifyDemandedBits()
1769 if (SimplifyDemandedBits(Op0, InDemandedMask, DemandedElts, Known, TLO, in SimplifyDemandedBits()
1781 Op0, InDemandedMask, DemandedElts, TLO.DAG, Depth + 1); in SimplifyDemandedBits()
1783 SDValue NewOp = TLO.DAG.getNode(ISD::SHL, dl, VT, DemandedOp0, Op1); in SimplifyDemandedBits()
1784 return TLO.CombineTo(Op, NewOp); in SimplifyDemandedBits()
1791 ShrinkDemandedOp(Op, BitWidth, DemandedBits, TLO)) in SimplifyDemandedBits()
1799 if (SimplifyDemandedBits(Op0, DemandedFromOp, DemandedElts, Known, TLO, in SimplifyDemandedBits()
1818 TLO.DAG.getValidMaximumShiftAmountConstant(Op, DemandedElts)) { in SimplifyDemandedBits()
1821 TLO.DAG.ComputeNumSignBits(Op0, DemandedElts, Depth + 1); in SimplifyDemandedBits()
1824 return TLO.CombineTo(Op, Op0); in SimplifyDemandedBits()
1834 if (SDValue AVG = combineShiftToAVG(Op, TLO.DAG, *this, DemandedBits, in SimplifyDemandedBits()
1836 return TLO.CombineTo(Op, AVG); in SimplifyDemandedBits()
1839 TLO.DAG.getValidShiftAmountConstant(Op, DemandedElts)) { in SimplifyDemandedBits()
1842 return TLO.CombineTo(Op, Op0); in SimplifyDemandedBits()
1851 TLO.DAG.getValidShiftAmountConstant(Op0, DemandedElts)) { in SimplifyDemandedBits()
1859 SDValue NewSA = TLO.DAG.getConstant(Diff, dl, ShiftVT); in SimplifyDemandedBits()
1860 return TLO.CombineTo( in SimplifyDemandedBits()
1861 Op, TLO.DAG.getNode(Opc, dl, VT, Op0.getOperand(0), NewSA)); in SimplifyDemandedBits()
1874 if (SimplifyDemandedBits(Op0, InDemandedMask, DemandedElts, Known, TLO, in SimplifyDemandedBits()
1893 if (TLO.DAG.ComputeNumSignBits(Op0, DemandedElts, Depth + 1) >= in SimplifyDemandedBits()
1895 return TLO.CombineTo(Op, Op0); in SimplifyDemandedBits()
1902 return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::SRL, dl, VT, Op0, Op1)); in SimplifyDemandedBits()
1905 if (SDValue AVG = combineShiftToAVG(Op, TLO.DAG, *this, DemandedBits, in SimplifyDemandedBits()
1907 return TLO.CombineTo(Op, AVG); in SimplifyDemandedBits()
1910 TLO.DAG.getValidShiftAmountConstant(Op, DemandedElts)) { in SimplifyDemandedBits()
1913 return TLO.CombineTo(Op, Op0); in SimplifyDemandedBits()
1927 if (SimplifyDemandedBits(Op0, InDemandedMask, DemandedElts, Known, TLO, in SimplifyDemandedBits()
1940 return TLO.CombineTo( in SimplifyDemandedBits()
1941 Op, TLO.DAG.getNode(ISD::SRL, dl, VT, Op0, Op1, Flags)); in SimplifyDemandedBits()
1947 SDValue NewSA = TLO.DAG.getConstant(BitWidth - 1 - Log2, dl, ShiftVT); in SimplifyDemandedBits()
1948 return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::SRL, dl, VT, Op0, NewSA)); in SimplifyDemandedBits()
1958 Op0, InDemandedMask, DemandedElts, TLO.DAG, Depth + 1); in SimplifyDemandedBits()
1960 SDValue NewOp = TLO.DAG.getNode(ISD::SRA, dl, VT, DemandedOp0, Op1); in SimplifyDemandedBits()
1961 return TLO.CombineTo(Op, NewOp); in SimplifyDemandedBits()
1981 Known, TLO, Depth + 1)) in SimplifyDemandedBits()
1990 if (SimplifyDemandedBits(Op0, Demanded0, DemandedElts, Known2, TLO, in SimplifyDemandedBits()
1993 if (SimplifyDemandedBits(Op1, Demanded1, DemandedElts, Known, TLO, in SimplifyDemandedBits()
2008 Op0, Demanded0, DemandedElts, TLO.DAG, Depth + 1); in SimplifyDemandedBits()
2010 Op1, Demanded1, DemandedElts, TLO.DAG, Depth + 1); in SimplifyDemandedBits()
2014 SDValue NewOp = TLO.DAG.getNode(Op.getOpcode(), dl, VT, DemandedOp0, in SimplifyDemandedBits()
2016 return TLO.CombineTo(Op, NewOp); in SimplifyDemandedBits()
2025 Known2, TLO, Depth + 1)) in SimplifyDemandedBits()
2037 if (BitWidth == TLO.DAG.ComputeNumSignBits(Op0, DemandedElts, Depth + 1)) in SimplifyDemandedBits()
2038 return TLO.CombineTo(Op, Op0); in SimplifyDemandedBits()
2047 if (SimplifyDemandedBits(Op0, Demanded0, DemandedElts, Known2, TLO, in SimplifyDemandedBits()
2053 return TLO.CombineTo(Op, Op0); in SimplifyDemandedBits()
2056 if ((!TLO.LegalOperations() || isOperationLegal(ISD::SHL, VT)) && in SimplifyDemandedBits()
2058 Op1 = TLO.DAG.getConstant(IsROTL ? Amt : RevAmt, dl, Op1.getValueType()); in SimplifyDemandedBits()
2059 return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::SHL, dl, VT, Op0, Op1)); in SimplifyDemandedBits()
2061 if ((!TLO.LegalOperations() || isOperationLegal(ISD::SRL, VT)) && in SimplifyDemandedBits()
2063 Op1 = TLO.DAG.getConstant(IsROTL ? RevAmt : Amt, dl, Op1.getValueType()); in SimplifyDemandedBits()
2064 return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::SRL, dl, VT, Op0, Op1)); in SimplifyDemandedBits()
2071 if (SimplifyDemandedBits(Op1, DemandedAmtBits, DemandedElts, Known2, TLO, in SimplifyDemandedBits()
2081 KnownBits Known0 = TLO.DAG.computeKnownBits(Op0, DemandedElts, Depth + 1); in SimplifyDemandedBits()
2082 KnownBits Known1 = TLO.DAG.computeKnownBits(Op1, DemandedElts, Depth + 1); in SimplifyDemandedBits()
2085 return TLO.CombineTo(Op, IsULE.value() ? Op0 : Op1); in SimplifyDemandedBits()
2087 return TLO.CombineTo(Op, IsULT.value() ? Op0 : Op1); in SimplifyDemandedBits()
2094 KnownBits Known0 = TLO.DAG.computeKnownBits(Op0, DemandedElts, Depth + 1); in SimplifyDemandedBits()
2095 KnownBits Known1 = TLO.DAG.computeKnownBits(Op1, DemandedElts, Depth + 1); in SimplifyDemandedBits()
2098 return TLO.CombineTo(Op, IsUGE.value() ? Op0 : Op1); in SimplifyDemandedBits()
2100 return TLO.CombineTo(Op, IsUGT.value() ? Op0 : Op1); in SimplifyDemandedBits()
2106 if (SimplifyDemandedBits(Src, DemandedSrcBits, DemandedElts, Known2, TLO, in SimplifyDemandedBits()
2131 if (!TLO.LegalOperations() || isOperationLegal(ShiftOpcode, VT)) { in SimplifyDemandedBits()
2134 SDValue ShAmt = TLO.DAG.getConstant(ShiftAmount, dl, ShiftAmtTy); in SimplifyDemandedBits()
2135 SDValue NewOp = TLO.DAG.getNode(ShiftOpcode, dl, VT, Src, ShAmt); in SimplifyDemandedBits()
2136 return TLO.CombineTo(Op, NewOp); in SimplifyDemandedBits()
2141 if (SimplifyDemandedBits(Src, DemandedSrcBits, DemandedElts, Known2, TLO, in SimplifyDemandedBits()
2152 if (DemandedBits.isOne() && !TLO.LegalOps && !VT.isVector()) in SimplifyDemandedBits()
2153 return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::PARITY, dl, VT, in SimplifyDemandedBits()
2156 Known = TLO.DAG.computeKnownBits(Op, DemandedElts, Depth); in SimplifyDemandedBits()
2167 TLO.DAG.ComputeMaxSignificantBits(Op0, DemandedElts, Depth + 1); in SimplifyDemandedBits()
2174 SDValue ShiftAmt = TLO.DAG.getConstant(BitWidth - ExVTBits, dl, in SimplifyDemandedBits()
2176 return TLO.CombineTo(Op, in SimplifyDemandedBits()
2177 TLO.DAG.getNode(ISD::SHL, dl, VT, Op0, ShiftAmt)); in SimplifyDemandedBits()
2183 return TLO.CombineTo(Op, Op0); in SimplifyDemandedBits()
2191 if (SimplifyDemandedBits(Op0, InputDemandedBits, DemandedElts, Known, TLO, in SimplifyDemandedBits()
2201 return TLO.CombineTo(Op, TLO.DAG.getZeroExtendInReg(Op0, dl, ExVT)); in SimplifyDemandedBits()
2222 if (SimplifyDemandedBits(Op.getOperand(0), MaskLo, KnownLo, TLO, Depth + 1)) in SimplifyDemandedBits()
2225 if (SimplifyDemandedBits(Op.getOperand(1), MaskHi, KnownHi, TLO, Depth + 1)) in SimplifyDemandedBits()
2249 return TLO.CombineTo(Op, TLO.DAG.getBitcast(VT, Src)); in SimplifyDemandedBits()
2253 if (!TLO.LegalOperations() || isOperationLegal(Opc, VT)) in SimplifyDemandedBits()
2254 return TLO.CombineTo(Op, TLO.DAG.getNode(Opc, dl, VT, Src)); in SimplifyDemandedBits()
2259 if (SimplifyDemandedBits(Src, InDemandedBits, InDemandedElts, Known, TLO, in SimplifyDemandedBits()
2268 Src, InDemandedBits, InDemandedElts, TLO.DAG, Depth + 1)) in SimplifyDemandedBits()
2269 return TLO.CombineTo(Op, TLO.DAG.getNode(Op.getOpcode(), dl, VT, NewSrc)); in SimplifyDemandedBits()
2286 return TLO.CombineTo(Op, TLO.DAG.getBitcast(VT, Src)); in SimplifyDemandedBits()
2290 if (!TLO.LegalOperations() || isOperationLegal(Opc, VT)) in SimplifyDemandedBits()
2291 return TLO.CombineTo(Op, TLO.DAG.getNode(Opc, dl, VT, Src)); in SimplifyDemandedBits()
2301 if (SimplifyDemandedBits(Src, InDemandedBits, InDemandedElts, Known, TLO, in SimplifyDemandedBits()
2314 if (!TLO.LegalOperations() || isOperationLegal(Opc, VT)) in SimplifyDemandedBits()
2315 return TLO.CombineTo(Op, TLO.DAG.getNode(Opc, dl, VT, Src)); in SimplifyDemandedBits()
2320 Src, InDemandedBits, InDemandedElts, TLO.DAG, Depth + 1)) in SimplifyDemandedBits()
2321 return TLO.CombineTo(Op, TLO.DAG.getNode(Op.getOpcode(), dl, VT, NewSrc)); in SimplifyDemandedBits()
2336 return TLO.CombineTo(Op, TLO.DAG.getBitcast(VT, Src)); in SimplifyDemandedBits()
2340 if (SimplifyDemandedBits(Src, InDemandedBits, InDemandedElts, Known, TLO, in SimplifyDemandedBits()
2349 Src, InDemandedBits, InDemandedElts, TLO.DAG, Depth + 1)) in SimplifyDemandedBits()
2350 return TLO.CombineTo(Op, TLO.DAG.getNode(Op.getOpcode(), dl, VT, NewSrc)); in SimplifyDemandedBits()
2360 if (SimplifyDemandedBits(Src, TruncMask, DemandedElts, Known, TLO, in SimplifyDemandedBits()
2367 Src, TruncMask, DemandedElts, TLO.DAG, Depth + 1)) in SimplifyDemandedBits()
2368 return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::TRUNCATE, dl, VT, NewSrc)); in SimplifyDemandedBits()
2379 if (TLO.LegalTypes() && !isTypeDesirableForOp(ISD::SRL, VT)) in SimplifyDemandedBits()
2385 TLO.DAG.getValidShiftAmountConstant(Src, DemandedElts); in SimplifyDemandedBits()
2398 SDValue NewShAmt = TLO.DAG.getConstant( in SimplifyDemandedBits()
2399 ShVal, dl, getShiftAmountTy(VT, DL, TLO.LegalTypes())); in SimplifyDemandedBits()
2401 TLO.DAG.getNode(ISD::TRUNCATE, dl, VT, Src.getOperand(0)); in SimplifyDemandedBits()
2402 return TLO.CombineTo( in SimplifyDemandedBits()
2403 Op, TLO.DAG.getNode(ISD::SRL, dl, VT, NewTrunc, NewShAmt)); in SimplifyDemandedBits()
2418 TLO, Depth + 1)) in SimplifyDemandedBits()
2447 if (SimplifyDemandedBits(Src, DemandedSrcBits, DemandedSrcElts, Known2, TLO, in SimplifyDemandedBits()
2454 Src, DemandedSrcBits, DemandedSrcElts, TLO.DAG, Depth + 1)) { in SimplifyDemandedBits()
2456 TLO.DAG.getNode(Op.getOpcode(), dl, VT, DemandedSrc, Idx); in SimplifyDemandedBits()
2457 return TLO.CombineTo(Op, NewOp); in SimplifyDemandedBits()
2473 if (!TLO.LegalOperations() && !VT.isVector() && !SrcVT.isVector() && in SimplifyDemandedBits()
2484 SDValue Sign = TLO.DAG.getNode(ISD::FGETSIGN, dl, Ty, Src); in SimplifyDemandedBits()
2487 Sign = TLO.DAG.getNode(ISD::ZERO_EXTEND, dl, VT, Sign); in SimplifyDemandedBits()
2489 SDValue ShAmt = TLO.DAG.getConstant(ShVal, dl, VT); in SimplifyDemandedBits()
2490 return TLO.CombineTo(Op, in SimplifyDemandedBits()
2491 TLO.DAG.getNode(ISD::SHL, dl, VT, Sign, ShAmt)); in SimplifyDemandedBits()
2516 KnownSrcZero, TLO, Depth + 1)) in SimplifyDemandedBits()
2521 KnownSrcBits, TLO, Depth + 1)) in SimplifyDemandedBits()
2539 KnownSrcZero, TLO, Depth + 1)) in SimplifyDemandedBits()
2545 KnownSrcBits, TLO, Depth + 1)) in SimplifyDemandedBits()
2552 Known = TLO.DAG.computeKnownBits(Op, DemandedElts, Depth); in SimplifyDemandedBits()
2565 EVT ShiftAmtTy = getShiftAmountTy(VT, TLO.DAG.getDataLayout()); in SimplifyDemandedBits()
2566 SDValue AmtC = TLO.DAG.getConstant(CTZ, dl, ShiftAmtTy); in SimplifyDemandedBits()
2567 SDValue Shl = TLO.DAG.getNode(ISD::SHL, dl, VT, Op.getOperand(0), AmtC); in SimplifyDemandedBits()
2568 return TLO.CombineTo(Op, Shl); in SimplifyDemandedBits()
2575 SDValue One = TLO.DAG.getConstant(1, dl, VT); in SimplifyDemandedBits()
2576 SDValue And1 = TLO.DAG.getNode(ISD::AND, dl, VT, Op.getOperand(0), One); in SimplifyDemandedBits()
2577 return TLO.CombineTo(Op, And1); in SimplifyDemandedBits()
2588 if (SimplifyDemandedBits(Op0, LoMask, DemandedElts, Known2, TLO, in SimplifyDemandedBits()
2590 SimplifyDemandedBits(Op1, LoMask, DemandedElts, Known2, TLO, in SimplifyDemandedBits()
2593 ShrinkDemandedOp(Op, BitWidth, DemandedBits, TLO)) { in SimplifyDemandedBits()
2607 Op0, LoMask, DemandedElts, TLO.DAG, Depth + 1); in SimplifyDemandedBits()
2609 Op1, LoMask, DemandedElts, TLO.DAG, Depth + 1); in SimplifyDemandedBits()
2616 TLO.DAG.getNode(Op.getOpcode(), dl, VT, Op0, Op1, Flags); in SimplifyDemandedBits()
2617 return TLO.CombineTo(Op, NewOp); in SimplifyDemandedBits()
2630 SDValue Neg1 = TLO.DAG.getAllOnesConstant(dl, VT); in SimplifyDemandedBits()
2635 SDValue NewOp = TLO.DAG.getNode(Op.getOpcode(), dl, VT, Op0, Neg1, Flags); in SimplifyDemandedBits()
2636 return TLO.CombineTo(Op, NewOp); in SimplifyDemandedBits()
2659 EVT ShiftAmtTy = getShiftAmountTy(VT, TLO.DAG.getDataLayout()); in SimplifyDemandedBits()
2660 SDValue ShlAmtC = TLO.DAG.getConstant(ShlAmt, dl, ShiftAmtTy); in SimplifyDemandedBits()
2661 SDValue Shl = TLO.DAG.getNode(ISD::SHL, dl, VT, X, ShlAmtC); in SimplifyDemandedBits()
2662 SDValue Res = TLO.DAG.getNode(NT, dl, VT, Y, Shl); in SimplifyDemandedBits()
2663 return TLO.CombineTo(Op, Res); in SimplifyDemandedBits()
2687 Known, TLO, Depth)) in SimplifyDemandedBits()
2693 Known = TLO.DAG.computeKnownBits(Op, DemandedElts, Depth); in SimplifyDemandedBits()
2710 return TLO.CombineTo(Op, TLO.DAG.getConstant(Known.One, dl, VT)); in SimplifyDemandedBits()
2712 return TLO.CombineTo( in SimplifyDemandedBits()
2714 TLO.DAG.getConstantFP( in SimplifyDemandedBits()
2715 APFloat(TLO.DAG.EVTToAPFloatSemantics(VT), Known.One), dl, VT)); in SimplifyDemandedBits()
2725 TargetLoweringOpt TLO(DAG, !DCI.isBeforeLegalize(), in SimplifyDemandedVectorElts() local
2730 SimplifyDemandedVectorElts(Op, DemandedElts, KnownUndef, KnownZero, TLO); in SimplifyDemandedVectorElts()
2733 DCI.CommitTargetLoweringOpt(TLO); in SimplifyDemandedVectorElts()
2789 APInt &KnownZero, TargetLoweringOpt &TLO, unsigned Depth, in SimplifyDemandedVectorElts() argument
2799 const TargetLowering &TLI = TLO.DAG.getTargetLoweringInfo(); in SimplifyDemandedVectorElts()
2800 if (!TLI.shouldSimplifyDemandedVectorElts(Op, TLO)) in SimplifyDemandedVectorElts()
2823 return TLO.CombineTo(Op, TLO.DAG.getUNDEF(VT)); in SimplifyDemandedVectorElts()
2832 bool IsLE = TLO.DAG.getDataLayout().isLittleEndian(); in SimplifyDemandedVectorElts()
2838 TLO.DAG, Depth + 1); in SimplifyDemandedVectorElts()
2840 TLO.DAG, Depth + 1); in SimplifyDemandedVectorElts()
2842 SDValue NewOp = TLO.DAG.getNode( in SimplifyDemandedVectorElts()
2844 return TLO.CombineTo(Op, NewOp); in SimplifyDemandedVectorElts()
2853 return TLO.CombineTo(Op, TLO.DAG.getUNDEF(VT)); in SimplifyDemandedVectorElts()
2872 TLO, Depth + 1)) in SimplifyDemandedVectorElts()
2892 KnownZero, TLO, Depth + 1); in SimplifyDemandedVectorElts()
2902 TLO, Depth + 1)) in SimplifyDemandedVectorElts()
2919 TLO, Depth + 1)) in SimplifyDemandedVectorElts()
2957 TLO, Depth + 1)) in SimplifyDemandedVectorElts()
2983 Ops[i] = TLO.DAG.getUNDEF(Ops[0].getValueType()); in SimplifyDemandedVectorElts()
2989 return TLO.CombineTo(Op, TLO.DAG.getBuildVector(VT, DL, Ops)); in SimplifyDemandedVectorElts()
3011 if (SimplifyDemandedVectorElts(SubOp, SubElts, SubUndef, SubZero, TLO, in SimplifyDemandedVectorElts()
3026 SubOp, SubElts, TLO.DAG, Depth + 1); in SimplifyDemandedVectorElts()
3032 TLO.DAG.getNode(Op.getOpcode(), SDLoc(Op), VT, DemandedSubOps); in SimplifyDemandedVectorElts()
3033 return TLO.CombineTo(Op, NewOp); in SimplifyDemandedVectorElts()
3050 if (SimplifyDemandedVectorElts(Sub, DemandedSubElts, SubUndef, SubZero, TLO, in SimplifyDemandedVectorElts()
3056 return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::INSERT_SUBVECTOR, DL, VT, in SimplifyDemandedVectorElts()
3057 TLO.DAG.getUNDEF(VT), Sub, in SimplifyDemandedVectorElts()
3061 TLO, Depth + 1)) in SimplifyDemandedVectorElts()
3069 Src, DemandedSrcElts, TLO.DAG, Depth + 1); in SimplifyDemandedVectorElts()
3071 Sub, DemandedSubElts, TLO.DAG, Depth + 1); in SimplifyDemandedVectorElts()
3075 SDValue NewOp = TLO.DAG.getNode(Op.getOpcode(), SDLoc(Op), VT, NewSrc, in SimplifyDemandedVectorElts()
3077 return TLO.CombineTo(Op, NewOp); in SimplifyDemandedVectorElts()
3092 if (SimplifyDemandedVectorElts(Src, DemandedSrcElts, SrcUndef, SrcZero, TLO, in SimplifyDemandedVectorElts()
3101 Src, DemandedSrcElts, TLO.DAG, Depth + 1); in SimplifyDemandedVectorElts()
3103 SDValue NewOp = TLO.DAG.getNode(Op.getOpcode(), SDLoc(Op), VT, NewSrc, in SimplifyDemandedVectorElts()
3105 return TLO.CombineTo(Op, NewOp); in SimplifyDemandedVectorElts()
3120 return TLO.CombineTo(Op, Vec); in SimplifyDemandedVectorElts()
3125 KnownZero, TLO, Depth + 1)) in SimplifyDemandedVectorElts()
3135 if (SimplifyDemandedVectorElts(Vec, DemandedElts, VecUndef, VecZero, TLO, in SimplifyDemandedVectorElts()
3149 if (SimplifyDemandedVectorElts(Sel, DemandedElts, UndefSel, UndefZero, TLO, in SimplifyDemandedVectorElts()
3158 if (SimplifyDemandedVectorElts(LHS, DemandedLHS, UndefLHS, ZeroLHS, TLO, in SimplifyDemandedVectorElts()
3161 if (SimplifyDemandedVectorElts(RHS, DemandedRHS, UndefRHS, ZeroRHS, TLO, in SimplifyDemandedVectorElts()
3172 if (SimplifyDemandedVectorElts(Sel, DemandedSel, UndefSel, UndefZero, TLO, in SimplifyDemandedVectorElts()
3199 ZeroLHS, TLO, Depth + 1)) in SimplifyDemandedVectorElts()
3202 ZeroRHS, TLO, Depth + 1)) in SimplifyDemandedVectorElts()
3224 if (Updated && !IdentityLHS && !IdentityRHS && !TLO.LegalOps) { in SimplifyDemandedVectorElts()
3227 NewMask, TLO.DAG); in SimplifyDemandedVectorElts()
3229 return TLO.CombineTo(Op, LegalShuffle); in SimplifyDemandedVectorElts()
3258 if (SimplifyDemandedVectorElts(Src, DemandedSrcElts, SrcUndef, SrcZero, TLO, in SimplifyDemandedVectorElts()
3268 return TLO.CombineTo(Op, TLO.DAG.getBitcast(VT, Src)); in SimplifyDemandedVectorElts()
3274 return TLO.CombineTo(Op, TLO.DAG.getConstant(0, SDLoc(Op), VT)); in SimplifyDemandedVectorElts()
3286 MaskElts.push_back(TLO.DAG.getAllOnesConstant(DL, SrcSVT)); in SimplifyDemandedVectorElts()
3287 MaskElts.append(NumSrcElts - 1, TLO.DAG.getConstant(0, DL, SrcSVT)); in SimplifyDemandedVectorElts()
3288 SDValue Mask = TLO.DAG.getBuildVector(SrcVT, DL, MaskElts); in SimplifyDemandedVectorElts()
3289 if (SDValue Fold = TLO.DAG.FoldConstantArithmetic( in SimplifyDemandedVectorElts()
3291 Fold = TLO.DAG.getNode(ISD::AND, DL, SrcVT, Src.getOperand(0), Fold); in SimplifyDemandedVectorElts()
3292 return TLO.CombineTo(Op, TLO.DAG.getBitcast(VT, Fold)); in SimplifyDemandedVectorElts()
3306 if (SimplifyDemandedVectorElts(Op0, DemandedElts, UndefLHS, ZeroLHS, TLO, in SimplifyDemandedVectorElts()
3324 if (SimplifyDemandedVectorElts(Op1, DemandedElts, UndefRHS, ZeroRHS, TLO, in SimplifyDemandedVectorElts()
3328 if (SimplifyDemandedVectorElts(Op0, DemandedElts, UndefLHS, ZeroLHS, TLO, in SimplifyDemandedVectorElts()
3333 KnownUndef = getKnownUndefForVectorBinop(Op, TLO.DAG, UndefLHS, UndefRHS); in SimplifyDemandedVectorElts()
3351 if (SimplifyDemandedVectorElts(Op1, DemandedElts, UndefRHS, ZeroRHS, TLO, in SimplifyDemandedVectorElts()
3355 if (SimplifyDemandedVectorElts(Op0, DemandedElts, UndefLHS, ZeroLHS, TLO, in SimplifyDemandedVectorElts()
3375 if (SimplifyDemandedVectorElts(Op1, DemandedElts, SrcUndef, SrcZero, TLO, in SimplifyDemandedVectorElts()
3379 TLO, Depth + 1)) in SimplifyDemandedVectorElts()
3386 return TLO.CombineTo(Op, TLO.DAG.getConstant(0, SDLoc(Op), VT)); in SimplifyDemandedVectorElts()
3406 KnownZero, TLO, Depth + 1)) in SimplifyDemandedVectorElts()
3412 return TLO.CombineTo(Op, TLO.DAG.getConstant(0, SDLoc(Op), VT)); in SimplifyDemandedVectorElts()
3419 KnownZero, TLO, Depth)) in SimplifyDemandedVectorElts()
3425 TLO, Depth, AssumeSingleUse)) in SimplifyDemandedVectorElts()
3436 return TLO.CombineTo(Op, TLO.DAG.getUNDEF(VT)); in SimplifyDemandedVectorElts()
3499 TargetLoweringOpt &TLO, unsigned Depth) const { in SimplifyDemandedVectorEltsForTargetNode() argument
3511 KnownBits &Known, TargetLoweringOpt &TLO, unsigned Depth) const { in SimplifyDemandedBitsForTargetNode() argument
3518 computeKnownBitsForTargetNode(Op, Known, DemandedElts, TLO.DAG, Depth); in SimplifyDemandedBitsForTargetNode()