Home
last modified time | relevance | path

Searched refs:ConstantRange (Results 1 – 25 of 60) sorted by relevance

123

/openbsd-src/gnu/llvm/llvm/include/llvm/IR/
H A DConstantRange.h47 class [[nodiscard]] ConstantRange {
51 ConstantRange getEmpty() const { in getEmpty()
52 return ConstantRange(getBitWidth(), false); in getEmpty()
56 ConstantRange getFull() const { in getFull()
57 return ConstantRange(getBitWidth(), true); in getFull()
62 explicit ConstantRange(uint32_t BitWidth, bool isFullSet);
65 ConstantRange(APInt Value);
70 ConstantRange(APInt Lower, APInt Upper);
73 static ConstantRange getEmpty(uint32_t BitWidth) { in getEmpty()
74 return ConstantRange(BitWidth, false); in getEmpty()
[all …]
H A DGlobalValue.h35 class ConstantRange; variable
642 std::optional<ConstantRange> getAbsoluteSymbolRange() const;
/openbsd-src/gnu/llvm/llvm/lib/IR/
H A DConstantRange.cpp44 ConstantRange::ConstantRange(uint32_t BitWidth, bool Full) in ConstantRange() function in ConstantRange
48 ConstantRange::ConstantRange(APInt V) in ConstantRange() function in ConstantRange
51 ConstantRange::ConstantRange(APInt L, APInt U) in ConstantRange() function in ConstantRange
59 ConstantRange ConstantRange::fromKnownBits(const KnownBits &Known, in fromKnownBits()
69 return ConstantRange(Known.getMinValue(), Known.getMaxValue() + 1); in fromKnownBits()
76 return ConstantRange(Lower, Upper + 1); in fromKnownBits()
79 KnownBits ConstantRange::toKnownBits() const { in toKnownBits()
97 ConstantRange ConstantRange::makeAllowedICmpRegion(CmpInst::Predicate Pred, in makeAllowedICmpRegion()
98 const ConstantRange &CR) { in makeAllowedICmpRegion()
110 return ConstantRange(CR.getUpper(), CR.getLower()); in makeAllowedICmpRegion()
[all …]
H A DCMakeLists.txt11 ConstantRange.cpp
H A DMetadata.cpp1075 static bool isContiguous(const ConstantRange &A, const ConstantRange &B) { in isContiguous()
1079 static bool canBeMerged(const ConstantRange &A, const ConstantRange &B) { in canBeMerged()
1085 ConstantRange NewRange(Low->getValue(), High->getValue()); in tryMergeRange()
1089 ConstantRange LastRange(LB, LE); in tryMergeRange()
1091 ConstantRange Union = LastRange.unionWith(NewRange); in tryMergeRange()
1172 ConstantRange Range(EndPoints[0]->getValue(), EndPoints[1]->getValue()); in getMostGenericRange()
/openbsd-src/gnu/llvm/llvm/include/llvm/Transforms/Scalar/
H A DFloat2Int.h40 void seen(Instruction *I, ConstantRange R);
41 ConstantRange badRange();
42 ConstantRange unknownRange();
43 ConstantRange validateRange(ConstantRange R);
44 std::optional<ConstantRange> calcRange(Instruction *I);
51 MapVector<Instruction *, ConstantRange> SeenInsts;
/openbsd-src/gnu/llvm/llvm/lib/Analysis/
H A DStackSafetyAnalysis.cpp74 bool isUnsafe(const ConstantRange &R) { in isUnsafe()
78 ConstantRange addOverflowNever(const ConstantRange &L, const ConstantRange &R) { in addOverflowNever()
82 ConstantRange::OverflowResult::NeverOverflows) in addOverflowNever()
83 return ConstantRange::getFull(L.getBitWidth()); in addOverflowNever()
84 ConstantRange Result = L.add(R); in addOverflowNever()
89 ConstantRange unionNoWrap(const ConstantRange &L, const ConstantRange &R) { in unionNoWrap()
95 Result = ConstantRange::getFull(Result.getBitWidth()); in unionNoWrap()
120 ConstantRange Range;
128 using CallsTy = std::map<CallInfo<CalleeTy>, ConstantRange,
134 void updateRange(const ConstantRange &R) { Range = unionNoWrap(Range, R); } in updateRange()
[all …]
H A DLazyValueInfo.cpp123 ConstantRange Range = in intersect()
415 std::optional<ConstantRange> getRangeFor(Value *V, Instruction *CxtI,
419 std::function<ConstantRange(const ConstantRange &, const ConstantRange &)>
801 static ConstantRange getConstantRangeOrFull(const ValueLatticeElement &Val, in getConstantRangeOrFull()
805 return ConstantRange::getFull(DL.getTypeSizeInBits(Ty)); in getConstantRangeOrFull()
824 const ConstantRange &TrueCR = in solveBlockValueSelect()
826 const ConstantRange &FalseCR = in solveBlockValueSelect()
836 ConstantRange ResultCR = [&]() { in solveBlockValueSelect()
865 ConstantRange Zero(APInt::getZero(TrueCR.getBitWidth())); in solveBlockValueSelect()
889 std::optional<ConstantRange>
[all …]
H A DBasicAliasAnalysis.cpp293 ConstantRange evaluateWith(ConstantRange N) const { in evaluateWith()
1131 ConstantRange OffsetRange = ConstantRange(DecompGEP1.Offset); in aliasGEP()
1145 ConstantRange CR = computeConstantRange(Index.Val.V, /* ForSigned */ false, in aliasGEP()
1150 ConstantRange::fromKnownBits(Known, /* Signed */ true), in aliasGEP()
1151 ConstantRange::Signed); in aliasGEP()
1157 OffsetRange = OffsetRange.add(CR.smul_sat(ConstantRange(Scale))); in aliasGEP()
1159 OffsetRange = OffsetRange.add(CR.smul_fast(ConstantRange(Scale))); in aliasGEP()
1178 ConstantRange Range1 = OffsetRange.add( in aliasGEP()
1179 ConstantRange(APInt(BW, 0), APInt(BW, V1Size.getValue()))); in aliasGEP()
1180 ConstantRange Range2 = in aliasGEP()
[all …]
H A DScalarEvolution.cpp1668 ConstantRange CR = getUnsignedRange(X); in getZeroExtendExprImpl()
1996 ConstantRange CR = getSignedRange(X); in getSignExtendExprImpl()
2496 auto NSWRegion = ConstantRange::makeGuaranteedNoWrapRegion( in StrengthenNoWrapFlags()
2504 auto NUWRegion = ConstantRange::makeGuaranteedNoWrapRegion( in StrengthenNoWrapFlags()
5058 ConstantRange AddRecRange = getSignedRange(AR); in proveNoWrapViaConstantRanges()
5059 ConstantRange IncRange = getSignedRange(AR->getStepRecurrence(*this)); in proveNoWrapViaConstantRanges()
5061 auto NSWRegion = ConstantRange::makeGuaranteedNoWrapRegion( in proveNoWrapViaConstantRanges()
5068 ConstantRange AddRecRange = getUnsignedRange(AR); in proveNoWrapViaConstantRanges()
5069 ConstantRange IncRange = getUnsignedRange(AR->getStepRecurrence(*this)); in proveNoWrapViaConstantRanges()
5071 auto NUWRegion = ConstantRange::makeGuaranteedNoWrapRegion( in proveNoWrapViaConstantRanges()
[all …]
H A DValueTracking.cpp478 ConstantRange Range(Lower->getValue(), Upper->getValue()); in computeKnownBitsFromRangeMetadata()
596 ConstantRange TrueValues = ConstantRange::makeExactICmpRegion(Pred, *C); in cmpExcludesZero()
2403 ConstantRange Range(Lower->getValue(), Upper->getValue()); in rangeMetadataExcludesValue()
4926 static OverflowResult mapOverflowResult(ConstantRange::OverflowResult OR) { in mapOverflowResult()
4928 case ConstantRange::OverflowResult::MayOverflow: in mapOverflowResult()
4930 case ConstantRange::OverflowResult::AlwaysOverflowsLow: in mapOverflowResult()
4932 case ConstantRange::OverflowResult::AlwaysOverflowsHigh: in mapOverflowResult()
4934 case ConstantRange::OverflowResult::NeverOverflows: in mapOverflowResult()
4941 static ConstantRange computeConstantRangeIncludingKnownBits( in computeConstantRangeIncludingKnownBits()
4947 ConstantRange CR1 = ConstantRange::fromKnownBits(Known, ForSigned); in computeConstantRangeIncludingKnownBits()
[all …]
/openbsd-src/gnu/llvm/llvm/include/llvm/Analysis/
H A DValueLattice.h90 ConstantRange Range;
104 Range.~ConstantRange(); in destroy()
157 new (&Range) ConstantRange(Other.Range); in ValueLatticeElement()
176 new (&Range) ConstantRange(std::move(Other.Range)); in ValueLatticeElement()
217 static ValueLatticeElement getRange(ConstantRange CR,
272 const ConstantRange &getConstantRange(bool UndefAllowed = true) const {
315 ConstantRange(CI->getValue()),
328 ConstantRange(CI->getValue() + 1, CI->getValue())); in markNotConstant()
350 bool markConstantRange(ConstantRange NewR,
382 new (&Range) ConstantRange(std::move(NewR));
[all …]
H A DLazyValueInfo.h23 class ConstantRange; variable
95 ConstantRange getConstantRange(Value *V, Instruction *CxtI,
100 ConstantRange getConstantRangeAtUse(const Use &U, bool UndefAllowed = true);
110 ConstantRange getConstantRangeOnEdge(Value *V, BasicBlock *FromBB,
H A DScalarEvolution.h964 ConstantRange getUnsignedRange(const SCEV *S) {
980 ConstantRange getSignedRange(const SCEV *S) {
1632 DenseMap<const SCEV *, ConstantRange> UnsignedRanges;
1635 DenseMap<const SCEV *, ConstantRange> SignedRanges;
1641 const ConstantRange &setRange(const SCEV *S, RangeSignHint Hint,
1642 ConstantRange CR) {
1643 DenseMap<const SCEV *, ConstantRange> &Cache =
1655 const ConstantRange &getRangeRef(const SCEV *S, RangeSignHint Hint,
1660 const ConstantRange &getRangeRefIter(const SCEV *S, RangeSignHint Hint);
1664 ConstantRange getRangeForAffineAR(const SCEV *Start, const SCEV *Step,
[all …]
/openbsd-src/gnu/llvm/llvm/lib/Transforms/Scalar/
H A DFloat2Int.cpp148 void Float2IntPass::seen(Instruction *I, ConstantRange R) { in seen()
158 ConstantRange Float2IntPass::badRange() { in badRange()
159 return ConstantRange::getFull(MaxIntegerBW + 1); in badRange()
161 ConstantRange Float2IntPass::unknownRange() { in unknownRange()
162 return ConstantRange::getEmpty(MaxIntegerBW + 1); in unknownRange()
164 ConstantRange Float2IntPass::validateRange(ConstantRange R) { in validateRange()
206 auto Input = ConstantRange::getFull(BW); in walkBackwards()
239 std::optional<ConstantRange> Float2IntPass::calcRange(Instruction *I) { in calcRange()
240 SmallVector<ConstantRange, 4> OpRanges; in calcRange()
279 OpRanges.push_back(ConstantRange(Int)); in calcRange()
[all …]
H A DCorrelatedValuePropagation.cpp326 ConstantRange::getEquivalentPredWithFlippedSignedness( in processICmp()
442 ConstantRange LRange = LVI->getConstantRangeAtUse(BO->getOperandUse(0)); in willNotOverflow()
443 ConstantRange RRange = LVI->getConstantRangeAtUse(BO->getOperandUse(1)); in willNotOverflow()
444 ConstantRange NWRegion = ConstantRange::makeGuaranteedNoWrapRegion( in willNotOverflow()
698 static Domain getDomain(const ConstantRange &CR) { in getDomain()
708 static bool narrowSDivOrSRem(BinaryOperator *Instr, const ConstantRange &LCR, in narrowSDivOrSRem()
709 const ConstantRange &RCR) { in narrowSDivOrSRem()
720 std::array<std::optional<ConstantRange>, 2> CRs; in narrowSDivOrSRem()
756 static bool expandUDivOrURem(BinaryOperator *Instr, const ConstantRange &XCR, in expandUDivOrURem()
757 const ConstantRange &YCR) { in expandUDivOrURem()
[all …]
H A DGuardWidening.cpp519 ConstantRange CR0 = in widenCondCommon()
520 ConstantRange::makeExactICmpRegion(Pred0, RHS0->getValue()); in widenCondCommon()
521 ConstantRange CR1 = in widenCondCommon()
522 ConstantRange::makeExactICmpRegion(Pred1, RHS1->getValue()); in widenCondCommon()
527 if (std::optional<ConstantRange> Intersect = in widenCondCommon()
/openbsd-src/gnu/llvm/llvm/lib/Transforms/Utils/
H A DSCCPSolver.cpp685 ConstantRange getConstantRange(const ValueLatticeElement &LV, Type *Ty) const;
786 ConstantRange
792 return ConstantRange::getFull(Ty->getScalarSizeInBits()); in getConstantRange()
911 const ConstantRange &Range = SCValue.getConstantRange(); in getFeasibleSuccessors()
1096 ConstantRange OpRange = getConstantRange(OpSt, I.getSrcTy()); in visitCastInst()
1109 ConstantRange Res = in visitCastInst()
1128 ConstantRange LR = getConstantRange(L, Ty); in handleExtractOfWithOverflow()
1129 ConstantRange RR = getConstantRange(R, Ty); in handleExtractOfWithOverflow()
1131 ConstantRange Res = LR.binaryOp(WO->getBinaryOp(), RR); in handleExtractOfWithOverflow()
1135 ConstantRange NWRegion = ConstantRange::makeGuaranteedNoWrapRegion( in handleExtractOfWithOverflow()
[all …]
H A DLowerSwitch.cpp414 ConstantRange KnownBitsRange = in ProcessSwitchInst()
415 ConstantRange::fromKnownBits(Known, /*IsSigned=*/false); in ProcessSwitchInst()
416 const ConstantRange LVIRange = LVI->getConstantRange(Val, SI); in ProcessSwitchInst()
417 ConstantRange ValRange = KnownBitsRange.intersectWith(LVIRange); in ProcessSwitchInst()
H A DSimplifyIndVar.cpp782 ConstantRange IVRange = SE->getUnsignedRange(SE->getSCEV(IVOperand)); in strengthenRightShift()
1031 DenseMap<DefUserPair, ConstantRange> PostIncRangeInfos;
1033 std::optional<ConstantRange> getPostIncRangeInfo(Value *Def, in getPostIncRangeInfo()
1038 ? std::optional<ConstantRange>(std::nullopt) in getPostIncRangeInfo()
1039 : std::optional<ConstantRange>(It->second); in getPostIncRangeInfo()
1045 void updatePostIncRangeInfo(Value *Def, Instruction *UseI, ConstantRange R) { in updatePostIncRangeInfo()
1997 ConstantRange::makeAllowedICmpRegion(P, CmpRHSRange); in calculatePostIncRange()
/openbsd-src/gnu/llvm/llvm/lib/CodeGen/
H A DSafeStack.cpp233 ConstantRange AccessStartRange = SE.getUnsignedRange(Expr); in IsAccessSafe()
234 ConstantRange SizeRange = in IsAccessSafe()
235 ConstantRange(APInt(BitWidth, 0), APInt(BitWidth, AccessSize)); in IsAccessSafe()
236 ConstantRange AccessRange = AccessStartRange.add(SizeRange); in IsAccessSafe()
237 ConstantRange AllocaRange = in IsAccessSafe()
238 ConstantRange(APInt(BitWidth, 0), APInt(BitWidth, AllocaSize)); in IsAccessSafe()
/openbsd-src/gnu/usr.bin/clang/libLLVMCore/
H A DMakefile18 ConstantRange.cpp \
/openbsd-src/gnu/llvm/llvm/utils/gn/secondary/llvm/lib/IR/
H A DBUILD.gn25 "ConstantRange.cpp",
/openbsd-src/gnu/llvm/llvm/include/llvm/Transforms/IPO/
H A DAttributor.h2754 ConstantRange Assumed;
2757 ConstantRange Known;
2760 : BitWidth(BitWidth), Assumed(ConstantRange::getEmpty(BitWidth)),
2761 Known(ConstantRange::getFull(BitWidth)) {}
2763 IntegerRangeState(const ConstantRange &CR)
2768 static ConstantRange getWorstState(uint32_t BitWidth) {
2769 return ConstantRange::getFull(BitWidth);
2773 static ConstantRange getBestState(uint32_t BitWidth) {
2774 return ConstantRange::getEmpty(BitWidth);
2776 static ConstantRange getBestState(const IntegerRangeState &IRS) {
[all …]
/openbsd-src/gnu/llvm/llvm/lib/Target/X86/
H A DX86Subtarget.cpp140 if (std::optional<ConstantRange> CR = GV->getAbsoluteSymbolRange()) { in classifyGlobalReference()

123