[llvm] [LAA] Allow vectorizing `A[NonZeroNonConstantStride*I] += 1` (PR #186262)
Andrei Elovikov via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 29 15:49:42 PDT 2026
================
@@ -54,7 +54,12 @@ static std::optional<int64_t> getConstantStride(VPValue *Addr, Type *AccessTy,
if (!AddRec)
return {};
- return getStrideFromAddRec(AddRec, L, AccessTy, /*Ptr=*/nullptr, PSE);
+ const auto *Stride = dyn_cast_or_null<SCEVConstant>(
+ getStrideFromAddRec(AddRec, L, AccessTy, /*Ptr=*/nullptr, PSE));
+ if (!Stride)
+ return {};
+
+ return Stride->getAPInt().trySExtValue();
----------------
eas wrote:
I'm not sure how valuable that would be. My idea is to uplift as much as possible (ideally everything) to operate on SCEV strides instead of constant strides...
https://github.com/llvm/llvm-project/pull/186262
More information about the llvm-commits
mailing list