Lines Matching full:upper
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
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()
72 // and the upper bound as a non-negative one. in fromKnownBits()
73 APInt Lower = Known.getMinValue(), Upper = Known.getMaxValue(); in fromKnownBits() local
75 Upper.clearSignBit(); in fromKnownBits()
76 return ConstantRange(Lower, Upper + 1); in fromKnownBits()
302 APInt Lower, Upper; in makeExactMulNSWRegion() local
305 Upper = APIntOps::RoundingSDiv(MinValue, V, APInt::Rounding::DOWN); in makeExactMulNSWRegion()
308 Upper = APIntOps::RoundingSDiv(MaxValue, V, APInt::Rounding::DOWN); 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()
464 return !isUpperSignWrapped() && !Upper.isStrictlyPositive(); in isAllNegative()
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()
527 return Other.getUpper().ule(Upper) || 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()
596 if (Upper.ule(CR.Lower)) in intersectWith()
601 if (Upper.ult(CR.Upper)) in intersectWith()
602 return ConstantRange(CR.Lower, Upper); in intersectWith()
610 if (Upper.ult(CR.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()
627 if (CR.Upper.ult(Upper)) in intersectWith()
632 if (CR.Upper.ule(Lower)) in intersectWith()
633 return ConstantRange(CR.Lower, Upper); in intersectWith()
642 if (CR.Upper.ule(Lower)) in intersectWith()
647 return ConstantRange(Lower, CR.Upper); in intersectWith()
655 if (CR.Upper.ult(Upper)) { in intersectWith()
658 if (CR.Lower.ult(Upper)) in intersectWith()
664 return ConstantRange(Lower, CR.Upper); in intersectWith()
670 if (CR.Upper.ule(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()
708 APInt U = (CR.Upper - 1).ugt(Upper - 1) ? CR.Upper : Upper; 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()
754 APInt U = CR.Upper.ugt(Upper) ? CR.Upper : Upper; in unionWith()
836 if (!Upper) // special case: [X, 0) -- not really wrapping around in zeroExtend()
842 return ConstantRange(Lower.zext(DstTySize), Upper.zext(DstTySize)); in zeroExtend()
852 if (Upper.isMinSignedValue()) in signExtend()
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()
875 // then we do the union with [MaxValue, Upper) in truncate()
877 // If Upper is greater than or equal to MaxValue(DstTy), it covers the whole in truncate()
879 if (Upper.getActiveBits() > DstTySize || Upper.countr_one() == DstTySize) in truncate()
882 Union = ConstantRange(APInt::getMaxValue(DstTySize),Upper.trunc(DstTySize)); in truncate()
1210 // lower and upper ranges; for example: in multiply()
1212 // Similarly for the upper bound, swapping min for max. in multiply()
1340 APInt Upper = getUnsignedMax().udiv(RHS_umin) + 1; 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()
1381 AdjNegRUpper = RHS.Upper; in sdiv()
1384 AdjNegRUpper = NegR.Upper - 1; in sdiv()
1392 if (NegL.Upper != SignedMin + 1) { in sdiv()
1394 if (Upper == SignedMin + 1) in sdiv()
1403 AdjNegLLower.sdiv(NegR.Upper - 1) + 1)); in sdiv()
1407 ConstantRange(std::move(Lo), NegL.Lower.sdiv(NegR.Upper - 1) + 1)); in sdiv()
1414 NegRes = ConstantRange((PosL.Upper - 1).sdiv(NegR.Upper - 1), in sdiv()
1421 (NegL.Upper - 1).sdiv(PosR.Upper - 1) + 1)); in sdiv()
1450 APInt Upper = APIntOps::umin(getUnsignedMax(), RHS.getUnsignedMax() - 1) + 1; in urem() local
1451 return getNonEmpty(APInt::getZero(getBitWidth()), std::move(Upper)); in urem()
1486 APInt Upper = APIntOps::umin(MaxLHS, MaxAbsRHS - 1) + 1; in srem() local
1487 return ConstantRange(APInt::getZero(getBitWidth()), std::move(Upper)); in srem()
1501 APInt Upper = APIntOps::umin(MaxLHS, MaxAbsRHS - 1) + 1; in srem() local
1502 return ConstantRange(std::move(Lower), std::move(Upper)); in srem()
1527 // Upper wrapped range. in binaryOr()
1623 // 'PosMax' is the upper bound of the result of the ashr in ashr()
1624 // operation, when Upper of the LHS of ashr is a non-negative. in ashr()
1626 // smaller number, the Upper value of LHS is shifted right with in ashr()
1637 // 'NegMax' is the upper bound of the result of the ashr in ashr()
1638 // operation, when Upper of the LHS of ashr is a negative number. in ashr()
1640 // number, the Upper 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()
1718 // the smallest of the cartesian product of the lower and upper ranges; in smul_sat()
1721 // Similarly for the upper bound, swapping min for max. 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()
1813 // 2) Upper is zero, wrapped set, handling cases of kind [3, 0], etc. in ctlz()
1828 // Compute the resulting range by excluding zero from Upper. in ctlz()
1843 const APInt &Upper) { in getUnsignedCountTrailingZerosRange() argument
1844 assert(!ConstantRange(Lower, Upper).isWrappedSet() && in getUnsignedCountTrailingZerosRange()
1846 assert(Lower != Upper && "Unexpected empty set."); in getUnsignedCountTrailingZerosRange()
1848 if (Lower + 1 == Upper) in getUnsignedCountTrailingZerosRange()
1855 unsigned LCPLength = (Lower ^ (Upper - 1)).countl_zero(); in getUnsignedCountTrailingZerosRange()
1874 // 2) Upper is zero, wrapped set, handling cases of kind [3, 0], etc. in cttz()
1878 if (Upper == 1) { in cttz()
1885 return getUnsignedCountTrailingZerosRange(APInt(BitWidth, 1), Upper); in cttz()
1886 } else if (Upper == 1) { in cttz()
1887 // Compute the resulting range by excluding zero from Upper. in cttz()
1892 getUnsignedCountTrailingZerosRange(APInt(BitWidth, 1), Upper); in cttz()
1900 return getUnsignedCountTrailingZerosRange(Lower, Upper); in cttz()
1901 // The range is wrapped. We decompose it into two ranges, [0, Upper) and in cttz()
1905 // Handle [0, Upper) in cttz()
1906 ConstantRange CR2 = getUnsignedCountTrailingZerosRange(Zero, Upper); in cttz()
1911 const APInt &Upper) { in getUnsignedPopCountRange() argument
1912 assert(!ConstantRange(Lower, Upper).isWrappedSet() && in getUnsignedPopCountRange()
1914 assert(Lower != Upper && "Unexpected empty set."); in getUnsignedPopCountRange()
1916 if (Lower + 1 == Upper) in getUnsignedPopCountRange()
1919 APInt Max = Upper - 1; in getUnsignedPopCountRange()
1945 return getUnsignedPopCountRange(Lower, Upper); in ctpop()
1946 // The range is wrapped. We decompose it into two ranges, [0, Upper) and in ctpop()
1951 // Handle [0, Upper) in ctpop()
1952 ConstantRange CR2 = getUnsignedPopCountRange(Zero, Upper); in ctpop()
2074 OS << "[" << Lower << "," << Upper << ")"; in print()