[llvm] LAA: improve code in getStrideFromPointer (NFC) (PR #124780)
Ramkumar Ramachandra via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 31 03:29:56 PST 2025
================
@@ -2888,25 +2885,19 @@ static const SCEV *getStrideFromPointer(Value *Ptr, ScalarEvolution *SE, Loop *L
return nullptr;
V = S->getStepRecurrence(*SE);
- if (!V)
- return nullptr;
// Strip off the size of access multiplication if we are still analyzing the
// pointer.
if (OrigPtr == Ptr) {
- if (const SCEVMulExpr *M = dyn_cast<SCEVMulExpr>(V)) {
- if (M->getOperand(0)->getSCEVType() != scConstant)
+ if (auto *M = dyn_cast<SCEVMulExpr>(V)) {
+ auto *StepConst = dyn_cast<SCEVConstant>(M->getOperand(0));
+ if (!StepConst)
return nullptr;
- const APInt &APStepVal = cast<SCEVConstant>(M->getOperand(0))->getAPInt();
-
- // Huge step value - give up.
- if (APStepVal.getBitWidth() > 64)
----------------
artagnon wrote:
This piece of code is uncovered by existing tests. I could try crafting a test to fix this as a follow-up?
https://github.com/llvm/llvm-project/pull/124780
More information about the llvm-commits
mailing list