File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -184,19 +184,14 @@ bool EraVMIndexedMemOpsPrepare::isValidGEPAndIncByOneCell(
184184 GetElementPtrInst *BasePtr) const {
185185 // Use SCEV info to check whether this BasePtr is increased
186186 // by one cell per iteration.
187- const SCEV *SCEVPtr = SE->getSCEVAtScope (BasePtr, CurrentLoop);
188-
189- if (SCEVPtr) {
190- const auto *AddRec = dyn_cast<SCEVAddRecExpr>(SCEVPtr);
191- if (!AddRec)
192- return false ;
193- const auto *Step = dyn_cast<SCEVConstant>(AddRec->getStepRecurrence (*SE));
194- if (!Step)
195- return false ;
196- const APInt StrideVal = Step->getAPInt ();
197- if (StrideVal != 32 )
198- return false ;
199- }
187+ const auto *AddRec =
188+ dyn_cast<SCEVAddRecExpr>(SE->getSCEVAtScope (BasePtr, CurrentLoop));
189+ if (!AddRec)
190+ return false ;
191+
192+ const auto *Step = dyn_cast<SCEVConstant>(AddRec->getStepRecurrence (*SE));
193+ if (!Step || Step->getAPInt () != 32 )
194+ return false ;
200195
201196 if (!std::all_of (
202197 BasePtr->op_begin (), std::prev (BasePtr->op_end ()),
You can’t perform that action at this time.
0 commit comments