[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
================
@@ -1063,7 +1065,7 @@ isNoWrap(PredicatedScalarEvolution &PSE, const SCEVAddRecExpr *AR, Value *Ptr,
// assumes the object in memory is aligned to the natural alignment.
unsigned AddrSpace = AR->getType()->getPointerAddressSpace();
if (!NullPointerIsDefined(L->getHeader()->getParent(), AddrSpace) &&
- (Stride == 1 || Stride == -1))
+ PSE.getSE()->getAbsExpr(Stride, false)->isOne())
----------------
eas wrote:
I think these are equivalent at the moment, but the `getAbsExpr()->isOne()` is potentially more powerful if `%c ? 1 : -1` ever reaches this point (doesn't seem so now).
https://github.com/llvm/llvm-project/pull/186262
More information about the llvm-commits
mailing list