Lines Matching defs:Lower
46 : Lower(Full ? APInt::getMaxValue(BitWidth) : APInt::getMinValue(BitWidth)),
47 Upper(Lower) {}
50 : Lower(std::move(V)), Upper(Lower + 1) {}
53 : Lower(std::move(L)), Upper(std::move(U)) {
54 assert(Lower.getBitWidth() == Upper.getBitWidth() &&
56 assert((Lower != Upper || (Lower.isMaxValue() || Lower.isMinValue())) &&
57 "Lower == Upper, but they aren't min or max value!");
74 APInt Lower = Known.getMinValue(), Upper = Known.getMaxValue();
75 Lower.setSignBit();
77 return ConstantRange(Lower, Upper + 1);
303 APInt Lower, Upper;
305 Lower = APIntOps::RoundingSDiv(MaxValue, V, APInt::Rounding::UP);
308 Lower = APIntOps::RoundingSDiv(MinValue, V, APInt::Rounding::UP);
311 return ConstantRange::getNonEmpty(Lower, Upper + 1);
415 return Lower == Upper && Lower.isMaxValue();
419 return Lower == Upper && Lower.isMinValue();
423 return Lower.ugt(Upper) && !Upper.isZero();
427 return Lower.ugt(Upper);
431 return Lower.sgt(Upper) && !Upper.isMinSignedValue();
435 return Lower.sgt(Upper);
445 return (Upper - Lower).ult(Other.Upper - Other.Lower);
455 return (Upper - Lower).ugt(MaxSize);
470 return !isSignWrappedSet() && Lower.isNonNegative();
480 return !isSignWrappedSet() && Lower.isStrictlyPositive();
508 if (Lower == Upper)
512 return Lower.ule(V) && V.ult(Upper);
513 return Lower.ule(V) || V.ult(Upper);
524 return Lower.ule(Other.getLower()) && Other.getUpper().ule(Upper);
529 Lower.ule(Other.getLower());
531 return Other.getUpper().ule(Upper) && Lower.ule(Other.getLower());
552 if (Lower == Upper)
554 return ConstantRange(Lower - Val, Upper - Val);
594 if (Lower.ult(CR.Lower)) {
597 if (Upper.ule(CR.Lower))
603 return ConstantRange(CR.Lower, Upper);
616 if (Lower.ult(CR.Upper))
617 return ConstantRange(Lower, CR.Upper);
625 if (CR.Lower.ult(Upper)) {
633 if (CR.Upper.ule(Lower))
634 return ConstantRange(CR.Lower, Upper);
640 if (CR.Lower.ult(Lower)) {
643 if (CR.Upper.ule(Lower))
648 return ConstantRange(Lower, CR.Upper);
659 if (CR.Lower.ult(Upper))
664 if (CR.Lower.ult(Lower))
665 return ConstantRange(Lower, CR.Upper);
671 if (CR.Upper.ule(Lower)) {
674 if (CR.Lower.ult(Lower))
679 return ConstantRange(CR.Lower, Upper);
704 if (CR.Upper.ult(Lower) || Upper.ult(CR.Lower))
706 ConstantRange(Lower, CR.Upper), ConstantRange(CR.Lower, Upper), Type);
708 APInt L = CR.Lower.ult(Lower) ? CR.Lower : Lower;
720 if (CR.Upper.ule(Upper) || CR.Lower.uge(Lower))
725 if (CR.Lower.ule(Upper) && Lower.ule(CR.Upper))
733 if (Upper.ult(CR.Lower) && CR.Upper.ult(Lower))
735 ConstantRange(Lower, CR.Upper), ConstantRange(CR.Lower, Upper), Type);
739 if (Upper.ult(CR.Lower) && Lower.ule(CR.Upper))
740 return ConstantRange(CR.Lower, Upper);
744 assert(CR.Lower.ule(Upper) && CR.Upper.ult(Lower) &&
746 return ConstantRange(Lower, CR.Upper);
751 if (CR.Lower.ule(Upper) || Lower.ule(CR.Upper))
754 APInt L = CR.Lower.ult(Lower) ? CR.Lower : Lower;
838 LowerExt = Lower.zext(DstTySize);
843 return ConstantRange(Lower.zext(DstTySize), Upper.zext(DstTySize));
854 return ConstantRange(Lower.sext(DstTySize), Upper.zext(DstTySize));
861 return ConstantRange(Lower.sext(DstTySize), Upper.sext(DstTySize));
871 APInt LowerDiv(Lower), UpperDiv(Upper);
874 // Analyze wrapped sets in their two parts: [0, Upper) \/ [Lower, MaxValue]
875 // We use the non-wrapped set code to analyze the [Lower, MaxValue) part, and
1342 APInt Lower = getUnsignedMin().udiv(RHS.getUnsignedMax());
1355 return getNonEmpty(std::move(Lower), std::move(Upper));
1377 PosRes = ConstantRange(PosL.Lower.sdiv(PosR.Upper - 1),
1378 (PosL.Upper - 1).sdiv(PosR.Lower) + 1);
1387 APInt Lo = (NegL.Upper - 1).sdiv(NegR.Lower);
1388 if (NegL.Lower.isMinSignedValue() && NegR.Upper.isZero()) {
1391 if (!NegR.Lower.isAllOnes()) {
1393 if (RHS.Lower.isAllOnes())
1401 ConstantRange(Lo, NegL.Lower.sdiv(AdjNegRUpper - 1) + 1));
1410 AdjNegLLower = Lower;
1413 AdjNegLLower = NegL.Lower + 1;
1421 ConstantRange(std::move(Lo), NegL.Lower.sdiv(NegR.Upper - 1) + 1));
1429 PosL.Lower.sdiv(NegR.Lower) + 1);
1434 ConstantRange(NegL.Lower.sdiv(PosR.Lower),
1509 APInt Lower = APIntOps::umax(MinLHS, -MaxAbsRHS + 1);
1510 return ConstantRange(std::move(Lower), APInt(getBitWidth(), 1));
1514 APInt Lower = APIntOps::umax(MinLHS, -MaxAbsRHS + 1);
1516 return ConstantRange(std::move(Lower), std::move(Upper));
1812 // operation, when Lower of the LHS is a non-negative number.
1814 // number, the Lower value of LHS is shifted right with the
1826 // operation, when Lower of the LHS of ashr is a negative number.
1828 // number, the Lower value of LHS is shifted right with the
1834 // Upper and Lower of LHS are non-negative.
1838 // Upper and Lower of LHS are negative.
1842 // Upper is non-negative and Lower is negative.
1940 return ConstantRange(Upper, Lower);
1950 if (Upper.isStrictlyPositive() || !Lower.isStrictlyPositive())
1953 Lo = APIntOps::umin(Lower, -Upper + 1);
1993 // 1) Lower is zero, handling cases of kind [0, 1), [0, 2), etc.
2004 // Compute the resulting range by excluding zero from Lower.
2023 static ConstantRange getUnsignedCountTrailingZerosRange(const APInt &Lower,
2025 assert(!ConstantRange(Lower, Upper).isWrappedSet() &&
2027 assert(Lower != Upper && "Unexpected empty set.");
2028 unsigned BitWidth = Lower.getBitWidth();
2029 if (Lower + 1 == Upper)
2030 return ConstantRange(APInt(BitWidth, Lower.countr_zero()));
2031 if (Lower.isZero())
2036 unsigned LCPLength = (Lower ^ (Upper - 1)).countl_zero();
2037 // If Lower is {LCP, 000...}, the maximum is Lower.countr_zero().
2042 std::max(BitWidth - LCPLength - 1, Lower.countr_zero()) + 1));
2054 // 1) Lower is zero, handling cases of kind [0, 1), [0, 2), etc.
2058 if (Lower.isZero()) {
2065 // Compute the resulting range by excluding zero from Lower.
2069 return getUnsignedCountTrailingZerosRange(Lower, Zero);
2071 ConstantRange CR1 = getUnsignedCountTrailingZerosRange(Lower, Zero);
2081 return getUnsignedCountTrailingZerosRange(Lower, Upper);
2083 // [Lower, 0).
2084 // Handle [Lower, 0)
2085 ConstantRange CR1 = getUnsignedCountTrailingZerosRange(Lower, Zero);
2091 static ConstantRange getUnsignedPopCountRange(const APInt &Lower,
2093 assert(!ConstantRange(Lower, Upper).isWrappedSet() &&
2095 assert(Lower != Upper && "Unexpected empty set.");
2096 unsigned BitWidth = Lower.getBitWidth();
2097 if (Lower + 1 == Upper)
2098 return ConstantRange(APInt(BitWidth, Lower.popcount()));
2102 unsigned LCPLength = (Lower ^ Max).countl_zero();
2103 unsigned LCPPopCount = Lower.getHiBits(LCPLength).popcount();
2104 // If Lower is {LCP, 000...}, the minimum is the popcount of LCP.
2107 LCPPopCount + (Lower.countr_zero() < BitWidth - LCPLength ? 1 : 0);
2126 return getUnsignedPopCountRange(Lower, Upper);
2128 // [Lower, 0).
2129 // Handle [Lower, 0) == [Lower, Max]
2130 ConstantRange CR1 = ConstantRange(APInt(BitWidth, Lower.countl_one()),
2255 OS << "[" << Lower << "," << Upper << ")";