Skip to content

Commit e51dd5d

Browse files
committed
[LAA] Shorten some code
1 parent 10f48ba commit e51dd5d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

llvm/lib/Analysis/LoopAccessAnalysis.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -832,11 +832,7 @@ getStrideFromAddRec(const SCEVAddRecExpr *AR, const Loop *Lp, Type *AccessTy,
832832
return std::nullopt;
833833

834834
// Strided access.
835-
int64_t Stride = *StepVal / Size;
836-
if (*StepVal % Size)
837-
return std::nullopt;
838-
839-
return Stride;
835+
return *StepVal % Size ? std::nullopt : std::make_optional(*StepVal / Size);
840836
}
841837

842838
static bool isNoWrapGEP(Value *Ptr, PredicatedScalarEvolution &PSE,

0 commit comments

Comments
 (0)