[llvm] [VPlan] Fix nowrap flags for strided access pointers from SCEV (PR #209453)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 14 06:00:45 PDT 2026


================
@@ -7785,18 +7785,17 @@ void VPlanTransforms::convertToStridedAccesses(VPlan &Plan,
           VectorLoop->getCanonicalIV(), IndexTy,
           VectorLoop->getCanonicalIVType(), DebugLoc::getUnknown());
       auto *AddRecPtr = cast<SCEVAddRecExpr>(PtrSCEV);
-      auto *Offset = Builder.createOverflowingOp(
-          Instruction::Mul, {CanIV, StrideInBytes},
-          {AddRecPtr->hasNoUnsignedWrap(), AddRecPtr->hasNoSignedWrap()});
----------------
lukel97 wrote:

I think we can keep the nuw on the mul, not sure about nsw though. Since if the SCEV has nuw then CanIV * stride musn't wrap either?

https://github.com/llvm/llvm-project/pull/209453


More information about the llvm-commits mailing list