@@ -558,7 +558,7 @@ static void DoInitialMatch(const SCEV *S, Loop *L,
558558
559559 // Look at addrec operands.
560560 const SCEV *Start, *Step;
561- if (match (S, m_scev_AddRec (m_SCEV (Start), m_SCEV (Step))) &&
561+ if (match (S, m_scev_AffineAddRec (m_SCEV (Start), m_SCEV (Step))) &&
562562 !Start->isZero ()) {
563563 DoInitialMatch (Start, L, Good, Bad, SE);
564564 DoInitialMatch (SE.getAddRecExpr (SE.getConstant (S->getType (), 0 ), Step,
@@ -1440,7 +1440,7 @@ void Cost::RateRegister(const Formula &F, const SCEV *Reg,
14401440 TTI->isIndexedStoreLegal (TTI->MIM_PostInc , AR->getType ())) {
14411441 const SCEV *Start;
14421442 const SCEVConstant *Step;
1443- if (match (AR, m_scev_AddRec (m_SCEV (Start), m_SCEVConstant (Step))))
1443+ if (match (AR, m_scev_AffineAddRec (m_SCEV (Start), m_SCEVConstant (Step))))
14441444 // If the step size matches the base offset, we could use pre-indexed
14451445 // addressing.
14461446 if ((AMK == TTI::AMK_PreIndexed && F.BaseOffset .isFixed () &&
@@ -2540,7 +2540,8 @@ ICmpInst *LSRInstance::OptimizeMax(ICmpInst *Cond, IVStrideUse* &CondUse) {
25402540 // Check the relevant induction variable for conformance to
25412541 // the pattern.
25422542 const SCEV *IV = SE.getSCEV (Cond->getOperand (0 ));
2543- if (!match (IV, m_scev_AddRec (m_scev_SpecificInt (1 ), m_scev_SpecificInt (1 ))))
2543+ if (!match (IV,
2544+ m_scev_AffineAddRec (m_scev_SpecificInt (1 ), m_scev_SpecificInt (1 ))))
25442545 return Cond;
25452546
25462547 assert (cast<SCEVAddRecExpr>(IV)->getLoop () == L &&
@@ -3843,7 +3844,7 @@ static const SCEV *CollectSubexprs(const SCEV *S, const SCEVConstant *C,
38433844 return nullptr ;
38443845 }
38453846 const SCEV *Start, *Step;
3846- if (match (S, m_scev_AddRec (m_SCEV (Start), m_SCEV (Step)))) {
3847+ if (match (S, m_scev_AffineAddRec (m_SCEV (Start), m_SCEV (Step)))) {
38473848 // Split a non-zero base out of an addrec.
38483849 if (Start->isZero ())
38493850 return S;
@@ -3890,7 +3891,7 @@ static bool mayUsePostIncMode(const TargetTransformInfo &TTI,
38903891 !LU.AccessTy .getType ()->isIntOrIntVectorTy ())
38913892 return false ;
38923893 const SCEV *Start;
3893- if (!match (S, m_scev_AddRec (m_SCEV (Start), m_SCEVConstant ())))
3894+ if (!match (S, m_scev_AffineAddRec (m_SCEV (Start), m_SCEVConstant ())))
38943895 return false ;
38953896 // Check if a post-indexed load/store can be used.
38963897 if (TTI.isIndexedLoadLegal (TTI.MIM_PostInc , S->getType ()) ||
@@ -4155,7 +4156,7 @@ void LSRInstance::GenerateConstantOffsetsImpl(
41554156 // instructions for pointer updating.
41564157 if (AMK == TTI::AMK_PreIndexed && LU.Kind == LSRUse::Address) {
41574158 const APInt *StepInt;
4158- if (match (G, m_scev_AddRec (m_SCEV (), m_scev_APInt (StepInt)))) {
4159+ if (match (G, m_scev_AffineAddRec (m_SCEV (), m_scev_APInt (StepInt)))) {
41594160 int64_t Step = StepInt->isNegative () ? StepInt->getSExtValue ()
41604161 : StepInt->getZExtValue ();
41614162
0 commit comments