Lines Matching defs:AddRec
965 const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(Expr);
966 if (!AddRec)
969 // The AddRec must depend on one of the containing loops. Otherwise,
975 while (L && AddRec->getLoop() != L)
980 const SCEV *Start = AddRec->getStart();
981 const SCEV *Step = AddRec->getStepRecurrence(*SE);
982 const SCEV *UB = SE->getBackedgeTakenCount(AddRec->getLoop());
986 if (!AddRec->getNoWrapFlags())
993 Loops.set(mapSrcLoop(AddRec->getLoop()));
995 Loops.set(mapDstLoop(AddRec->getLoop()));
1097 /// with some extra checking if S is an AddRec and we can prove less-than using
1112 if (const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(Bound)) {
1113 if (AddRec->isAffine()) {
1114 const SCEV *BECount = SE->getBackedgeTakenCount(AddRec->getLoop());
1116 const SCEV *Limit = AddRec->evaluateAtIteration(BECount, *SE);
1134 if (const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(S)) {
1135 if (AddRec->isAffine()) {
1138 if (SE->isKnownNonNegative(AddRec->getStart()) &&
1139 SE->isKnownNonNegative(AddRec->getOperand(1)))
2277 llvm_unreachable("SIV test expected at least one AddRec");
2346 llvm_unreachable("RDIV expected at least one AddRec");
2415 while (const SCEVAddRecExpr *AddRec =
2417 const SCEV *Coeff = AddRec->getStepRecurrence(*SE);
2425 Coefficients = AddRec->getStart();
2434 while (const SCEVAddRecExpr *AddRec =
2436 const SCEV *Coeff = AddRec->getStepRecurrence(*SE);
2444 Coefficients = AddRec->getStart();
2503 while (const SCEVAddRecExpr *AddRec =
2505 Coefficients = AddRec->getStart();
2506 const Loop *CurLoop = AddRec->getLoop();
2508 const SCEV *SrcCoeff = AddRec->getStepRecurrence(*SE);
2512 AddRec = cast<SCEVAddRecExpr>(Inner);
2513 const SCEV *Coeff = AddRec->getStepRecurrence(*SE);
2514 if (CurLoop == AddRec->getLoop())
2525 Inner = AddRec->getStart();
2529 AddRec = cast<SCEVAddRecExpr>(Inner);
2530 const SCEV *Coeff = AddRec->getStepRecurrence(*SE);
2531 if (CurLoop == AddRec->getLoop())
2542 Inner = AddRec->getStart();
3009 while (const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(Subscript)) {
3010 const Loop *L = AddRec->getLoop();
3012 CI[K].Coeff = AddRec->getStepRecurrence(*SE);
3016 Subscript = AddRec->getStart();
3083 const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(Expr);
3084 if (!AddRec)
3086 if (AddRec->getLoop() == TargetLoop)
3087 return AddRec->getStepRecurrence(*SE);
3088 return findCoefficient(AddRec->getStart(), TargetLoop);
3099 const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(Expr);
3100 if (!AddRec)
3102 if (AddRec->getLoop() == TargetLoop)
3103 return AddRec->getStart();
3104 return SE->getAddRecExpr(zeroCoefficient(AddRec->getStart(), TargetLoop),
3105 AddRec->getStepRecurrence(*SE),
3106 AddRec->getLoop(),
3107 AddRec->getNoWrapFlags());
3119 const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(Expr);
3120 if (!AddRec) // create a new addRec
3125 if (AddRec->getLoop() == TargetLoop) {
3126 const SCEV *Sum = SE->getAddExpr(AddRec->getStepRecurrence(*SE), Value);
3128 return AddRec->getStart();
3129 return SE->getAddRecExpr(AddRec->getStart(),
3131 AddRec->getLoop(),
3132 AddRec->getNoWrapFlags());
3134 if (SE->isLoopInvariant(AddRec, TargetLoop))
3135 return SE->getAddRecExpr(AddRec, Value, TargetLoop, SCEV::FlagAnyWrap);
3137 addToCoefficient(AddRec->getStart(), TargetLoop, Value),
3138 AddRec->getStepRecurrence(*SE), AddRec->getLoop(),
3139 AddRec->getNoWrapFlags());