Return the constant step of affine AddRec AR in units of AccessTy.
Declared in <llvm/Analysis/LoopAccessAnalysis.h>
std::optional<int64_t>
getStrideFromAddRec(
SCEVAddRecExpr const* AR,
Loop const* Lp,
Type* AccessTy,
Value* Ptr,
PredicatedScalarEvolution& PSE);
If AR is an affine AddRec for Lp with a constant step, return the step in units of AccessTy's allocation size. Returns std::nullopt if the step is not constant, does not divide the access size, or AccessTy is a scalable vector. Ptr is only used for debug output and may be null.
The constant step in units of AccessTy, or std::nullopt.
| Name | Description |
|---|---|
| AR | Candidate affine add-recurrence for the pointer. |
| Lp | Loop that AR must be an AddRec for. |
| AccessTy | Access type whose allocation size scales the step. |
| Ptr | Optional pointer value used only for debug output. |
| PSE | Predicated SCEV used to analyze AR. |