Lines Matching refs:AddRec

1259   if (const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(Op)) {  in getTruncateExpr()  local
1261 for (const SCEV *Op : AddRec->operands()) in getTruncateExpr()
1263 return getAddRecExpr(Operands, AddRec->getLoop(), SCEV::FlagAnyWrap); in getTruncateExpr()
2757 const SCEVAddRecExpr *AddRec = cast<SCEVAddRecExpr>(Ops[Idx]); in getAddExpr() local
2758 const Loop *AddRecLoop = AddRec->getLoop(); in getAddExpr()
2770 LIOps.push_back(AddRec); in getAddExpr()
2775 LIOps.push_back(AddRec->getStart()); in getAddExpr()
2777 SmallVector<const SCEV *, 4> AddRecOps(AddRec->operands()); in getAddExpr()
2786 Flags = AddRec->getNoWrapFlags(setFlags(Flags, SCEV::FlagNW)); in getAddExpr()
2794 if (Ops[i] == AddRec) { in getAddExpr()
2811 AddRec->getLoop()->getHeader()) && in getAddExpr()
2815 SmallVector<const SCEV *, 4> AddRecOps(AddRec->operands()); in getAddExpr()
3064 } else if (const auto *AddRec = dyn_cast<SCEVAddRecExpr>(Ops[1])) { in getMulExpr() local
3067 for (const SCEV *AddRecOp : AddRec->operands()) in getMulExpr()
3071 return getAddRecExpr(Operands, AddRec->getLoop(), in getMulExpr()
3072 AddRec->getNoWrapFlags(SCEV::FlagNW)); in getMulExpr()
3113 const SCEVAddRecExpr *AddRec = cast<SCEVAddRecExpr>(Ops[Idx]); in getMulExpr() local
3114 const Loop *AddRecLoop = AddRec->getLoop(); in getMulExpr()
3126 NewOps.reserve(AddRec->getNumOperands()); in getMulExpr()
3128 for (unsigned i = 0, e = AddRec->getNumOperands(); i != e; ++i) in getMulExpr()
3129 NewOps.push_back(getMulExpr(Scale, AddRec->getOperand(i), in getMulExpr()
3137 SCEV::NoWrapFlags Flags = ComputeFlags({Scale, AddRec}); in getMulExpr()
3139 NewOps, AddRecLoop, AddRec->getNoWrapFlags(Flags)); in getMulExpr()
3146 if (Ops[i] == AddRec) { in getMulExpr()
3178 if (AddRec->getNumOperands() + OtherAddRec->getNumOperands() - 1 > in getMulExpr()
3179 MaxAddRecSize || hasHugeExpression({AddRec, OtherAddRec})) in getMulExpr()
3183 Type *Ty = AddRec->getType(); in getMulExpr()
3186 for (int x = 0, xe = AddRec->getNumOperands() + in getMulExpr()
3191 for (int z = std::max(y-x, y-(int)AddRec->getNumOperands()+1), in getMulExpr()
3201 const SCEV *Term1 = AddRec->getOperand(y-z); in getMulExpr()
3218 AddRec = dyn_cast<SCEVAddRecExpr>(NewAddRec); in getMulExpr()
3219 if (!AddRec) in getMulExpr()
4153 if (auto *AddRec = dyn_cast<SCEVAddRecExpr>(P)) { in removePointerBase() local
4155 SmallVector<const SCEV *> Ops{AddRec->operands()}; in removePointerBase()
4159 return SE->getAddRecExpr(Ops, AddRec->getLoop(), SCEV::FlagAnyWrap); in removePointerBase()
4356 if (auto *AddRec = dyn_cast<SCEVAddRecExpr>(V)) { in getPointerBase() local
4357 V = AddRec->getStart(); in getPointerBase()
5853 void ScalarEvolution::setNoWrapFlags(SCEVAddRecExpr *AddRec, in setNoWrapFlags() argument
5855 if (AddRec->getNoWrapFlags(Flags) != Flags) { in setNoWrapFlags()
5856 AddRec->setNoWrapFlags(Flags); in setNoWrapFlags()
5857 UnsignedRanges.erase(AddRec); in setNoWrapFlags()
5858 SignedRanges.erase(AddRec); in setNoWrapFlags()
6107 if (const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(S)) { in getRangeRef() local
6110 if (AddRec->hasNoUnsignedWrap()) { in getRangeRef()
6111 APInt UnsignedMinValue = getUnsignedRangeMin(AddRec->getStart()); in getRangeRef()
6122 if (AddRec->hasNoSignedWrap()) { in getRangeRef()
6125 for (unsigned i = 1, e = AddRec->getNumOperands(); i != e; ++i) { in getRangeRef()
6126 if (!isKnownNonNegative(AddRec->getOperand(i))) in getRangeRef()
6128 if (!isKnownNonPositive(AddRec->getOperand(i))) in getRangeRef()
6133 ConstantRange::getNonEmpty(getSignedRangeMin(AddRec->getStart()), in getRangeRef()
6140 getSignedRangeMax(AddRec->getStart()) + 1), in getRangeRef()
6145 if (AddRec->isAffine()) { in getRangeRef()
6146 const SCEV *MaxBECount = getConstantMaxBackedgeTakenCount(AddRec->getLoop()); in getRangeRef()
6150 AddRec->getStart(), AddRec->getStepRecurrence(*this), MaxBECount, in getRangeRef()
6156 AddRec->getStart(), AddRec->getStepRecurrence(*this), MaxBECount, in getRangeRef()
6165 getSymbolicMaxBackedgeTakenCount(AddRec->getLoop()); in getRangeRef()
6168 AddRec->hasNoSelfWrap()) { in getRangeRef()
6170 AddRec, SymbolicMaxBECount, BitWidth, SignHint); in getRangeRef()
6177 return setRange(AddRec, SignHint, std::move(ConservativeResult)); in getRangeRef()
6354 const SCEVAddRecExpr *AddRec, const SCEV *MaxBECount, unsigned BitWidth, in getRangeForAffineNoSelfWrappingAR() argument
6356 assert(AddRec->isAffine() && "Non-affine AddRecs are not suppored!\n"); in getRangeForAffineNoSelfWrappingAR()
6357 assert(AddRec->hasNoSelfWrap() && in getRangeForAffineNoSelfWrappingAR()
6360 const SCEV *Step = AddRec->getStepRecurrence(*this); in getRangeForAffineNoSelfWrappingAR()
6370 getTypeSizeInBits(AddRec->getType())) in getRangeForAffineNoSelfWrappingAR()
6372 MaxBECount = getNoopOrZeroExtend(MaxBECount, AddRec->getType()); in getRangeForAffineNoSelfWrappingAR()
6373 const SCEV *RangeWidth = getMinusOne(AddRec->getType()); in getRangeForAffineNoSelfWrappingAR()
6384 const SCEV *End = AddRec->evaluateAtIteration(MaxBECount, *this); in getRangeForAffineNoSelfWrappingAR()
6398 const SCEV *Start = AddRec->getStart(); in getRangeForAffineNoSelfWrappingAR()
6588 if (auto *AddRec = dyn_cast<SCEVAddRecExpr>(Op)) { in isSCEVExprNeverPoison() local
6594 if (!isLoopInvariant(OtherOp, AddRec->getLoop())) { in isSCEVExprNeverPoison()
6601 isGuaranteedToExecuteForEveryIteration(I, AddRec->getLoop())) in isSCEVExprNeverPoison()
8063 if (const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(LHS)) in computeExitLimitFromICmp() local
8064 if (AddRec->getLoop() == L) { in computeExitLimitFromICmp()
8069 const SCEV *Ret = AddRec->getNumIterationsInRange(CompRange, *this); in computeExitLimitFromICmp()
8163 EvaluateConstantChrecAtConstant(const SCEVAddRecExpr *AddRec, ConstantInt *C, in EvaluateConstantChrecAtConstant() argument
8166 const SCEV *Val = AddRec->evaluateAtIteration(InVal, SE); in EvaluateConstantChrecAtConstant()
9002 if (const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(V)) { in computeSCEVAtScope() local
9006 for (unsigned i = 0, e = AddRec->getNumOperands(); i != e; ++i) { in computeSCEVAtScope()
9007 const SCEV *OpAtScope = getSCEVAtScope(AddRec->getOperand(i), L); in computeSCEVAtScope()
9008 if (OpAtScope == AddRec->getOperand(i)) in computeSCEVAtScope()
9013 SmallVector<const SCEV *, 8> NewOps(AddRec->op_begin(), in computeSCEVAtScope()
9014 AddRec->op_begin()+i); in computeSCEVAtScope()
9017 NewOps.push_back(getSCEVAtScope(AddRec->getOperand(i), L)); in computeSCEVAtScope()
9020 getAddRecExpr(NewOps, AddRec->getLoop(), in computeSCEVAtScope()
9021 AddRec->getNoWrapFlags(SCEV::FlagNW)); in computeSCEVAtScope()
9022 AddRec = dyn_cast<SCEVAddRecExpr>(FoldedRec); in computeSCEVAtScope()
9026 if (!AddRec) in computeSCEVAtScope()
9033 if (!AddRec->getLoop()->contains(L)) { in computeSCEVAtScope()
9036 const SCEV *BackedgeTakenCount = getBackedgeTakenCount(AddRec->getLoop()); in computeSCEVAtScope()
9037 if (BackedgeTakenCount == getCouldNotCompute()) return AddRec; in computeSCEVAtScope()
9040 return AddRec->evaluateAtIteration(BackedgeTakenCount, *this); in computeSCEVAtScope()
9043 return AddRec; in computeSCEVAtScope()
9146 GetQuadraticEquation(const SCEVAddRecExpr *AddRec) { in GetQuadraticEquation() argument
9147 assert(AddRec->getNumOperands() == 3 && "This is not a quadratic chrec!"); in GetQuadraticEquation()
9148 const SCEVConstant *LC = dyn_cast<SCEVConstant>(AddRec->getOperand(0)); in GetQuadraticEquation()
9149 const SCEVConstant *MC = dyn_cast<SCEVConstant>(AddRec->getOperand(1)); in GetQuadraticEquation()
9150 const SCEVConstant *NC = dyn_cast<SCEVConstant>(AddRec->getOperand(2)); in GetQuadraticEquation()
9152 << *AddRec << '\n'); in GetQuadraticEquation()
9246 SolveQuadraticAddRecExact(const SCEVAddRecExpr *AddRec, ScalarEvolution &SE) { in SolveQuadraticAddRecExact() argument
9249 auto T = GetQuadraticEquation(AddRec); in SolveQuadraticAddRecExact()
9260 ConstantInt *V = EvaluateConstantChrecAtConstant(AddRec, CX, SE); in SolveQuadraticAddRecExact()
9278 SolveQuadraticAddRecRange(const SCEVAddRecExpr *AddRec, in SolveQuadraticAddRecRange() argument
9280 assert(AddRec->getOperand(0)->isZero() && in SolveQuadraticAddRecRange()
9283 << Range << ", addrec " << *AddRec << '\n'); in SolveQuadraticAddRecRange()
9286 assert(Range.contains(APInt(SE.getTypeSizeInBits(AddRec->getType()), 0)) && in SolveQuadraticAddRecRange()
9291 auto T = GetQuadraticEquation(AddRec); in SolveQuadraticAddRecRange()
9323 ConstantInt *V0 = EvaluateConstantChrecAtConstant(AddRec, C0, SE); in SolveQuadraticAddRecRange()
9328 ConstantInt *V1 = EvaluateConstantChrecAtConstant(AddRec, C1, SE); in SolveQuadraticAddRecRange()
9422 const SCEVAddRecExpr *AddRec = in howFarToZero() local
9425 if (!AddRec && AllowPredicates) in howFarToZero()
9429 AddRec = convertSCEVToAddRecWithPredicates(V, L, Predicates); in howFarToZero()
9431 if (!AddRec || AddRec->getLoop() != L) in howFarToZero()
9436 if (AddRec->isQuadratic() && AddRec->getType()->isIntegerTy()) { in howFarToZero()
9440 if (auto S = SolveQuadraticAddRecExact(AddRec, *this)) { in howFarToZero()
9448 if (!AddRec->isAffine()) in howFarToZero()
9463 const SCEV *Start = getSCEVAtScope(AddRec->getStart(), L->getParentLoop()); in howFarToZero()
9464 const SCEV *Step = getSCEVAtScope(AddRec->getOperand(1), L->getParentLoop()); in howFarToZero()
9517 if (ControlsExit && AddRec->hasNoSelfWrap() && in howFarToZero()
9518 loopHasNoAbnormalExits(AddRec->getLoop())) { in howFarToZero()
13533 auto *AddRec = dyn_cast<SCEVAddRecExpr>(S); in convertSCEVToAddRecWithPredicates() local
13535 if (!AddRec) in convertSCEVToAddRecWithPredicates()
13543 return AddRec; in convertSCEVToAddRecWithPredicates()