/freebsd/contrib/llvm-project/llvm/include/llvm/IR/ |
H A D | ConstantRange.h | 47 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 D | ConstantRangeList.h | 31 SmallVector<ConstantRange, 2> Ranges; 35 ConstantRangeList(ArrayRef<ConstantRange> RangesRef) { in ConstantRangeList() 37 for (const ConstantRange &R : RangesRef) { in ConstantRangeList() 44 static bool isOrderedRanges(ArrayRef<ConstantRange> RangesRef); 46 getConstantRangeList(ArrayRef<ConstantRange> RangesRef); 48 ArrayRef<ConstantRange> rangesRef() const { return Ranges; } in rangesRef() 49 SmallVectorImpl<ConstantRange>::iterator begin() { return Ranges.begin(); } in begin() 50 SmallVectorImpl<ConstantRange>::iterator end() { return Ranges.end(); } in end() 51 SmallVectorImpl<ConstantRange>::const_iterator begin() const { in begin() 54 SmallVectorImpl<ConstantRange>::const_iterator end() const { in end() [all …]
|
H A D | Attributes.h | 40 class ConstantRange; variable 138 const ConstantRange &CR); 140 ArrayRef<ConstantRange> Val); 237 const ConstantRange &getValueAsConstantRange() const; 241 ArrayRef<ConstantRange> getValueAsConstantRangeList() const; 282 const ConstantRange &getRange() const; 285 ArrayRef<ConstantRange> getInitializes() const; 770 const ConstantRange &CR) const; 1237 const ConstantRange &CR); 1240 AttrBuilder &addRangeAttr(const ConstantRange &CR); [all …]
|
H A D | Argument.h | 23 class ConstantRange; variable 75 std::optional<ConstantRange> getRange() const;
|
H A D | Constant.h | 22 class ConstantRange; variable 160 ConstantRange toConstantRange() const;
|
/freebsd/contrib/llvm-project/llvm/lib/IR/ |
H A D | ConstantRange.cpp | 44 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 D | ConstantRangeList.cpp | 14 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() 54 Ranges, NewRange, [](const ConstantRange &a, const ConstantRange &b) { in insert() 61 SmallVector<ConstantRange, 2> ExistingTail(LowerBound, Ranges.end()); in insert() 68 Ranges.back() = ConstantRange(NewLower, NewUpper); in insert() 79 Ranges.back() = ConstantRange(NewLower, NewUpper); in insert() 84 void ConstantRangeList::subtract(const ConstantRange &SubRange) { in subtract() 96 SmallVector<ConstantRange, 2> Result; in subtract() 99 Result.push_back(ConstantRange(Start, End)); in subtract() [all …]
|
H A D | AttributeImpl.h | 85 const ConstantRange &getValueAsConstantRange() const; 87 ArrayRef<ConstantRange> getValueAsConstantRangeList() const; 131 const ConstantRange &CR) { in Profile() 138 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> { 250 size_t numTrailingObjects(OverloadToken<ConstantRange>) const { return Size; } in numTrailingObjects() argument 254 ArrayRef<ConstantRange> Val) in ConstantRangeListAttributeImpl() [all …]
|
H A D | ConstantsContext.h | 190 std::optional<ConstantRange> InRange; 194 std::optional<ConstantRange> InRange); 199 Type *DestTy, unsigned Flags, std::optional<ConstantRange> InRange) { in Create() 209 std::optional<ConstantRange> getInRange() const; 383 std::optional<ConstantRange> InRange; 397 static std::optional<ConstantRange> 409 std::optional<ConstantRange> InRange = std::nullopt) 434 static bool rangesEqual(const std::optional<ConstantRange> &A, 435 const std::optional<ConstantRange> &B) {
|
H A D | Attributes.cpp | 171 const ConstantRange &CR) { in get() 196 ArrayRef<ConstantRange> Val) { in get() 405 const ConstantRange &Attribute::getValueAsConstantRange() const { in getValueAsConstantRange() 411 ArrayRef<ConstantRange> Attribute::getValueAsConstantRangeList() const { in getValueAsConstantRangeList() 495 const ConstantRange &Attribute::getRange() const { in getRange() 501 ArrayRef<ConstantRange> Attribute::getInitializes() const { in getInitializes() 659 const ConstantRange &CR = getValueAsConstantRange(); in getAsString() 798 const ConstantRange &AttributeImpl::getValueAsConstantRange() const { in getValueAsConstantRange() 804 ArrayRef<ConstantRange> AttributeImpl::getValueAsConstantRangeList() const { in getValueAsConstantRangeList() 1602 const ConstantRange &CR) const { in addRangeRetAttr() [all …]
|
/freebsd/contrib/llvm-project/llvm/include/llvm/Analysis/ |
H A D | ValueLattice.h | 90 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() 214 static ValueLatticeElement getRange(ConstantRange CR, 269 const ConstantRange &getConstantRange(bool UndefAllowed = true) const { 284 ConstantRange asConstantRange(unsigned BW, bool UndefAllowed = false) const { 290 return ConstantRange::getEmpty(BW); 291 return ConstantRange::getFull(BW); 294 ConstantRange asConstantRange(Type *Ty, bool UndefAllowed = false) const { [all …]
|
H A D | LazyValueInfo.h | 25 class ConstantRange; variable 94 ConstantRange getConstantRange(Value *V, Instruction *CxtI, 99 ConstantRange getConstantRangeAtUse(const Use &U, bool UndefAllowed); 109 ConstantRange getConstantRangeOnEdge(Value *V, BasicBlock *FromBB,
|
H A D | ScalarEvolution.h | 986 ConstantRange getUnsignedRange(const SCEV *S) { 1002 ConstantRange getSignedRange(const SCEV *S) { 1664 DenseMap<const SCEV *, ConstantRange> UnsignedRanges; 1667 DenseMap<const SCEV *, ConstantRange> SignedRanges; 1673 const ConstantRange &setRange(const SCEV *S, RangeSignHint Hint, 1674 ConstantRange CR) { 1675 DenseMap<const SCEV *, ConstantRange> &Cache = 1685 const ConstantRange &getRangeRef(const SCEV *S, RangeSignHint Hint, 1690 const ConstantRange &getRangeRefIter(const SCEV *S, RangeSignHint Hint); 1694 ConstantRange getRangeForAffineAR(const SCEV *Start, const SCEV *Step, [all …]
|
/freebsd/contrib/llvm-project/llvm/include/llvm/Transforms/Scalar/ |
H A D | Float2Int.h | 40 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 D | StackSafetyAnalysis.cpp | 19 #include "llvm/IR/ConstantRange.h" 74 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 [all...] |
H A D | LazyValueInfo.cpp | 127 ConstantRange Range = in intersect() 416 std::optional<ConstantRange> getRangeFor(Value *V, Instruction *CxtI, 420 std::function<ConstantRange(const ConstantRange &, const ConstantRange &)> 599 if (std::optional<ConstantRange> Range = cast<CallBase>(BBI)->getRange()) in getFromRangeMetadata() 723 if (std::optional<ConstantRange> Range = cast<Argument>(Val)->getRange()) in solveBlockValueNonLocal() 860 const ConstantRange &TrueCR = TrueVal.asConstantRange(SI->getType()); in solveBlockValueSelect() 861 const ConstantRange &FalseCR = FalseVal.asConstantRange(SI->getType()); in solveBlockValueSelect() 870 ConstantRange ResultCR = [&]() { in solveBlockValueSelect() 899 ConstantRange Zero(APInt::getZero(TrueCR.getBitWidth())); in solveBlockValueSelect() 931 std::optional<ConstantRange> [all …]
|
H A D | ValueTracking.cpp | 437 ConstantRange Range(Lower->getValue(), Upper->getValue()); in computeKnownBitsFromRangeMetadata() 560 ConstantRange TrueValues = ConstantRange::makeExactICmpRegion(Pred, *C); in cmpExcludesZero() 570 ConstantRange TrueValues = ConstantRange::makeExactICmpRegion( in cmpExcludesZero() 710 ConstantRange LHSRange = ConstantRange::makeAllowedICmpRegion(Pred, *C); in computeKnownBitsFromCmp() 1008 ConstantRange llvm::getVScaleRange(const Function *F, unsigned BitWidth) { in getVScaleRange() 1012 return ConstantRange(APInt(BitWidth, 1), APInt::getZero(BitWidth)); in getVScaleRange() 1017 return ConstantRange::getEmpty(BitWidth); in getVScaleRange() 1022 return ConstantRange(Min, APInt::getZero(BitWidth)); in getVScaleRange() 1024 return ConstantRange(Min, APInt(BitWidth, *AttrMax) + 1); in getVScaleRange() 1577 auto CR = ConstantRange::makeExactICmpRegion(Pred, *RHSC); in computeKnownBitsFromOperator() [all …]
|
H A D | BasicAliasAnalysis.cpp | 336 ConstantRange evaluateWith(ConstantRange N) const { in evaluateWith() 1196 ConstantRange CR = getVScaleRange(&F, Off.getBitWidth()); in aliasGEP() 1222 ConstantRange CR = getVScaleRange(&F, Scale.getBitWidth()); in aliasGEP() 1245 ConstantRange OffsetRange = ConstantRange(DecompGEP1.Offset); in aliasGEP() 1259 ConstantRange CR = computeConstantRange(Index.Val.V, /* ForSigned */ false, in aliasGEP() 1264 ConstantRange::fromKnownBits(Known, /* Signed */ true), in aliasGEP() 1265 ConstantRange::Signed); in aliasGEP() 1271 CR = CR.smul_sat(ConstantRange(Scale)); in aliasGEP() 1273 CR = CR.smul_fast(ConstantRange(Scale)); in aliasGEP() 1297 ConstantRange Range1 = OffsetRange.add( in aliasGEP() [all …]
|
H A D | ScalarEvolution.cpp | 1606 ConstantRange CR = getUnsignedRange(X); in getZeroExtendExprImpl() 1947 ConstantRange CR = getSignedRange(X); in getSignExtendExprImpl() 2471 auto NSWRegion = ConstantRange::makeGuaranteedNoWrapRegion( in StrengthenNoWrapFlags() 2479 auto NUWRegion = ConstantRange::makeGuaranteedNoWrapRegion( in StrengthenNoWrapFlags() 3288 ConstantRange NSWRegion = ConstantRange::makeGuaranteedNoWrapRegion( in getMulExpr() 5095 ConstantRange StepCR = getSignedRange(AR->getStepRecurrence(*this)); in proveNoWrapViaConstantRanges() 5105 ConstantRange AddRecRange = getSignedRange(AR); in proveNoWrapViaConstantRanges() 5106 ConstantRange IncRange = getSignedRange(AR->getStepRecurrence(*this)); in proveNoWrapViaConstantRanges() 5108 auto NSWRegion = ConstantRange::makeGuaranteedNoWrapRegion( in proveNoWrapViaConstantRanges() 5115 ConstantRange AddRecRange = getUnsignedRange(AR); in proveNoWrapViaConstantRanges() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Scalar/ |
H A D | CorrelatedValuePropagation.cpp | 296 ConstantRange::getEquivalentPredWithFlippedSignedness( in processICmp() 406 ConstantRange CR = LVI->getConstantRangeAtUse(I->getOperandUse(0), in processSwitch() 438 ConstantRange LRange = in willNotOverflow() 440 ConstantRange RRange = in willNotOverflow() 442 ConstantRange NWRegion = ConstantRange::makeGuaranteedNoWrapRegion( in willNotOverflow() 503 ConstantRange Range = LVI->getConstantRangeAtUse( in processAbsIntrinsic() 542 ConstantRange LHS_CR = in processCmpIntrinsic() 544 ConstantRange RHS_CR = in processCmpIntrinsic() 573 ConstantRange LHS_CR = LVI->getConstantRangeAtUse(MM->getOperandUse(0), in processMinMaxIntrinsic() 575 ConstantRange RHS_CR = LVI->getConstantRangeAtUse(MM->getOperandUse(1), in processMinMaxIntrinsic() [all …]
|
H A D | Float2Int.cpp | 116 void Float2IntPass::seen(Instruction *I, ConstantRange R) { in seen() 126 ConstantRange Float2IntPass::badRange() { in badRange() 127 return ConstantRange::getFull(MaxIntegerBW + 1); in badRange() 129 ConstantRange Float2IntPass::unknownRange() { in unknownRange() 130 return ConstantRange::getEmpty(MaxIntegerBW + 1); in unknownRange() 132 ConstantRange Float2IntPass::validateRange(ConstantRange R) { in validateRange() 174 auto Input = ConstantRange::getFull(BW); in walkBackwards() 207 std::optional<ConstantRange> Float2IntPass::calcRange(Instruction *I) { in calcRange() 208 SmallVector<ConstantRange, 4> OpRanges; in calcRange() 247 OpRanges.push_back(ConstantRange(Int)); in calcRange() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Utils/ |
H A D | SCCPSolver.cpp | 108 return ConstantRange::getFull(Bitwidth); in refineInstruction() 121 auto NUWRange = ConstantRange::makeGuaranteedNoWrapRegion( in refineInstruction() 130 auto NSWRange = ConstantRange::makeGuaranteedNoWrapRegion( in refineInstruction() 453 const ConstantRange &CR); 817 if (std::optional<ConstantRange> Range = A->getRange()) { in trackValueOfArgument() 912 const ConstantRange &CR) { in markConstantRange() 1110 const ConstantRange &Range = SCValue.getConstantRange(); in getFeasibleSuccessors() 1297 ConstantRange OpRange = in visitCastInst() 1301 ConstantRange Res = in visitCastInst() 1320 ConstantRange LR = L.asConstantRange(Ty, /*UndefAllowed=*/false); in handleExtractOfWithOverflow() [all …]
|
H A D | LowerSwitch.cpp | 413 ConstantRange KnownBitsRange = in ProcessSwitchInst() 414 ConstantRange::fromKnownBits(Known, /*IsSigned=*/false); in ProcessSwitchInst() 415 const ConstantRange LVIRange = in ProcessSwitchInst() 417 ConstantRange ValRange = KnownBitsRange.intersectWith(LVIRange); in ProcessSwitchInst()
|
/freebsd/contrib/llvm-project/llvm/lib/Transforms/IPO/ |
H A D | GlobalSplit.cpp | 72 std::optional<ConstantRange> InRange = GEP->getInRange(); in splitGlobal() 81 ConstantRange SrcInRange = InRange->sextOrTrunc(IndexWidth).add(Offset); in splitGlobal()
|
/freebsd/contrib/llvm-project/llvm/lib/CodeGen/ |
H A D | SafeStack.cpp | 232 ConstantRange AccessStartRange = SE.getUnsignedRange(Expr); in IsAccessSafe() 233 ConstantRange SizeRange = in IsAccessSafe() 234 ConstantRange(APInt(BitWidth, 0), APInt(BitWidth, AccessSize)); in IsAccessSafe() 235 ConstantRange AccessRange = AccessStartRange.add(SizeRange); in IsAccessSafe() 236 ConstantRange AllocaRange = in IsAccessSafe() 237 ConstantRange(APInt(BitWidth, 0), APInt(BitWidth, AllocaSize)); in IsAccessSafe()
|