Lines Matching defs:DemandedBits

515                                             const APInt &DemandedBits,
523 if (DemandedBits.isZero() || DemandedElts.isZero())
527 if (targetShrinkDemandedConstant(Op, DemandedBits, DemandedElts, TLO))
543 if (Opcode == ISD::XOR && DemandedBits.isSubsetOf(C))
546 if (!C.isSubsetOf(DemandedBits)) {
548 SDValue NewC = TLO.DAG.getConstant(DemandedBits & C, DL, VT);
562 const APInt &DemandedBits,
568 return ShrinkDemandedConstant(Op, DemandedBits, DemandedElts, TLO);
576 const APInt &DemandedBits,
602 unsigned DemandedSize = DemandedBits.getActiveBits();
625 bool TargetLowering::SimplifyDemandedBits(SDValue Op, const APInt &DemandedBits,
632 bool Simplified = SimplifyDemandedBits(Op, DemandedBits, Known, TLO);
640 bool TargetLowering::SimplifyDemandedBits(SDValue Op, const APInt &DemandedBits,
649 SimplifyDemandedBits(Op, DemandedBits, DemandedElts, Known, TLO);
657 bool TargetLowering::SimplifyDemandedBits(SDValue Op, const APInt &DemandedBits,
670 return SimplifyDemandedBits(Op, DemandedBits, DemandedElts, Known, TLO, Depth,
676 SDValue Op, const APInt &DemandedBits, const APInt &DemandedElts,
689 if (DemandedBits == 0 || DemandedElts == 0)
694 unsigned BitWidth = DemandedBits.getBitWidth();
711 Src, DemandedBits, DemandedElts, DAG, Depth + 1))
722 APInt Sub = DemandedBits.extractBits(NumSrcEltBits, BitOffset);
745 DemandedSrcBits.insertBits(DemandedBits, Offset);
770 if (DemandedBits.isSubsetOf(LHSKnown.Zero | RHSKnown.One))
772 if (DemandedBits.isSubsetOf(RHSKnown.Zero | LHSKnown.One))
783 if (DemandedBits.isSubsetOf(LHSKnown.One | RHSKnown.Zero))
785 if (DemandedBits.isSubsetOf(RHSKnown.One | LHSKnown.Zero))
795 if (DemandedBits.isSubsetOf(RHSKnown.Zero))
797 if (DemandedBits.isSubsetOf(LHSKnown.Zero))
820 unsigned UpperDemandedBits = BitWidth - DemandedBits.countr_zero();
833 // Must already be signbits in DemandedBits bounds, and can't demand any
835 if (DemandedBits.countl_zero() >= ShAmt) {
838 if (DemandedBits.countr_zero() >= (BitWidth - NumSignBits))
851 if (DemandedBits.isSignMask() &&
870 if (DemandedBits.getActiveBits() <= ExBits &&
892 DemandedBits.getActiveBits() <= SrcVT.getScalarSizeInBits()) {
956 Op, DemandedBits, DemandedElts, DAG, Depth))
964 SDValue Op, const APInt &DemandedBits, SelectionDAG &DAG,
973 return SimplifyMultipleUseDemandedBits(Op, DemandedBits, DemandedElts, DAG,
980 APInt DemandedBits = APInt::getAllOnes(Op.getScalarValueSizeInBits());
981 return SimplifyMultipleUseDemandedBits(Op, DemandedBits, DemandedElts, DAG,
990 const APInt &DemandedBits,
1077 if (NumSigned >= 1 && DemandedBits.isSignBitClear()) {
1151 APInt DemandedBits = OriginalDemandedBits;
1183 // Allow multiple uses, just set the DemandedBits/Elts to all bits.
1184 DemandedBits = APInt::getAllOnes(BitWidth);
1206 APInt SrcDemandedBits = DemandedBits.zext(SrcBitWidth);
1223 APInt DemandedSclBits = DemandedBits.zextOrTrunc(Scl.getValueSizeInBits());
1270 APInt DemandedSclBits = DemandedBits.zextOrTrunc(NumSclBits);
1277 if (SimplifyDemandedBits(Vec, DemandedBits, DemandedVecElts, KnownVec, TLO,
1300 if (SimplifyDemandedBits(Sub, DemandedBits, DemandedSubElts, KnownSub, TLO,
1303 if (SimplifyDemandedBits(Src, DemandedBits, DemandedSrcElts, KnownSrc, TLO,
1315 if (!DemandedBits.isAllOnes() || !DemandedSubElts.isAllOnes() ||
1318 Sub, DemandedBits, DemandedSubElts, TLO.DAG, Depth + 1);
1320 Src, DemandedBits, DemandedSrcElts, TLO.DAG, Depth + 1);
1342 if (SimplifyDemandedBits(Src, DemandedBits, DemandedSrcElts, Known, TLO,
1347 if (!DemandedBits.isAllOnes() || !DemandedSrcElts.isAllOnes()) {
1349 Src, DemandedBits, DemandedSrcElts, TLO.DAG, Depth + 1);
1369 if (SimplifyDemandedBits(Op.getOperand(i), DemandedBits, DemandedSubElts,
1395 if (SimplifyDemandedBits(Op0, DemandedBits, DemandedLHS, Known2, TLO,
1401 if (SimplifyDemandedBits(Op1, DemandedBits, DemandedRHS, Known2, TLO,
1409 Op0, DemandedBits, DemandedLHS, TLO.DAG, Depth + 1);
1411 Op1, DemandedBits, DemandedRHS, TLO.DAG, Depth + 1);
1433 if ((LHSKnown.Zero & DemandedBits) ==
1434 (~RHSC->getAPIntValue() & DemandedBits))
1439 if (ShrinkDemandedConstant(Op, ~LHSKnown.Zero & DemandedBits,
1456 // iff 'C' is Undef/Constant and AND(X,M) == X (for DemandedBits).
1468 if (DemandedBits.isSubsetOf(KnownSubMask.One)) {
1478 if (SimplifyDemandedBits(Op1, DemandedBits, DemandedElts, Known, TLO,
1481 if (SimplifyDemandedBits(Op0, ~Known.Zero & DemandedBits, DemandedElts,
1487 if (DemandedBits.isSubsetOf(Known2.Zero | Known.One))
1489 if (DemandedBits.isSubsetOf(Known.Zero | Known2.One))
1492 if (DemandedBits.isSubsetOf(Known.Zero | Known2.Zero))
1495 if (ShrinkDemandedConstant(Op, ~Known2.Zero & DemandedBits, DemandedElts,
1499 if (ShrinkDemandedOp(Op, BitWidth, DemandedBits, TLO))
1503 if (!DemandedBits.isAllOnes() || !DemandedElts.isAllOnes()) {
1505 Op0, DemandedBits, DemandedElts, TLO.DAG, Depth + 1);
1507 Op1, DemandedBits, DemandedElts, TLO.DAG, Depth + 1);
1522 if (SimplifyDemandedBits(Op1, DemandedBits, DemandedElts, Known, TLO,
1528 if (SimplifyDemandedBits(Op0, ~Known.One & DemandedBits, DemandedElts,
1536 if (DemandedBits.isSubsetOf(Known2.One | Known.Zero))
1538 if (DemandedBits.isSubsetOf(Known.One | Known2.Zero))
1541 if (ShrinkDemandedConstant(Op, DemandedBits, DemandedElts, TLO))
1544 if (ShrinkDemandedOp(Op, BitWidth, DemandedBits, TLO))
1548 if (!DemandedBits.isAllOnes() || !DemandedElts.isAllOnes()) {
1550 Op0, DemandedBits, DemandedElts, TLO.DAG, Depth + 1);
1552 Op1, DemandedBits, DemandedElts, TLO.DAG, Depth + 1);
1595 if (SimplifyDemandedBits(Op1, DemandedBits, DemandedElts, Known, TLO,
1598 if (SimplifyDemandedBits(Op0, DemandedBits, DemandedElts, Known2, TLO,
1604 if (DemandedBits.isSubsetOf(Known.Zero))
1606 if (DemandedBits.isSubsetOf(Known2.Zero))
1609 if (ShrinkDemandedOp(Op, BitWidth, DemandedBits, TLO))
1615 if (DemandedBits.isSubsetOf(Known.Zero | Known2.Zero))
1627 TLO.DAG.getConstant(~C->getAPIntValue() & DemandedBits, dl, VT);
1634 if (!C->isAllOnes() && DemandedBits.isSubsetOf(C->getAPIntValue())) {
1651 if ((DemandedBits & C->getAPIntValue()) == (DemandedBits & Ones) &&
1668 if (ShrinkDemandedConstant(Op, DemandedBits, DemandedElts, TLO))
1672 if (!DemandedBits.isAllOnes() || !DemandedElts.isAllOnes()) {
1674 Op0, DemandedBits, DemandedElts, TLO.DAG, Depth + 1);
1676 Op1, DemandedBits, DemandedElts, TLO.DAG, Depth + 1);
1689 if (SimplifyDemandedBits(Op.getOperand(2), DemandedBits, DemandedElts,
1692 if (SimplifyDemandedBits(Op.getOperand(1), DemandedBits, DemandedElts,
1697 if (ShrinkDemandedConstant(Op, DemandedBits, DemandedElts, TLO))
1704 if (SimplifyDemandedBits(Op.getOperand(2), DemandedBits, DemandedElts,
1707 if (SimplifyDemandedBits(Op.getOperand(1), DemandedBits, DemandedElts,
1715 if (SimplifyDemandedBits(Op.getOperand(3), DemandedBits, DemandedElts,
1718 if (SimplifyDemandedBits(Op.getOperand(2), DemandedBits, DemandedElts,
1723 if (ShrinkDemandedConstant(Op, DemandedBits, DemandedElts, TLO))
1736 if (DemandedBits.isSignMask() &&
1773 if (!DemandedBits.intersects(APInt::getLowBitsSet(BitWidth, ShAmt))) {
1797 if (ShAmt < InnerBits && DemandedBits.getActiveBits() <= InnerBits &&
1818 DemandedBits.getActiveBits() <=
1820 DemandedBits.countr_zero() >= ShAmt) {
1832 APInt InDemandedMask = DemandedBits.lshr(ShAmt);
1858 if (ShAmt < DemandedBits.getActiveBits() && !VT.isVector() &&
1862 unsigned DemandedSize = DemandedBits.getActiveBits();
1888 DemandedBits.countLeadingOnes() >= HalfWidth) {
1917 if (unsigned CTLZ = DemandedBits.countl_zero()) {
1937 unsigned UpperDemandedBits = BitWidth - DemandedBits.countr_zero();
1959 if (!DemandedBits.intersects(APInt::getHighBitsSet(BitWidth, ShAmt))) {
1979 if (!DemandedBits.intersects(APInt::getHighBitsSet(BitWidth, ShAmt))) {
1992 APInt InDemandedMask = (DemandedBits << ShAmt);
2049 // Must already be signbits in DemandedBits bounds, and can't demand any
2051 if (DemandedBits.countl_zero() >= ShAmt) {
2054 if (DemandedBits.countr_zero() >= (BitWidth - NumSignBits))
2060 if (SDValue AVG = combineShiftToAVG(Op, TLO, *this, DemandedBits,
2073 unsigned NumHiDemandedBits = BitWidth - DemandedBits.countr_zero();
2082 if (DemandedBits.isOne())
2120 APInt InDemandedMask = (DemandedBits << ShAmt);
2129 if (DemandedBits.countl_zero() < ShAmt)
2141 DemandedBits.countl_zero() >= ShAmt) {
2148 int Log2 = DemandedBits.exactLogBase2();
2171 if (SDValue AVG = combineShiftToAVG(Op, TLO, *this, DemandedBits,
2190 if (SimplifyDemandedBits(IsFSHL ? Op0 : Op1, DemandedBits, DemandedElts,
2198 APInt Demanded0 = DemandedBits.lshr(IsFSHL ? Amt : (BitWidth - Amt));
2199 APInt Demanded1 = DemandedBits << (IsFSHL ? (BitWidth - Amt) : Amt);
2255 APInt Demanded0 = DemandedBits.rotr(IsROTL ? Amt : RevAmt);
2266 DemandedBits.countr_zero() >= (IsROTL ? Amt : RevAmt)) {
2271 DemandedBits.countl_zero() >= (IsROTL ? RevAmt : Amt)) {
2300 unsigned NumDemandedUpperBits = BitWidth - DemandedBits.countr_zero();
2341 APInt DemandedSrcBits = DemandedBits.reverseBits();
2354 unsigned NLZ = DemandedBits.countl_zero();
2355 unsigned NTZ = DemandedBits.countr_zero();
2375 APInt DemandedSrcBits = DemandedBits.byteSwap();
2387 if (DemandedBits.isOne() && !TLO.LegalOps && !VT.isVector())
2400 if (DemandedBits.isSignMask()) {
2417 if (DemandedBits.getActiveBits() <= ExVTBits)
2420 APInt InputDemandedBits = DemandedBits.getLoBits(ExVTBits);
2451 APInt MaskLo = DemandedBits.getLoBits(HalfBitWidth).trunc(HalfBitWidth);
2452 APInt MaskHi = DemandedBits.getHiBits(HalfBitWidth).trunc(HalfBitWidth);
2477 if (DemandedBits.getActiveBits() <= InBits) {
2490 APInt InDemandedBits = DemandedBits.trunc(InBits);
2518 APInt InDemandedBits = DemandedBits.trunc(InBits);
2525 if (DemandedBits.getActiveBits() <= InBits) {
2586 APInt InDemandedBits = DemandedBits.trunc(InBits);
2606 APInt TruncMask = DemandedBits.zext(OperandBitWidth);
2656 if (!(HighBits & DemandedBits)) {
2676 if (SimplifyDemandedBits(Op.getOperand(0), ~InMask | DemandedBits, Known,
2702 APInt DemandedSrcBits = DemandedBits;
2735 DemandedBits == APInt::getSignMask(Op.getValueSizeInBits()) &&
2766 APInt Sub = DemandedBits.extractBits(NumSrcEltBits, BitOffset);
2793 DemandedSrcBits.insertBits(DemandedBits, Offset);
2828 if (DemandedBits.isPowerOf2()) {
2832 unsigned CTZ = DemandedBits.countr_zero();
2843 if (Op.getOperand(0) == Op.getOperand(1) && DemandedBits.ult(4)) {
2855 unsigned DemandedBitsLZ = DemandedBits.countl_zero();
2869 ShrinkDemandedOp(Op, BitWidth, DemandedBits, TLO)) {
2877 if (Op.getOpcode() == ISD::SUB && DemandedBits.isOne() &&
2973 if (SimplifyDemandedBitsForTargetNode(Op, DemandedBits, DemandedElts,
2987 DemandedBits.isSubsetOf(Known.Zero | Known.One)) {
3754 APInt DemandedBits = APInt::getAllOnes(EltSizeInBits);
3755 if (SimplifyDemandedBits(Op, DemandedBits, OriginalDemandedElts, Known,
3841 SDValue Op, const APInt &DemandedBits, const APInt &DemandedElts,
3854 SDValue Op, const APInt &DemandedBits, const APInt &DemandedElts,