Lines Matching full:lower
10 // for an integral value. This keeps track of a lower and upper bound for the
12 // keeps track of a [lower, upper) bound, which specifies an interval just like
45 : Lower(Full ? APInt::getMaxValue(BitWidth) : APInt::getMinValue(BitWidth)), in ConstantRange()
46 Upper(Lower) {} in ConstantRange()
49 : Lower(std::move(V)), Upper(Lower + 1) {} in ConstantRange()
52 : Lower(std::move(L)), Upper(std::move(U)) { in ConstantRange()
53 assert(Lower.getBitWidth() == Upper.getBitWidth() && in ConstantRange()
55 assert((Lower != Upper || (Lower.isMaxValue() || Lower.isMinValue())) && in ConstantRange()
56 "Lower == Upper, but they aren't min or max value!"); in ConstantRange()
71 // If we don't know the sign bit, pick the lower bound as a negative number in fromKnownBits()
73 APInt Lower = Known.getMinValue(), Upper = Known.getMaxValue(); in fromKnownBits() local
74 Lower.setSignBit(); in fromKnownBits()
76 return ConstantRange(Lower, Upper + 1); in fromKnownBits()
302 APInt Lower, Upper; in makeExactMulNSWRegion() local
304 Lower = APIntOps::RoundingSDiv(MaxValue, V, APInt::Rounding::UP); in makeExactMulNSWRegion()
307 Lower = APIntOps::RoundingSDiv(MinValue, V, APInt::Rounding::UP); in makeExactMulNSWRegion()
310 return ConstantRange::getNonEmpty(Lower, Upper + 1); in makeExactMulNSWRegion()
414 return Lower == Upper && Lower.isMaxValue(); in isFullSet()
418 return Lower == Upper && Lower.isMinValue(); in isEmptySet()
422 return Lower.ugt(Upper) && !Upper.isZero(); in isWrappedSet()
426 return Lower.ugt(Upper); in isUpperWrapped()
430 return Lower.sgt(Upper) && !Upper.isMinSignedValue(); in isSignWrappedSet()
434 return Lower.sgt(Upper); in isUpperSignWrapped()
444 return (Upper - Lower).ult(Other.Upper - Other.Lower); in isSizeStrictlySmallerThan()
454 return (Upper - Lower).ugt(MaxSize); in isSizeLargerThan()
469 return !isSignWrappedSet() && Lower.isNonNegative(); in isAllNonNegative()
479 return !isSignWrappedSet() && Lower.isStrictlyPositive(); in isAllPositive()
507 if (Lower == Upper) in contains()
511 return Lower.ule(V) && V.ult(Upper); in contains()
512 return Lower.ule(V) || V.ult(Upper); in contains()
523 return Lower.ule(Other.getLower()) && Other.getUpper().ule(Upper); in contains()
528 Lower.ule(Other.getLower()); in contains()
530 return Other.getUpper().ule(Upper) && Lower.ule(Other.getLower()); in contains()
551 if (Lower == Upper) in subtract()
553 return ConstantRange(Lower - Val, Upper - Val); in subtract()
593 if (Lower.ult(CR.Lower)) { in intersectWith()
596 if (Upper.ule(CR.Lower)) in intersectWith()
602 return ConstantRange(CR.Lower, Upper); in intersectWith()
615 if (Lower.ult(CR.Upper)) in intersectWith()
616 return ConstantRange(Lower, CR.Upper); in intersectWith()
624 if (CR.Lower.ult(Upper)) { in intersectWith()
632 if (CR.Upper.ule(Lower)) in intersectWith()
633 return ConstantRange(CR.Lower, Upper); in intersectWith()
639 if (CR.Lower.ult(Lower)) { in intersectWith()
642 if (CR.Upper.ule(Lower)) in intersectWith()
647 return ConstantRange(Lower, CR.Upper); in intersectWith()
658 if (CR.Lower.ult(Upper)) in intersectWith()
663 if (CR.Lower.ult(Lower)) in intersectWith()
664 return ConstantRange(Lower, CR.Upper); in intersectWith()
670 if (CR.Upper.ule(Lower)) { in intersectWith()
673 if (CR.Lower.ult(Lower)) in intersectWith()
678 return ConstantRange(CR.Lower, Upper); in intersectWith()
703 if (CR.Upper.ult(Lower) || Upper.ult(CR.Lower)) in unionWith()
705 ConstantRange(Lower, CR.Upper), ConstantRange(CR.Lower, Upper), Type); in unionWith()
707 APInt L = CR.Lower.ult(Lower) ? CR.Lower : Lower; in unionWith()
719 if (CR.Upper.ule(Upper) || CR.Lower.uge(Lower)) in unionWith()
724 if (CR.Lower.ule(Upper) && Lower.ule(CR.Upper)) in unionWith()
732 if (Upper.ult(CR.Lower) && CR.Upper.ult(Lower)) in unionWith()
734 ConstantRange(Lower, CR.Upper), ConstantRange(CR.Lower, Upper), Type); in unionWith()
738 if (Upper.ult(CR.Lower) && Lower.ule(CR.Upper)) in unionWith()
739 return ConstantRange(CR.Lower, Upper); in unionWith()
743 assert(CR.Lower.ule(Upper) && CR.Upper.ult(Lower) && in unionWith()
745 return ConstantRange(Lower, CR.Upper); in unionWith()
750 if (CR.Lower.ule(Upper) || Lower.ule(CR.Upper)) in unionWith()
753 APInt L = CR.Lower.ult(Lower) ? CR.Lower : Lower; in unionWith()
837 LowerExt = Lower.zext(DstTySize); in zeroExtend()
842 return ConstantRange(Lower.zext(DstTySize), Upper.zext(DstTySize)); in zeroExtend()
853 return ConstantRange(Lower.sext(DstTySize), Upper.zext(DstTySize)); in signExtend()
860 return ConstantRange(Lower.sext(DstTySize), Upper.sext(DstTySize)); in signExtend()
870 APInt LowerDiv(Lower), UpperDiv(Upper); in truncate()
873 // Analyze wrapped sets in their two parts: [0, Upper) \/ [Lower, MaxValue] in truncate()
874 // We use the non-wrapped set code to analyze the [Lower, MaxValue) part, and in truncate()
1209 // here, the lower bound is the smallest of the cartesian product of the in multiply()
1210 // lower and upper ranges; for example: in multiply()
1328 APInt Lower = getUnsignedMin().udiv(RHS.getUnsignedMax()); in udiv() local
1341 return getNonEmpty(std::move(Lower), std::move(Upper)); in udiv()
1363 PosRes = ConstantRange(PosL.Lower.sdiv(PosR.Upper - 1), in sdiv()
1364 (PosL.Upper - 1).sdiv(PosR.Lower) + 1); in sdiv()
1373 APInt Lo = (NegL.Upper - 1).sdiv(NegR.Lower); in sdiv()
1374 if (NegL.Lower.isMinSignedValue() && NegR.Upper.isZero()) { in sdiv()
1377 if (!NegR.Lower.isAllOnes()) { in sdiv()
1379 if (RHS.Lower.isAllOnes()) in sdiv()
1387 ConstantRange(Lo, NegL.Lower.sdiv(AdjNegRUpper - 1) + 1)); in sdiv()
1396 AdjNegLLower = Lower; in sdiv()
1399 AdjNegLLower = NegL.Lower + 1; in sdiv()
1407 ConstantRange(std::move(Lo), NegL.Lower.sdiv(NegR.Upper - 1) + 1)); in sdiv()
1415 PosL.Lower.sdiv(NegR.Lower) + 1); in sdiv()
1420 ConstantRange(NegL.Lower.sdiv(PosR.Lower), in sdiv()
1495 APInt Lower = APIntOps::umax(MinLHS, -MaxAbsRHS + 1); in srem() local
1496 return ConstantRange(std::move(Lower), APInt(getBitWidth(), 1)); in srem()
1500 APInt Lower = APIntOps::umax(MinLHS, -MaxAbsRHS + 1); in srem() local
1502 return ConstantRange(std::move(Lower), std::move(Upper)); in srem()
1630 // 'PosMin' is the lower bound of the result of the ashr in ashr()
1631 // operation, when Lower of the LHS is a non-negative number. in ashr()
1633 // number, the Lower value of LHS is shifted right with the in ashr()
1644 // 'NegMin' is the lower bound of the result of the ashr in ashr()
1645 // operation, when Lower of the LHS of ashr is a negative number. in ashr()
1647 // number, the Lower value of LHS is shifted right with the in ashr()
1653 // Upper and Lower of LHS are non-negative. in ashr()
1657 // Upper and Lower of LHS are negative. in ashr()
1661 // Upper is non-negative and Lower is negative. in ashr()
1717 // Because we could be dealing with negative numbers here, the lower bound is in smul_sat()
1718 // the smallest of the cartesian product of the lower and upper ranges; in smul_sat()
1759 return ConstantRange(Upper, Lower); in inverse()
1769 if (Upper.isStrictlyPositive() || !Lower.isStrictlyPositive()) in abs()
1772 Lo = APIntOps::umin(Lower, -Upper + 1); in abs()
1812 // 1) Lower is zero, handling cases of kind [0, 1), [0, 2), etc. in ctlz()
1823 // Compute the resulting range by excluding zero from Lower. in ctlz()
1842 static ConstantRange getUnsignedCountTrailingZerosRange(const APInt &Lower, in getUnsignedCountTrailingZerosRange() argument
1844 assert(!ConstantRange(Lower, Upper).isWrappedSet() && in getUnsignedCountTrailingZerosRange()
1846 assert(Lower != Upper && "Unexpected empty set."); in getUnsignedCountTrailingZerosRange()
1847 unsigned BitWidth = Lower.getBitWidth(); in getUnsignedCountTrailingZerosRange()
1848 if (Lower + 1 == Upper) in getUnsignedCountTrailingZerosRange()
1849 return ConstantRange(APInt(BitWidth, Lower.countr_zero())); in getUnsignedCountTrailingZerosRange()
1850 if (Lower.isZero()) in getUnsignedCountTrailingZerosRange()
1855 unsigned LCPLength = (Lower ^ (Upper - 1)).countl_zero(); in getUnsignedCountTrailingZerosRange()
1856 // If Lower is {LCP, 000...}, the maximum is Lower.countr_zero(). in getUnsignedCountTrailingZerosRange()
1861 std::max(BitWidth - LCPLength - 1, Lower.countr_zero()) + 1)); in getUnsignedCountTrailingZerosRange()
1873 // 1) Lower is zero, handling cases of kind [0, 1), [0, 2), etc. in cttz()
1877 if (Lower.isZero()) { in cttz()
1884 // Compute the resulting range by excluding zero from Lower. in cttz()
1888 return getUnsignedCountTrailingZerosRange(Lower, Zero); in cttz()
1890 ConstantRange CR1 = getUnsignedCountTrailingZerosRange(Lower, Zero); in cttz()
1900 return getUnsignedCountTrailingZerosRange(Lower, Upper); in cttz()
1902 // [Lower, 0). in cttz()
1903 // Handle [Lower, 0) in cttz()
1904 ConstantRange CR1 = getUnsignedCountTrailingZerosRange(Lower, Zero); in cttz()
1910 static ConstantRange getUnsignedPopCountRange(const APInt &Lower, in getUnsignedPopCountRange() argument
1912 assert(!ConstantRange(Lower, Upper).isWrappedSet() && in getUnsignedPopCountRange()
1914 assert(Lower != Upper && "Unexpected empty set."); in getUnsignedPopCountRange()
1915 unsigned BitWidth = Lower.getBitWidth(); in getUnsignedPopCountRange()
1916 if (Lower + 1 == Upper) in getUnsignedPopCountRange()
1917 return ConstantRange(APInt(BitWidth, Lower.popcount())); in getUnsignedPopCountRange()
1921 unsigned LCPLength = (Lower ^ Max).countl_zero(); in getUnsignedPopCountRange()
1922 unsigned LCPPopCount = Lower.getHiBits(LCPLength).popcount(); in getUnsignedPopCountRange()
1923 // If Lower is {LCP, 000...}, the minimum is the popcount of LCP. in getUnsignedPopCountRange()
1926 LCPPopCount + (Lower.countr_zero() < BitWidth - LCPLength ? 1 : 0); in getUnsignedPopCountRange()
1945 return getUnsignedPopCountRange(Lower, Upper); in ctpop()
1947 // [Lower, 0). in ctpop()
1948 // Handle [Lower, 0) == [Lower, Max] in ctpop()
1949 ConstantRange CR1 = ConstantRange(APInt(BitWidth, Lower.countl_one()), in ctpop()
2074 OS << "[" << Lower << "," << Upper << ")"; in print()