Lines Matching full:upper
11 // for an integral value. This keeps track of a lower and upper bound for the
13 // keeps track of a [lower, upper) bound, which specifies an interval just like
34 Lower = Upper = APInt::getMaxValue(BitWidth);
36 Lower = Upper = APInt::getMinValue(BitWidth);
42 : Lower(std::move(V)), Upper(Lower + 1) {}
45 : Lower(std::move(L)), Upper(std::move(U)) {
46 assert(Lower.getBitWidth() == Upper.getBitWidth() &&
48 assert((Lower != Upper || (Lower.isMaxValue() || Lower.isMinValue())) &&
49 "Lower == Upper, but they aren't min or max value!");
131 return Lower == Upper && Lower.isMaxValue();
137 return Lower == Upper && Lower.isMinValue();
144 return Lower.ugt(Upper);
165 return (Upper - Lower).zext(getBitWidth()+1);
221 if (Lower == Upper)
225 return Lower.ule(V) && V.ult(Upper);
226 return Lower.ule(V) || V.ult(Upper);
241 return Lower.ule(Other.getLower()) && Other.getUpper().ule(Upper);
245 return Other.getUpper().ule(Upper) ||
248 return Other.getUpper().ule(Upper) && Lower.ule(Other.getLower());
256 if (Lower == Upper)
258 return ConstantRange(Lower - Val, Upper - Val);
285 if (Upper.ule(CR.Lower))
288 if (Upper.ult(CR.Upper))
289 return ConstantRange(CR.Lower, Upper);
293 if (Upper.ult(CR.Upper))
296 if (Lower.ult(CR.Upper))
297 return ConstantRange(Lower, CR.Upper);
303 if (CR.Lower.ult(Upper)) {
304 if (CR.Upper.ult(Upper))
307 if (CR.Upper.ule(Lower))
308 return ConstantRange(CR.Lower, Upper);
315 if (CR.Upper.ule(Lower))
318 return ConstantRange(Lower, CR.Upper);
323 if (CR.Upper.ult(Upper)) {
324 if (CR.Lower.ult(Upper)) {
331 return ConstantRange(Lower, CR.Upper);
335 if (CR.Upper.ule(Lower)) {
339 return ConstantRange(CR.Lower, Upper);
363 if (CR.Upper.ult(Lower) || Upper.ult(CR.Lower)) {
365 APInt d1 = CR.Lower - Upper, d2 = Lower - CR.Upper;
367 return ConstantRange(Lower, CR.Upper);
368 return ConstantRange(CR.Lower, Upper);
371 APInt L = Lower, U = Upper;
374 if ((CR.Upper - 1).ugt(U - 1))
375 U = CR.Upper;
386 if (CR.Upper.ule(Upper) || CR.Lower.uge(Lower))
391 if (CR.Lower.ule(Upper) && Lower.ule(CR.Upper))
397 if (Upper.ule(CR.Lower) && CR.Upper.ule(Lower)) {
398 APInt d1 = CR.Lower - Upper, d2 = Lower - CR.Upper;
400 return ConstantRange(Lower, CR.Upper);
401 return ConstantRange(CR.Lower, Upper);
406 if (Upper.ult(CR.Lower) && Lower.ult(CR.Upper))
407 return ConstantRange(CR.Lower, Upper);
411 assert(CR.Lower.ult(Upper) && CR.Upper.ult(Lower) &&
413 return ConstantRange(Lower, CR.Upper);
418 if (CR.Lower.ule(Upper) || Lower.ule(CR.Upper))
421 APInt L = Lower, U = Upper;
422 if (CR.Upper.ugt(U))
423 U = CR.Upper;
442 if (!Upper) // special case: [X, 0) -- not really wrapping around
447 return ConstantRange(Lower.zext(DstTySize), Upper.zext(DstTySize));
461 if (Upper.isMinSignedValue())
462 return ConstantRange(Lower.sext(DstTySize), Upper.zext(DstTySize));
469 return ConstantRange(Lower.sext(DstTySize), Upper.sext(DstTySize));
487 APInt LowerDiv(Lower), UpperDiv(Upper);
490 // Analyze wrapped sets in their two parts: [0, Upper) \/ [Lower, MaxValue]
492 // then we do the union with [MaxValue, Upper)
494 // if Upper is greater than Max Value, it covers the whole truncated range.
495 if (Upper.uge(MaxValue))
498 Union = ConstantRange(APInt::getMaxValue(DstTySize),Upper.trunc(DstTySize));
619 // lower and upper ranges; for example:
621 // Similarly for the upper bound, swapping min for max.
682 APInt Upper = getUnsignedMax().udiv(RHS_umin) + 1;
686 if (Lower == Upper)
689 return ConstantRange(Lower, Upper);
753 return ConstantRange(Upper, Lower);
764 OS << "[" << Lower << "," << Upper << ")";