Lines Matching refs:ConstantRange
34 ConstantRange::ConstantRange(uint32_t BitWidth, bool Full) { in ConstantRange() function in ConstantRange
43 ConstantRange::ConstantRange(APIntMoveTy V) in ConstantRange() function in ConstantRange
46 ConstantRange::ConstantRange(APIntMoveTy L, APIntMoveTy U) in ConstantRange() function in ConstantRange
54 ConstantRange ConstantRange::makeAllowedICmpRegion(CmpInst::Predicate Pred, in makeAllowedICmpRegion()
55 const ConstantRange &CR) { in makeAllowedICmpRegion()
67 return ConstantRange(CR.getUpper(), CR.getLower()); in makeAllowedICmpRegion()
68 return ConstantRange(W); in makeAllowedICmpRegion()
72 return ConstantRange(W, /* empty */ false); in makeAllowedICmpRegion()
73 return ConstantRange(APInt::getMinValue(W), UMax); in makeAllowedICmpRegion()
78 return ConstantRange(W, /* empty */ false); in makeAllowedICmpRegion()
79 return ConstantRange(APInt::getSignedMinValue(W), SMax); in makeAllowedICmpRegion()
84 return ConstantRange(W); in makeAllowedICmpRegion()
85 return ConstantRange(APInt::getMinValue(W), UMax + 1); in makeAllowedICmpRegion()
90 return ConstantRange(W); in makeAllowedICmpRegion()
91 return ConstantRange(APInt::getSignedMinValue(W), SMax + 1); in makeAllowedICmpRegion()
96 return ConstantRange(W, /* empty */ false); in makeAllowedICmpRegion()
97 return ConstantRange(UMin + 1, APInt::getNullValue(W)); in makeAllowedICmpRegion()
102 return ConstantRange(W, /* empty */ false); in makeAllowedICmpRegion()
103 return ConstantRange(SMin + 1, APInt::getSignedMinValue(W)); in makeAllowedICmpRegion()
108 return ConstantRange(W); in makeAllowedICmpRegion()
109 return ConstantRange(UMin, APInt::getNullValue(W)); in makeAllowedICmpRegion()
114 return ConstantRange(W); in makeAllowedICmpRegion()
115 return ConstantRange(SMin, APInt::getSignedMinValue(W)); in makeAllowedICmpRegion()
120 ConstantRange ConstantRange::makeSatisfyingICmpRegion(CmpInst::Predicate Pred, in makeSatisfyingICmpRegion()
121 const ConstantRange &CR) { in makeSatisfyingICmpRegion()
130 ConstantRange ConstantRange::makeExactICmpRegion(CmpInst::Predicate Pred, in makeExactICmpRegion()
142 bool ConstantRange::getEquivalentICmp(CmpInst::Predicate &Pred, in getEquivalentICmp()
162 assert((!Success || ConstantRange::makeExactICmpRegion(Pred, RHS) == *this) && in getEquivalentICmp()
168 ConstantRange
169 ConstantRange::makeGuaranteedNoWrapRegion(Instruction::BinaryOps BinOp, in makeGuaranteedNoWrapRegion()
170 const ConstantRange &Other, in makeGuaranteedNoWrapRegion()
179 [](const ConstantRange &CR0, const ConstantRange &CR1) { in makeGuaranteedNoWrapRegion()
194 return ConstantRange(BitWidth, false); in makeGuaranteedNoWrapRegion()
199 return ConstantRange(BitWidth); in makeGuaranteedNoWrapRegion()
201 ConstantRange Result(BitWidth); in makeGuaranteedNoWrapRegion()
205 SubsetIntersect(Result, ConstantRange(APInt::getNullValue(BitWidth), in makeGuaranteedNoWrapRegion()
215 ConstantRange(APInt::getSignedMinValue(BitWidth), in makeGuaranteedNoWrapRegion()
220 Result, ConstantRange(APInt::getSignedMinValue(BitWidth) - SignedMin, in makeGuaranteedNoWrapRegion()
229 bool ConstantRange::isFullSet() const { in isFullSet()
235 bool ConstantRange::isEmptySet() const { in isEmptySet()
242 bool ConstantRange::isWrappedSet() const { in isWrappedSet()
249 bool ConstantRange::isSignWrappedSet() const { in isSignWrappedSet()
256 APInt ConstantRange::getSetSize() const { in getSetSize()
270 APInt ConstantRange::getUnsignedMax() const { in getUnsignedMax()
279 APInt ConstantRange::getUnsignedMin() const { in getUnsignedMin()
288 APInt ConstantRange::getSignedMax() const { in getSignedMax()
303 APInt ConstantRange::getSignedMin() const { in getSignedMin()
319 bool ConstantRange::contains(const APInt &V) const { in contains()
332 bool ConstantRange::contains(const ConstantRange &Other) const { in contains()
352 ConstantRange ConstantRange::subtract(const APInt &Val) const { in subtract()
357 return ConstantRange(Lower - Val, Upper - Val); in subtract()
362 ConstantRange ConstantRange::difference(const ConstantRange &CR) const { in difference()
371 ConstantRange ConstantRange::intersectWith(const ConstantRange &CR) const { in intersectWith()
385 return ConstantRange(getBitWidth(), false); in intersectWith()
388 return ConstantRange(CR.Lower, Upper); in intersectWith()
396 return ConstantRange(Lower, CR.Upper); in intersectWith()
398 return ConstantRange(getBitWidth(), false); in intersectWith()
407 return ConstantRange(CR.Lower, Upper); in intersectWith()
415 return ConstantRange(getBitWidth(), false); in intersectWith()
417 return ConstantRange(Lower, CR.Upper); in intersectWith()
430 return ConstantRange(Lower, CR.Upper); in intersectWith()
438 return ConstantRange(CR.Lower, Upper); in intersectWith()
452 ConstantRange ConstantRange::unionWith(const ConstantRange &CR) const { in unionWith()
466 return ConstantRange(Lower, CR.Upper); in unionWith()
467 return ConstantRange(CR.Lower, Upper); in unionWith()
477 return ConstantRange(getBitWidth()); in unionWith()
479 return ConstantRange(L, U); in unionWith()
491 return ConstantRange(getBitWidth()); in unionWith()
499 return ConstantRange(Lower, CR.Upper); in unionWith()
500 return ConstantRange(CR.Lower, Upper); in unionWith()
506 return ConstantRange(CR.Lower, Upper); in unionWith()
512 return ConstantRange(Lower, CR.Upper); in unionWith()
518 return ConstantRange(getBitWidth()); in unionWith()
526 return ConstantRange(L, U); in unionWith()
533 ConstantRange ConstantRange::zeroExtend(uint32_t DstTySize) const { in zeroExtend()
534 if (isEmptySet()) return ConstantRange(DstTySize, /*isFullSet=*/false); in zeroExtend()
543 return ConstantRange(LowerExt, APInt::getOneBitSet(DstTySize, SrcTySize)); in zeroExtend()
546 return ConstantRange(Lower.zext(DstTySize), Upper.zext(DstTySize)); in zeroExtend()
553 ConstantRange ConstantRange::signExtend(uint32_t DstTySize) const { in signExtend()
554 if (isEmptySet()) return ConstantRange(DstTySize, /*isFullSet=*/false); in signExtend()
561 return ConstantRange(Lower.sext(DstTySize), Upper.zext(DstTySize)); in signExtend()
564 return ConstantRange(APInt::getHighBitsSet(DstTySize,DstTySize-SrcTySize+1), in signExtend()
568 return ConstantRange(Lower.sext(DstTySize), Upper.sext(DstTySize)); in signExtend()
575 ConstantRange ConstantRange::truncate(uint32_t DstTySize) const { in truncate()
578 return ConstantRange(DstTySize, /*isFullSet=*/false); in truncate()
580 return ConstantRange(DstTySize, /*isFullSet=*/true); in truncate()
587 ConstantRange Union(DstTySize, /*isFullSet=*/false); in truncate()
595 return ConstantRange(DstTySize, /*isFullSet=*/true); in truncate()
597 Union = ConstantRange(APInt::getMaxValue(DstTySize),Upper.trunc(DstTySize)); in truncate()
614 return ConstantRange(LowerDiv.trunc(DstTySize), in truncate()
620 return ConstantRange(LowerDiv.trunc(DstTySize), in truncate()
623 return ConstantRange(DstTySize, /*isFullSet=*/true); in truncate()
628 ConstantRange ConstantRange::zextOrTrunc(uint32_t DstTySize) const { in zextOrTrunc()
639 ConstantRange ConstantRange::sextOrTrunc(uint32_t DstTySize) const { in sextOrTrunc()
648 ConstantRange
649 ConstantRange::add(const ConstantRange &Other) const { in add()
651 return ConstantRange(getBitWidth(), /*isFullSet=*/false); in add()
653 return ConstantRange(getBitWidth(), /*isFullSet=*/true); in add()
659 return ConstantRange(getBitWidth(), /*isFullSet=*/true); in add()
661 ConstantRange X = ConstantRange(NewLower, NewUpper); in add()
664 return ConstantRange(getBitWidth(), /*isFullSet=*/true); in add()
669 ConstantRange
670 ConstantRange::sub(const ConstantRange &Other) const { in sub()
672 return ConstantRange(getBitWidth(), /*isFullSet=*/false); in sub()
674 return ConstantRange(getBitWidth(), /*isFullSet=*/true); in sub()
680 return ConstantRange(getBitWidth(), /*isFullSet=*/true); in sub()
682 ConstantRange X = ConstantRange(NewLower, NewUpper); in sub()
685 return ConstantRange(getBitWidth(), /*isFullSet=*/true); in sub()
690 ConstantRange
691 ConstantRange::multiply(const ConstantRange &Other) const { in multiply()
698 return ConstantRange(getBitWidth(), /*isFullSet=*/false); in multiply()
712 ConstantRange Result_zext = ConstantRange(this_min * Other_min, in multiply()
714 ConstantRange UR = Result_zext.truncate(getBitWidth()); in multiply()
737 ConstantRange Result_sext(std::min(L, Compare), std::max(L, Compare) + 1); in multiply()
738 ConstantRange SR = Result_sext.truncate(getBitWidth()); in multiply()
743 ConstantRange
744 ConstantRange::smax(const ConstantRange &Other) const { in smax()
748 return ConstantRange(getBitWidth(), /*isFullSet=*/false); in smax()
752 return ConstantRange(getBitWidth(), /*isFullSet=*/true); in smax()
753 return ConstantRange(NewL, NewU); in smax()
756 ConstantRange
757 ConstantRange::umax(const ConstantRange &Other) const { in umax()
761 return ConstantRange(getBitWidth(), /*isFullSet=*/false); in umax()
765 return ConstantRange(getBitWidth(), /*isFullSet=*/true); in umax()
766 return ConstantRange(NewL, NewU); in umax()
769 ConstantRange
770 ConstantRange::smin(const ConstantRange &Other) const { in smin()
774 return ConstantRange(getBitWidth(), /*isFullSet=*/false); in smin()
778 return ConstantRange(getBitWidth(), /*isFullSet=*/true); in smin()
779 return ConstantRange(NewL, NewU); in smin()
782 ConstantRange
783 ConstantRange::umin(const ConstantRange &Other) const { in umin()
787 return ConstantRange(getBitWidth(), /*isFullSet=*/false); in umin()
791 return ConstantRange(getBitWidth(), /*isFullSet=*/true); in umin()
792 return ConstantRange(NewL, NewU); in umin()
795 ConstantRange
796 ConstantRange::udiv(const ConstantRange &RHS) const { in udiv()
798 return ConstantRange(getBitWidth(), /*isFullSet=*/false); in udiv()
800 return ConstantRange(getBitWidth(), /*isFullSet=*/true); in udiv()
819 return ConstantRange(getBitWidth(), /*isFullSet=*/true); in udiv()
821 return ConstantRange(Lower, Upper); in udiv()
824 ConstantRange
825 ConstantRange::binaryAnd(const ConstantRange &Other) const { in binaryAnd()
827 return ConstantRange(getBitWidth(), /*isFullSet=*/false); in binaryAnd()
833 return ConstantRange(getBitWidth(), /*isFullSet=*/true); in binaryAnd()
834 return ConstantRange(APInt::getNullValue(getBitWidth()), umin + 1); in binaryAnd()
837 ConstantRange
838 ConstantRange::binaryOr(const ConstantRange &Other) const { in binaryOr()
840 return ConstantRange(getBitWidth(), /*isFullSet=*/false); in binaryOr()
846 return ConstantRange(getBitWidth(), /*isFullSet=*/true); in binaryOr()
847 return ConstantRange(umax, APInt::getNullValue(getBitWidth())); in binaryOr()
850 ConstantRange
851 ConstantRange::shl(const ConstantRange &Other) const { in shl()
853 return ConstantRange(getBitWidth(), /*isFullSet=*/false); in shl()
861 return ConstantRange(min, max + 1); in shl()
864 return ConstantRange(getBitWidth(), /*isFullSet=*/true); in shl()
867 ConstantRange
868 ConstantRange::lshr(const ConstantRange &Other) const { in lshr()
870 return ConstantRange(getBitWidth(), /*isFullSet=*/false); in lshr()
875 return ConstantRange(getBitWidth(), /*isFullSet=*/true); in lshr()
877 return ConstantRange(min, max + 1); in lshr()
880 ConstantRange ConstantRange::inverse() const { in inverse()
882 return ConstantRange(getBitWidth(), /*isFullSet=*/false); in inverse()
884 return ConstantRange(getBitWidth(), /*isFullSet=*/true); in inverse()
885 return ConstantRange(Upper, Lower); in inverse()
890 void ConstantRange::print(raw_ostream &OS) const { in print()
901 LLVM_DUMP_METHOD void ConstantRange::dump() const { in dump()