Lines Matching refs:AddRec
1276 if (const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(Op)) { in getTruncateExpr() local
1278 for (const SCEV *Op : AddRec->operands()) in getTruncateExpr()
1280 return getAddRecExpr(Operands, AddRec->getLoop(), SCEV::FlagAnyWrap); in getTruncateExpr()
2822 const SCEVAddRecExpr *AddRec = cast<SCEVAddRecExpr>(Ops[Idx]); in getAddExpr() local
2823 const Loop *AddRecLoop = AddRec->getLoop(); in getAddExpr()
2836 LIOps.push_back(AddRec); in getAddExpr()
2841 LIOps.push_back(AddRec->getStart()); in getAddExpr()
2843 SmallVector<const SCEV *, 4> AddRecOps(AddRec->operands()); in getAddExpr()
2867 Flags = AddRec->getNoWrapFlags(setFlags(Flags, SCEV::FlagNW)); in getAddExpr()
2875 if (Ops[i] == AddRec) { in getAddExpr()
2892 AddRec->getLoop()->getHeader()) && in getAddExpr()
2896 SmallVector<const SCEV *, 4> AddRecOps(AddRec->operands()); in getAddExpr()
3147 } else if (const auto *AddRec = dyn_cast<SCEVAddRecExpr>(Ops[1])) { in getMulExpr() local
3150 for (const SCEV *AddRecOp : AddRec->operands()) in getMulExpr()
3154 return getAddRecExpr(Operands, AddRec->getLoop(), in getMulExpr()
3155 AddRec->getNoWrapFlags(SCEV::FlagNW)); in getMulExpr()
3196 const SCEVAddRecExpr *AddRec = cast<SCEVAddRecExpr>(Ops[Idx]); in getMulExpr() local
3197 const Loop *AddRecLoop = AddRec->getLoop(); in getMulExpr()
3209 NewOps.reserve(AddRec->getNumOperands()); in getMulExpr()
3211 for (unsigned i = 0, e = AddRec->getNumOperands(); i != e; ++i) in getMulExpr()
3212 NewOps.push_back(getMulExpr(Scale, AddRec->getOperand(i), in getMulExpr()
3220 SCEV::NoWrapFlags Flags = ComputeFlags({Scale, AddRec}); in getMulExpr()
3222 NewOps, AddRecLoop, AddRec->getNoWrapFlags(Flags)); in getMulExpr()
3229 if (Ops[i] == AddRec) { in getMulExpr()
3261 if (AddRec->getNumOperands() + OtherAddRec->getNumOperands() - 1 > in getMulExpr()
3262 MaxAddRecSize || hasHugeExpression({AddRec, OtherAddRec})) in getMulExpr()
3266 Type *Ty = AddRec->getType(); in getMulExpr()
3269 for (int x = 0, xe = AddRec->getNumOperands() + in getMulExpr()
3274 for (int z = std::max(y-x, y-(int)AddRec->getNumOperands()+1), in getMulExpr()
3284 const SCEV *Term1 = AddRec->getOperand(y-z); in getMulExpr()
3301 AddRec = dyn_cast<SCEVAddRecExpr>(NewAddRec); in getMulExpr()
3302 if (!AddRec) in getMulExpr()
4486 if (auto *AddRec = dyn_cast<SCEVAddRecExpr>(P)) { in removePointerBase() local
4488 SmallVector<const SCEV *> Ops{AddRec->operands()}; in removePointerBase()
4492 return getAddRecExpr(Ops, AddRec->getLoop(), SCEV::FlagAnyWrap); in removePointerBase()
4687 if (auto *AddRec = dyn_cast<SCEVAddRecExpr>(V)) { in getPointerBase() local
4688 V = AddRec->getStart(); in getPointerBase()
6266 void ScalarEvolution::setNoWrapFlags(SCEVAddRecExpr *AddRec, in setNoWrapFlags() argument
6268 if (AddRec->getNoWrapFlags(Flags) != Flags) { in setNoWrapFlags()
6269 AddRec->setNoWrapFlags(Flags); in setNoWrapFlags()
6270 UnsignedRanges.erase(AddRec); in setNoWrapFlags()
6271 SignedRanges.erase(AddRec); in setNoWrapFlags()
6516 if (const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(S)) { in getRangeRef() local
6519 if (AddRec->hasNoUnsignedWrap()) { in getRangeRef()
6520 APInt UnsignedMinValue = getUnsignedRangeMin(AddRec->getStart()); in getRangeRef()
6531 if (AddRec->hasNoSignedWrap()) { in getRangeRef()
6534 for (unsigned i = 1, e = AddRec->getNumOperands(); i != e; ++i) { in getRangeRef()
6535 if (!isKnownNonNegative(AddRec->getOperand(i))) in getRangeRef()
6537 if (!isKnownNonPositive(AddRec->getOperand(i))) in getRangeRef()
6542 ConstantRange::getNonEmpty(getSignedRangeMin(AddRec->getStart()), in getRangeRef()
6549 getSignedRangeMax(AddRec->getStart()) + 1), in getRangeRef()
6554 if (AddRec->isAffine()) { in getRangeRef()
6555 const SCEV *MaxBECount = getConstantMaxBackedgeTakenCount(AddRec->getLoop()); in getRangeRef()
6559 AddRec->getStart(), AddRec->getStepRecurrence(*this), MaxBECount, in getRangeRef()
6565 AddRec->getStart(), AddRec->getStepRecurrence(*this), MaxBECount, in getRangeRef()
6574 getSymbolicMaxBackedgeTakenCount(AddRec->getLoop()); in getRangeRef()
6577 AddRec->hasNoSelfWrap()) { in getRangeRef()
6579 AddRec, SymbolicMaxBECount, BitWidth, SignHint); in getRangeRef()
6586 return setRange(AddRec, SignHint, std::move(ConservativeResult)); in getRangeRef()
6770 const SCEVAddRecExpr *AddRec, const SCEV *MaxBECount, unsigned BitWidth, in getRangeForAffineNoSelfWrappingAR() argument
6772 assert(AddRec->isAffine() && "Non-affine AddRecs are not suppored!\n"); in getRangeForAffineNoSelfWrappingAR()
6773 assert(AddRec->hasNoSelfWrap() && in getRangeForAffineNoSelfWrappingAR()
6776 const SCEV *Step = AddRec->getStepRecurrence(*this); in getRangeForAffineNoSelfWrappingAR()
6786 getTypeSizeInBits(AddRec->getType())) in getRangeForAffineNoSelfWrappingAR()
6788 MaxBECount = getNoopOrZeroExtend(MaxBECount, AddRec->getType()); in getRangeForAffineNoSelfWrappingAR()
6789 const SCEV *RangeWidth = getMinusOne(AddRec->getType()); in getRangeForAffineNoSelfWrappingAR()
6800 const SCEV *End = AddRec->evaluateAtIteration(MaxBECount, *this); in getRangeForAffineNoSelfWrappingAR()
6814 const SCEV *Start = AddRec->getStart(); in getRangeForAffineNoSelfWrappingAR()
6970 if (auto *AddRec = dyn_cast<SCEVAddRecExpr>(S)) in getNonTrivialDefiningScopeBound() local
6971 return &*AddRec->getLoop()->getHeader()->begin(); in getNonTrivialDefiningScopeBound()
7989 auto *AddRec = dyn_cast<SCEVAddRecExpr>(getSCEV(GEP)); in getConstantMaxTripCountFromArray() local
7990 if (!AddRec) in getConstantMaxTripCountFromArray()
7992 auto *ArrBase = dyn_cast<SCEVUnknown>(getPointerBase(AddRec)); in getConstantMaxTripCountFromArray()
7993 auto *Step = dyn_cast<SCEVConstant>(AddRec->getStepRecurrence(*this)); in getConstantMaxTripCountFromArray()
8000 if (AddRec->getStart() != ArrBase) in getConstantMaxTripCountFromArray()
8891 if (const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(LHS)) in computeExitLimitFromICmp() local
8892 if (AddRec->getLoop() == L) { in computeExitLimitFromICmp()
8897 const SCEV *Ret = AddRec->getNumIterationsInRange(CompRange, *this); in computeExitLimitFromICmp()
9008 EvaluateConstantChrecAtConstant(const SCEVAddRecExpr *AddRec, ConstantInt *C, in EvaluateConstantChrecAtConstant() argument
9011 const SCEV *Val = AddRec->evaluateAtIteration(InVal, SE); in EvaluateConstantChrecAtConstant()
9736 if (const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(V)) { in computeSCEVAtScope() local
9740 for (unsigned i = 0, e = AddRec->getNumOperands(); i != e; ++i) { in computeSCEVAtScope()
9741 const SCEV *OpAtScope = getSCEVAtScope(AddRec->getOperand(i), L); in computeSCEVAtScope()
9742 if (OpAtScope == AddRec->getOperand(i)) in computeSCEVAtScope()
9747 SmallVector<const SCEV *, 8> NewOps(AddRec->op_begin(), in computeSCEVAtScope()
9748 AddRec->op_begin()+i); in computeSCEVAtScope()
9751 NewOps.push_back(getSCEVAtScope(AddRec->getOperand(i), L)); in computeSCEVAtScope()
9754 getAddRecExpr(NewOps, AddRec->getLoop(), in computeSCEVAtScope()
9755 AddRec->getNoWrapFlags(SCEV::FlagNW)); in computeSCEVAtScope()
9756 AddRec = dyn_cast<SCEVAddRecExpr>(FoldedRec); in computeSCEVAtScope()
9760 if (!AddRec) in computeSCEVAtScope()
9767 if (!AddRec->getLoop()->contains(L)) { in computeSCEVAtScope()
9770 const SCEV *BackedgeTakenCount = getBackedgeTakenCount(AddRec->getLoop()); in computeSCEVAtScope()
9771 if (BackedgeTakenCount == getCouldNotCompute()) return AddRec; in computeSCEVAtScope()
9774 return AddRec->evaluateAtIteration(BackedgeTakenCount, *this); in computeSCEVAtScope()
9777 return AddRec; in computeSCEVAtScope()
9859 GetQuadraticEquation(const SCEVAddRecExpr *AddRec) { in GetQuadraticEquation() argument
9860 assert(AddRec->getNumOperands() == 3 && "This is not a quadratic chrec!"); in GetQuadraticEquation()
9861 const SCEVConstant *LC = dyn_cast<SCEVConstant>(AddRec->getOperand(0)); in GetQuadraticEquation()
9862 const SCEVConstant *MC = dyn_cast<SCEVConstant>(AddRec->getOperand(1)); in GetQuadraticEquation()
9863 const SCEVConstant *NC = dyn_cast<SCEVConstant>(AddRec->getOperand(2)); in GetQuadraticEquation()
9865 << *AddRec << '\n'); in GetQuadraticEquation()
9959 SolveQuadraticAddRecExact(const SCEVAddRecExpr *AddRec, ScalarEvolution &SE) { in SolveQuadraticAddRecExact() argument
9962 auto T = GetQuadraticEquation(AddRec); in SolveQuadraticAddRecExact()
9973 ConstantInt *V = EvaluateConstantChrecAtConstant(AddRec, CX, SE); in SolveQuadraticAddRecExact()
9991 SolveQuadraticAddRecRange(const SCEVAddRecExpr *AddRec, in SolveQuadraticAddRecRange() argument
9993 assert(AddRec->getOperand(0)->isZero() && in SolveQuadraticAddRecRange()
9996 << Range << ", addrec " << *AddRec << '\n'); in SolveQuadraticAddRecRange()
9999 assert(Range.contains(APInt(SE.getTypeSizeInBits(AddRec->getType()), 0)) && in SolveQuadraticAddRecRange()
10004 auto T = GetQuadraticEquation(AddRec); in SolveQuadraticAddRecRange()
10036 ConstantInt *V0 = EvaluateConstantChrecAtConstant(AddRec, C0, SE); in SolveQuadraticAddRecRange()
10041 ConstantInt *V1 = EvaluateConstantChrecAtConstant(AddRec, C1, SE); in SolveQuadraticAddRecRange()
10135 const SCEVAddRecExpr *AddRec = in howFarToZero() local
10138 if (!AddRec && AllowPredicates) in howFarToZero()
10142 AddRec = convertSCEVToAddRecWithPredicates(V, L, Predicates); in howFarToZero()
10144 if (!AddRec || AddRec->getLoop() != L) in howFarToZero()
10149 if (AddRec->isQuadratic() && AddRec->getType()->isIntegerTy()) { in howFarToZero()
10153 if (auto S = SolveQuadraticAddRecExact(AddRec, *this)) { in howFarToZero()
10161 if (!AddRec->isAffine()) in howFarToZero()
10176 const SCEV *Start = getSCEVAtScope(AddRec->getStart(), L->getParentLoop()); in howFarToZero()
10177 const SCEV *Step = getSCEVAtScope(AddRec->getOperand(1), L->getParentLoop()); in howFarToZero()
10228 if (ControlsExit && AddRec->hasNoSelfWrap() && in howFarToZero()
10229 loopHasNoAbnormalExits(AddRec->getLoop())) { in howFarToZero()
14161 auto *AddRec = dyn_cast<SCEVAddRecExpr>(S); in convertSCEVToAddRecWithPredicates() local
14163 if (!AddRec) in convertSCEVToAddRecWithPredicates()
14171 return AddRec; in convertSCEVToAddRecWithPredicates()