Home
last modified time | relevance | path

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

123

/llvm-project-15.0.7/llvm/include/llvm/IR/
H A DConstantRange.h324 ConstantRange intersectWith(const ConstantRange &CR,
332 ConstantRange unionWith(const ConstantRange &CR,
394 ConstantRange add(const ConstantRange &Other) const;
406 ConstantRange sub(const ConstantRange &Other) const;
428 ConstantRange smax(const ConstantRange &Other) const;
432 ConstantRange umax(const ConstantRange &Other) const;
436 ConstantRange smin(const ConstantRange &Other) const;
440 ConstantRange umin(const ConstantRange &Other) const;
445 ConstantRange udiv(const ConstantRange &Other) const;
452 ConstantRange sdiv(const ConstantRange &Other) const;
[all …]
H A DGlobalValue.h35 class ConstantRange; variable
626 Optional<ConstantRange> getAbsoluteSymbolRange() const;
/llvm-project-15.0.7/llvm/unittests/IR/
H A DConstantRangeTest.cpp541 [=](const ConstantRange &CR1, const ConstantRange &CR2) { in testBinarySetOperationExhaustive()
568 [](const ConstantRange &CR1, const ConstantRange &CR2, in TEST_F()
572 [](const ConstantRange &CR1, const ConstantRange &CR2) { in TEST_F()
582 [](const ConstantRange &CR1, const ConstantRange &CR2, in TEST_F()
586 [](const ConstantRange &CR1, const ConstantRange &CR2) { in TEST_F()
715 [](const ConstantRange &CR1, const ConstantRange &CR2) { in TEST_F()
773 [](const ConstantRange &CR1, const ConstantRange &CR2) { in TEST_F()
827 [](const ConstantRange &CR1, const ConstantRange &CR2) { in TEST_F()
1012 [](const ConstantRange &, const ConstantRange &) { in TEST_F() argument
1160 ConstantRange OneBit = ConstantRange::getFull(1); in TEST_F()
[all …]
/llvm-project-15.0.7/llvm/lib/IR/
H A DConstantRange.cpp47 ConstantRange::ConstantRange(APInt V) in ConstantRange() function in ConstantRange
50 ConstantRange::ConstantRange(APInt L, APInt U) in ConstantRange() function in ConstantRange
499 ConstantRange ConstantRange::difference(const ConstantRange &CR) const { in difference()
523 ConstantRange ConstantRange::intersectWith(const ConstantRange &CR, in intersectWith()
629 ConstantRange ConstantRange::unionWith(const ConstantRange &CR, in unionWith()
1008 ConstantRange ConstantRange::addWithNoWrap(const ConstantRange &Other, in addWithNoWrap()
1055 ConstantRange ConstantRange::subWithNoWrap(const ConstantRange &Other, in subWithNoWrap()
1235 ConstantRange ConstantRange::sdiv(const ConstantRange &RHS) const { in sdiv()
1323 ConstantRange ConstantRange::urem(const ConstantRange &RHS) const { in urem()
1345 ConstantRange ConstantRange::srem(const ConstantRange &RHS) const { in srem()
[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()
/llvm-project-15.0.7/llvm/include/llvm/Transforms/Scalar/
H A DFloat2Int.h41 void seen(Instruction *I, ConstantRange R);
42 ConstantRange badRange();
43 ConstantRange unknownRange();
44 ConstantRange validateRange(ConstantRange R);
45 Optional<ConstantRange> calcRange(Instruction *I);
52 MapVector<Instruction *, ConstantRange> SeenInsts;
/llvm-project-15.0.7/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()
84 ConstantRange Result = L.add(R); in addOverflowNever()
89 ConstantRange unionNoWrap(const ConstantRange &L, const ConstantRange &R) { in unionNoWrap()
120 ConstantRange Range;
159 ConstantRange R = ConstantRange::getEmpty(PointerSize); in getStaticAllocaSizeRange()
244 const ConstantRange UnknownRange;
288 ConstantRange
558 const ConstantRange UnknownRange;
592 const ConstantRange &Offsets) const { in getArgumentAccessRange()
[all …]
H A DLazyValueInfo.cpp123 ConstantRange Range = in intersect()
417 std::function<ConstantRange(const ConstantRange &,
820 const ConstantRange &TrueCR = in solveBlockValueSelect()
937 std::function<ConstantRange(const ConstantRange &, in solveBlockValueBinaryOpImpl() argument
967 [BO, NoWrapKind](const ConstantRange &CR1, const ConstantRange &CR2) { in solveBlockValueBinaryOp()
973 BO, BB, [BO](const ConstantRange &CR1, const ConstantRange &CR2) { in solveBlockValueBinaryOp()
982 WO, BB, [WO](const ConstantRange &CR1, const ConstantRange &CR2) { in solveBlockValueOverflowIntrinsic()
1069 ConstantRange TrueValues = in getValueFromSimpleICmpCondition()
1133 ConstantRange CR = ConstantRange::makeExactICmpRegion(EdgePred, *C); in getValueFromICmpCondition()
1154 ConstantRange NWR = ConstantRange::makeExactNoWrapRegion( in getValueFromOverflowCondition()
[all …]
H A DBasicAliasAnalysis.cpp296 ConstantRange evaluateWith(ConstantRange N) const { in evaluateWith()
1215 ConstantRange OffsetRange = ConstantRange(DecompGEP1.Offset); in aliasGEP()
1229 ConstantRange CR = computeConstantRange(Index.Val.V, /* ForSigned */ false, in aliasGEP()
1234 ConstantRange::fromKnownBits(Known, /* Signed */ true), in aliasGEP()
1235 ConstantRange::Signed); in aliasGEP()
1241 OffsetRange = OffsetRange.add(CR.smul_sat(ConstantRange(Scale))); in aliasGEP()
1243 OffsetRange = OffsetRange.add(CR.smul_fast(ConstantRange(Scale))); in aliasGEP()
1262 ConstantRange Range1 = OffsetRange.add( in aliasGEP()
1263 ConstantRange(APInt(BW, 0), APInt(BW, V1Size.getValue()))); in aliasGEP()
1264 ConstantRange Range2 = in aliasGEP()
[all …]
H A DScalarEvolution.cpp6275 ConstantRange ScalarEvolution::
6397 const ConstantRange &
6405 ? ConstantRange::Unsigned : ConstantRange::Signed; in getRangeRef()
6753 ConstantRange SR = in getRangeForAffineAR()
6944 ConstantRange TrueRange = in getRangeViaFactoring()
6946 ConstantRange FalseRange = in getRangeViaFactoring()
8743 ConstantRange NWR = in computeExitLimitFromCondImpl()
8894 ConstantRange CompRange = in computeExitLimitFromICmp()
10370 ConstantRange ExactCR = ConstantRange::makeExactICmpRegion(Pred, RA); in SimplifyICmpOperands()
12264 ConstantRange FoundLHSRange = in isImpliedCondOperandsViaRanges()
[all …]
H A DValueTracking.cpp628 ConstantRange TrueValues = ConstantRange::makeExactICmpRegion(Pred, *C); in cmpExcludesZero()
4837 ConstantRange CR1 = ConstantRange::fromKnownBits(Known, ForSigned); in computeConstantRangeIncludingKnownBits()
4839 ConstantRange::PreferredRangeType RangeType = in computeConstantRangeIncludingKnownBits()
4840 ForSigned ? ConstantRange::Signed : ConstantRange::Unsigned; in computeConstantRangeIncludingKnownBits()
4852 ConstantRange LHSRange = ConstantRange::fromKnownBits(LHSKnown, false); in computeOverflowForUnsignedMul()
4853 ConstantRange RHSRange = ConstantRange::fromKnownBits(RHSKnown, false); in computeOverflowForUnsignedMul()
6672 ConstantRange DomCR = ConstantRange::makeExactICmpRegion(APred, C1); in isImpliedCondMatchingImmOperands()
6673 ConstantRange CR = ConstantRange::makeExactICmpRegion(BPred, C2); in isImpliedCondMatchingImmOperands()
7232 return ConstantRange(*C); in computeConstantRange()
7247 ConstantRange CR = ConstantRange::getNonEmpty(Lower, Upper); in computeConstantRange()
[all …]
/llvm-project-15.0.7/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,
106 ConstantRange getConstantRangeOnEdge(Value *V, BasicBlock *FromBB,
H A DScalarEvolution.h948 ConstantRange getUnsignedRange(const SCEV *S) {
964 ConstantRange getSignedRange(const SCEV *S) {
1530 DenseMap<const SCEV *, ConstantRange> UnsignedRanges;
1533 DenseMap<const SCEV *, ConstantRange> SignedRanges;
1539 const ConstantRange &setRange(const SCEV *S, RangeSignHint Hint,
1540 ConstantRange CR) {
1541 DenseMap<const SCEV *, ConstantRange> &Cache =
1553 const ConstantRange &getRangeRef(const SCEV *S, RangeSignHint Hint);
1557 ConstantRange getRangeForAffineAR(const SCEV *Start, const SCEV *Step,
1570 ConstantRange getRangeViaFactoring(const SCEV *Start, const SCEV *Step,
[all …]
/llvm-project-15.0.7/llvm/lib/Transforms/Scalar/
H A DFloat2Int.cpp158 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()
240 SmallVector<ConstantRange, 4> OpRanges; in calcRange()
279 OpRanges.push_back(ConstantRange(Int)); in calcRange()
295 auto Zero = ConstantRange(APInt::getZero(Size)); in calcRange()
338 if (Optional<ConstantRange> Range = calcRange(I)) in walkForwards()
[all …]
H A DCorrelatedValuePropagation.cpp324 ConstantRange::getEquivalentPredWithFlippedSignedness( in processICmp()
442 ConstantRange LRange = LVI->getConstantRange(BO->getLHS(), BO); in willNotOverflow()
444 ConstantRange NWRegion = ConstantRange::makeGuaranteedNoWrapRegion( in willNotOverflow()
734 std::array<Optional<ConstantRange>, 2> CRs; in narrowSDivOrSRem()
788 ConstantRange CR = LVI->getConstantRange(Operand, Instr); in processUDivOrURem()
948 ConstantRange NegOneOrZero = in processAShr()
1007 ConstantRange LRange = LVI->getConstantRange(LHS, BinOp); in processBinOp()
1008 ConstantRange RRange = LVI->getConstantRange(RHS, BinOp); in processBinOp()
1013 ConstantRange NUWRange = ConstantRange::makeGuaranteedNoWrapRegion( in processBinOp()
1019 ConstantRange NSWRange = ConstantRange::makeGuaranteedNoWrapRegion( in processBinOp()
[all …]
H A DGuardWidening.cpp517 ConstantRange CR0 = in widenCondCommon()
518 ConstantRange::makeExactICmpRegion(Pred0, RHS0->getValue()); in widenCondCommon()
519 ConstantRange CR1 = in widenCondCommon()
520 ConstantRange::makeExactICmpRegion(Pred1, RHS1->getValue()); in widenCondCommon()
525 if (Optional<ConstantRange> Intersect = CR0.exactIntersectWith(CR1)) { in widenCondCommon()
/llvm-project-15.0.7/llvm/lib/Transforms/Utils/
H A DSCCPSolver.cpp641 const ConstantRange &Range = SCValue.getConstantRange(); in getFeasibleSuccessors()
825 ConstantRange OpRange = in visitCastInst()
828 : ConstantRange::getFull( in visitCastInst()
842 ConstantRange Res = in visitCastInst()
1008 ConstantRange A = ConstantRange::getFull(I.getType()->getScalarSizeInBits()); in visitBinaryOperator()
1009 ConstantRange B = ConstantRange::getFull(I.getType()->getScalarSizeInBits()); in visitBinaryOperator()
1285 ImposedCR = ConstantRange::makeAllowedICmpRegion( in handleCallResult()
1292 : ConstantRange::getFull( in handleCallResult()
1332 SmallVector<ConstantRange, 2> OpRanges; in handleCallResult()
1342 ConstantRange Result = in handleCallResult()
[all …]
H A DLowerSwitch.cpp410 ConstantRange KnownBitsRange = in ProcessSwitchInst()
411 ConstantRange::fromKnownBits(Known, /*IsSigned=*/false); in ProcessSwitchInst()
412 const ConstantRange LVIRange = LVI->getConstantRange(Val, SI); in ProcessSwitchInst()
413 ConstantRange ValRange = KnownBitsRange.intersectWith(LVIRange); in ProcessSwitchInst()
H A DSimplifyIndVar.cpp793 ConstantRange IVRange = SE->getUnsignedRange(SE->getSCEV(IVOperand)); in strengthenRightShift()
1042 DenseMap<DefUserPair, ConstantRange> PostIncRangeInfos;
1044 Optional<ConstantRange> getPostIncRangeInfo(Value *Def, in getPostIncRangeInfo()
1049 ? Optional<ConstantRange>(None) in getPostIncRangeInfo()
1050 : Optional<ConstantRange>(It->second); in getPostIncRangeInfo()
1056 void updatePostIncRangeInfo(Value *Def, Instruction *UseI, ConstantRange R) { in updatePostIncRangeInfo()
2008 ConstantRange::makeAllowedICmpRegion(P, CmpRHSRange); in calculatePostIncRange()
/llvm-project-15.0.7/llvm/unittests/Analysis/
H A DValueTrackingTest.cpp2079 ConstantRange CR1 = computeConstantRange(Stride, false, true, &AC, nullptr); in TEST_F()
2083 ConstantRange CR2 = computeConstantRange(Stride, false, true, &AC, I); in TEST_F()
2113 ConstantRange CR = computeConstantRange(Stride, false, true, &AC, I); in TEST_F()
2151 ConstantRange CR = computeConstantRange(Stride, false, true, &AC, GT2); in TEST_F()
2156 ConstantRange CR2 = computeConstantRange(Stride, false, true, &AC, I); in TEST_F()
2184 ConstantRange CR = computeConstantRange(Stride, false, true, &AC, I); in TEST_F()
2212 ConstantRange CR1 = computeConstantRange(X1, false, true, &AC, I); in TEST_F()
2213 ConstantRange CR2 = computeConstantRange(X2, false, true, &AC, I); in TEST_F()
2223 ConstantRange CR3 = computeConstantRange(X2, false, true, &AC, I, nullptr, 6); in TEST_F()
2244 ConstantRange CR1 = computeConstantRange(X2, false, true, &AC, I); in TEST_F()
/llvm-project-15.0.7/llvm/lib/CodeGen/
H A DSafeStack.cpp232 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()
/llvm-project-15.0.7/llvm/include/llvm/Transforms/IPO/
H A DAttributor.h2577 ConstantRange Assumed;
2580 ConstantRange Known;
2584 Known(ConstantRange::getFull(BitWidth)) {}
2586 IntegerRangeState(const ConstantRange &CR)
2592 return ConstantRange::getFull(BitWidth);
2597 return ConstantRange::getEmpty(BitWidth);
2627 ConstantRange getKnown() const { return Known; }
2633 void unionAssumed(const ConstantRange &R) {
2644 void intersectKnown(const ConstantRange &R) {
4302 virtual ConstantRange
[all …]
/llvm-project-15.0.7/llvm/utils/gn/secondary/llvm/lib/IR/
H A DBUILD.gn26 "ConstantRange.cpp",

123