Home
last modified time | relevance | path

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

1234

/freebsd/contrib/llvm-project/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 LLVM_ABI explicit ConstantRange(uint32_t BitWidth, bool isFullSet);
65 LLVM_ABI ConstantRange(APInt Value);
70 LLVM_ABI ConstantRange(APInt Lower, APInt Upper);
73 static ConstantRange getEmpty(uint32_t BitWidth) { in getEmpty()
74 return ConstantRange(BitWidth, false); in getEmpty()
[all …]
H A DConstantRangeList.h32 SmallVector<ConstantRange, 2> Ranges;
36 ConstantRangeList(ArrayRef<ConstantRange> RangesRef) { in ConstantRangeList()
38 for (const ConstantRange &R : RangesRef) { in ConstantRangeList()
45 LLVM_ABI static bool isOrderedRanges(ArrayRef<ConstantRange> RangesRef);
47 getConstantRangeList(ArrayRef<ConstantRange> RangesRef);
49 ArrayRef<ConstantRange> rangesRef() const { return Ranges; } in rangesRef()
50 SmallVectorImpl<ConstantRange>::iterator begin() { return Ranges.begin(); } in begin()
51 SmallVectorImpl<ConstantRange>::iterator end() { return Ranges.end(); } in end()
52 SmallVectorImpl<ConstantRange>::const_iterator begin() const { in begin()
55 SmallVectorImpl<ConstantRange>::const_iterator end() const { in end()
[all …]
H A DAttributes.h41 class ConstantRange; variable
146 const ConstantRange &CR);
148 ArrayRef<ConstantRange> Val);
261 LLVM_ABI const ConstantRange &getValueAsConstantRange() const;
265 LLVM_ABI ArrayRef<ConstantRange> getValueAsConstantRangeList() const;
310 LLVM_ABI const ConstantRange &getRange() const;
313 LLVM_ABI ArrayRef<ConstantRange> getInitializes() const;
803 addRangeRetAttr(LLVMContext &C, const ConstantRange &CR) const;
968 LLVM_ABI std::optional<ConstantRange> getParamRange(unsigned ArgNo) const;
1149 LLVM_ABI std::optional<ConstantRange> getRange() const;
[all …]
H A DConstant.h23 class ConstantRange; variable
161 LLVM_ABI ConstantRange toConstantRange() const;
H A DArgument.h24 class ConstantRange; variable
76 LLVM_ABI std::optional<ConstantRange> getRange() const;
/freebsd/contrib/llvm-project/llvm/lib/IR/
H A DConstantRange.cpp45 ConstantRange::ConstantRange(uint32_t BitWidth, bool Full) in ConstantRange() function in ConstantRange
49 ConstantRange::ConstantRange(APInt V) in ConstantRange() function in ConstantRange
52 ConstantRange::ConstantRange(APInt L, APInt U) in ConstantRange() function in ConstantRange
60 ConstantRange ConstantRange::fromKnownBits(const KnownBits &Known, in fromKnownBits()
70 return ConstantRange(Known.getMinValue(), Known.getMaxValue() + 1); in fromKnownBits()
77 return ConstantRange(Lower, Upper + 1); in fromKnownBits()
80 KnownBits ConstantRange::toKnownBits() const { in toKnownBits()
98 std::pair<ConstantRange, ConstantRange> ConstantRange::splitPosNeg() const { in splitPosNeg()
103 ConstantRange PosFilter = in splitPosNeg()
104 BW == 1 ? getEmpty() : ConstantRange(One, SignedMin); in splitPosNeg()
[all …]
H A DConstantRangeList.cpp14 bool ConstantRangeList::isOrderedRanges(ArrayRef<ConstantRange> RangesRef) { in isOrderedRanges()
31 ConstantRangeList::getConstantRangeList(ArrayRef<ConstantRange> RangesRef) { in getConstantRangeList()
37 void ConstantRangeList::insert(const ConstantRange &NewRange) { in insert()
56 Ranges, NewRange, [](const ConstantRange &a, const ConstantRange &b) { in insert()
63 SmallVector<ConstantRange, 2> ExistingTail(LowerBound, Ranges.end()); in insert()
70 Ranges.back() = ConstantRange(NewLower, NewUpper); in insert()
81 Ranges.back() = ConstantRange(NewLower, NewUpper); in insert()
86 void ConstantRangeList::subtract(const ConstantRange &SubRange) { in subtract()
98 SmallVector<ConstantRange, 2> Result; in subtract()
101 Result.push_back(ConstantRange(Start, End)); in subtract()
[all …]
H A DAttributeImpl.h85 const ConstantRange &getValueAsConstantRange() const;
87 ArrayRef<ConstantRange> getValueAsConstantRangeList() const;
134 const ConstantRange &CR) { in Profile()
141 ArrayRef<ConstantRange> Val) { in Profile()
235 ConstantRange CR;
238 ConstantRangeAttributeImpl(Attribute::AttrKind Kind, const ConstantRange &CR) in ConstantRangeAttributeImpl()
241 const ConstantRange &getConstantRangeValue() const { return CR; } in getConstantRangeValue()
246 private TrailingObjects<ConstantRangeListAttributeImpl, ConstantRange> {
253 ArrayRef<ConstantRange> Val) in ConstantRangeListAttributeImpl()
260 for (ConstantRange &CR : getTrailingObjects(Size)) in ~ConstantRangeListAttributeImpl()
[all …]
H A DConstantsContext.h199 std::optional<ConstantRange> InRange;
203 std::optional<ConstantRange> InRange,
209 Type *DestTy, unsigned Flags, std::optional<ConstantRange> InRange) { in Create()
220 std::optional<ConstantRange> getInRange() const;
394 std::optional<ConstantRange> InRange;
408 static std::optional<ConstantRange>
420 std::optional<ConstantRange> InRange = std::nullopt)
445 static bool rangesEqual(const std::optional<ConstantRange> &A,
446 const std::optional<ConstantRange> &B) {
H A DAttributes.cpp172 const ConstantRange &CR) { in get()
198 ArrayRef<ConstantRange> Val) { in get()
414 const ConstantRange &Attribute::getValueAsConstantRange() const { in getValueAsConstantRange()
420 ArrayRef<ConstantRange> Attribute::getValueAsConstantRangeList() const { in getValueAsConstantRangeList()
510 const ConstantRange &Attribute::getRange() const { in getRange()
516 ArrayRef<ConstantRange> Attribute::getInitializes() const { in getInitializes()
684 const ConstantRange &CR = getValueAsConstantRange(); in getAsString()
866 const ConstantRange &AttributeImpl::getValueAsConstantRange() const { in getValueAsConstantRange()
872 ArrayRef<ConstantRange> AttributeImpl::getValueAsConstantRangeList() const { in getValueAsConstantRangeList()
1086 ConstantRange Range0 = Attr0.getRange(); in intersectWith()
[all …]
/freebsd/contrib/llvm-project/llvm/include/llvm/Analysis/
H A DValueLattice.h88 ConstantRange Range;
102 Range.~ConstantRange(); in destroy()
155 new (&Range) ConstantRange(Other.Range); in ValueLatticeElement()
174 new (&Range) ConstantRange(std::move(Other.Range)); in ValueLatticeElement()
212 static ValueLatticeElement getRange(ConstantRange CR,
267 const ConstantRange &getConstantRange(bool UndefAllowed = true) const {
282 ConstantRange asConstantRange(unsigned BW, bool UndefAllowed = false) const {
288 return ConstantRange::getEmpty(BW);
289 return ConstantRange::getFull(BW);
292 ConstantRange asConstantRange(Type *Ty, bool UndefAllowed = false) const {
[all …]
H A DLazyValueInfo.h92 ConstantRange getConstantRange(Value *V, Instruction *CxtI,
97 ConstantRange getConstantRangeAtUse(const Use &U, bool UndefAllowed);
107 ConstantRange getConstantRangeOnEdge(Value *V, BasicBlock *FromBB,
H A DScalarEvolution.h1013 ConstantRange getUnsignedRange(const SCEV *S) {
1029 ConstantRange getSignedRange(const SCEV *S) {
1751 DenseMap<const SCEV *, ConstantRange> UnsignedRanges;
1754 DenseMap<const SCEV *, ConstantRange> SignedRanges;
1760 const ConstantRange &setRange(const SCEV *S, RangeSignHint Hint,
1761 ConstantRange CR) {
1762 DenseMap<const SCEV *, ConstantRange> &Cache =
1772 LLVM_ABI const ConstantRange &getRangeRef(const SCEV *S, RangeSignHint Hint,
1777 const ConstantRange &getRangeRefIter(const SCEV *S, RangeSignHint Hint);
1781 ConstantRange getRangeForAffineAR(const SCEV *Start, const SCEV *Step,
[all …]
/freebsd/contrib/llvm-project/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;
/freebsd/contrib/llvm-project/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.cpp362 std::optional<ConstantRange> getRangeFor(Value *V, Instruction *CxtI,
366 std::function<ConstantRange(const ConstantRange &, const ConstantRange &)>
547 if (std::optional<ConstantRange> Range = cast<CallBase>(BBI)->getRange()) in getFromRangeMetadata()
680 if (std::optional<ConstantRange> Range = cast<Argument>(Val)->getRange()) in solveBlockValueNonLocal()
820 const ConstantRange &TrueCR = TrueVal.asConstantRange(SI->getType()); in solveBlockValueSelect()
821 const ConstantRange &FalseCR = FalseVal.asConstantRange(SI->getType()); in solveBlockValueSelect()
830 ConstantRange ResultCR = [&]() { in solveBlockValueSelect()
859 ConstantRange Zero(APInt::getZero(TrueCR.getBitWidth())); in solveBlockValueSelect()
891 std::optional<ConstantRange>
919 std::optional<ConstantRange> LHSRes = getRangeFor(CI->getOperand(0), CI, BB); in solveBlockValueCast()
[all …]
H A DValueTracking.cpp442 ConstantRange Range(Lower->getValue(), Upper->getValue()); in computeKnownBitsFromRangeMetadata()
573 ConstantRange TrueValues = ConstantRange::makeExactICmpRegion(Pred, *C); in cmpExcludesZero()
583 ConstantRange TrueValues = ConstantRange::makeExactICmpRegion( in cmpExcludesZero()
754 ConstantRange LHSRange = ConstantRange::makeAllowedICmpRegion(Pred, *C); in computeKnownBitsFromCmp()
1088 ConstantRange llvm::getVScaleRange(const Function *F, unsigned BitWidth) { in getVScaleRange()
1092 return ConstantRange(APInt(BitWidth, 1), APInt::getZero(BitWidth)); in getVScaleRange()
1097 return ConstantRange::getEmpty(BitWidth); in getVScaleRange()
1102 return ConstantRange(Min, APInt::getZero(BitWidth)); in getVScaleRange()
1104 return ConstantRange(Min, APInt(BitWidth, *AttrMax) + 1); in getVScaleRange()
1196 ConstantRange::getNonEmpty(*CLow, *CHigh + 1).toKnownBits()); in unionWithMinMaxIntrinsicClamp()
[all …]
H A DBasicAliasAnalysis.cpp346 ConstantRange evaluateWith(ConstantRange N) const { in evaluateWith()
352 ConstantRange(APInt::getZero(N.getBitWidth()), in evaluateWith()
1206 ConstantRange CR = getVScaleRange(&F, Off.getBitWidth()); in aliasGEP()
1232 ConstantRange CR = getVScaleRange(&F, Scale.getBitWidth()); in aliasGEP()
1272 ConstantRange OffsetRange = ConstantRange(DecompGEP1.Offset); in aliasGEP()
1286 ConstantRange CR = computeConstantRange(Index.Val.V, /* ForSigned */ false, in aliasGEP()
1290 ConstantRange::fromKnownBits(Known, /* Signed */ true), in aliasGEP()
1291 ConstantRange::Signed); in aliasGEP()
1297 CR = CR.smul_sat(ConstantRange(Scale)); in aliasGEP()
1299 CR = CR.smul_fast(ConstantRange(Scale)); in aliasGEP()
[all …]
H A DHashRecognize.cpp196 auto LCR = ConstantRange::fromKnownBits(KnownL, false); in computeInstr()
197 auto CheckLCR = ConstantRange(APInt::getZero(ICmpBW), APInt(ICmpBW, 2)); in computeInstr()
207 auto RCR = ConstantRange::fromKnownBits(KnownR, false); in computeInstr()
208 auto AllowedR = ConstantRange::makeAllowedICmpRegion(Pred, RCR); in computeInstr()
209 ConstantRange CheckRCR(APInt::getZero(ICmpBW), in computeInstr()
H A DScalarEvolution.cpp1610 ConstantRange CR = getUnsignedRange(X); in getZeroExtendExprImpl()
1950 ConstantRange CR = getSignedRange(X); in getSignExtendExprImpl()
2474 auto NSWRegion = ConstantRange::makeGuaranteedNoWrapRegion( in StrengthenNoWrapFlags()
2482 auto NUWRegion = ConstantRange::makeGuaranteedNoWrapRegion( in StrengthenNoWrapFlags()
3255 ConstantRange NSWRegion = ConstantRange::makeGuaranteedNoWrapRegion( in getMulExpr()
5061 ConstantRange StepCR = getSignedRange(AR->getStepRecurrence(*this)); in proveNoWrapViaConstantRanges()
5071 ConstantRange AddRecRange = getSignedRange(AR); in proveNoWrapViaConstantRanges()
5072 ConstantRange IncRange = getSignedRange(AR->getStepRecurrence(*this)); in proveNoWrapViaConstantRanges()
5074 auto NSWRegion = ConstantRange::makeGuaranteedNoWrapRegion( in proveNoWrapViaConstantRanges()
5081 ConstantRange AddRecRange = getUnsignedRange(AR); in proveNoWrapViaConstantRanges()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Scalar/
H A DCorrelatedValuePropagation.cpp296 ConstantRange CR1 = LVI->getConstantRangeAtUse(Cmp->getOperandUse(0), in processICmp()
303 ConstantRange::getEquivalentPredWithFlippedSignedness( in processICmp()
314 if (ConstantRange::areInsensitiveToSignednessOfICmpPredicate(CR1, CR2)) { in processICmp()
373 ConstantRange CR = in processSwitch()
460 ConstantRange LRange = in willNotOverflow()
462 ConstantRange RRange = in willNotOverflow()
464 ConstantRange NWRegion = ConstantRange::makeGuaranteedNoWrapRegion( in willNotOverflow()
525 ConstantRange Range = LVI->getConstantRangeAtUse( in processAbsIntrinsic()
564 ConstantRange LHS_CR = in processCmpIntrinsic()
566 ConstantRange RHS_CR = in processCmpIntrinsic()
[all …]
H A DFloat2Int.cpp116 void Float2IntPass::seen(Instruction *I, ConstantRange R) { in seen()
122 ConstantRange Float2IntPass::badRange() { in badRange()
123 return ConstantRange::getFull(MaxIntegerBW + 1); in badRange()
125 ConstantRange Float2IntPass::unknownRange() { in unknownRange()
126 return ConstantRange::getEmpty(MaxIntegerBW + 1); in unknownRange()
128 ConstantRange Float2IntPass::validateRange(ConstantRange R) { in validateRange()
170 auto Input = ConstantRange::getFull(BW); in walkBackwards()
203 std::optional<ConstantRange> Float2IntPass::calcRange(Instruction *I) { in calcRange()
204 SmallVector<ConstantRange, 4> OpRanges; in calcRange()
243 OpRanges.push_back(ConstantRange(Int)); in calcRange()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Utils/
H A DSCCPSolver.cpp91 static ConstantRange getRange(Value *Op, SCCPSolver &Solver, in getRange()
97 return ConstantRange::getFull(Bitwidth); in getRange()
119 auto NUWRange = ConstantRange::makeGuaranteedNoWrapRegion( in refineInstruction()
128 auto NSWRange = ConstantRange::makeGuaranteedNoWrapRegion( in refineInstruction()
248 ConstantRange LRange = GetRange(Inst.getOperand(0)); in simplifyInstruction()
392 ConstantRange CR = Val.getConstantRange(); in inferAttribute()
534 const ConstantRange &CR);
884 if (std::optional<ConstantRange> Range = A->getRange()) in getArgAttributeVL()
1012 const ConstantRange &CR) { in markConstantRange()
1210 const ConstantRange &Range = SCValue.getConstantRange(); in getFeasibleSuccessors()
[all …]
/freebsd/contrib/llvm-project/llvm/include/llvm/Transforms/Utils/
H A DFunctionComparator.h322 LLVM_ABI int cmpConstantRanges(const ConstantRange &L,
323 const ConstantRange &R) const;
/freebsd/contrib/llvm-project/llvm/lib/Transforms/IPO/
H A DGlobalSplit.cpp71 std::optional<ConstantRange> InRange = GEP->getInRange(); in splitGlobal()
80 ConstantRange SrcInRange = InRange->sextOrTrunc(IndexWidth).add(Offset); in splitGlobal()

1234