[llvm] [LAA][LV]Allow recognition of strided pointers with constant stride (PR #171151)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 16 08:54:27 PST 2026


================
@@ -987,12 +988,43 @@ getStrideFromAddRec(const SCEVAddRecExpr *AR, const Loop *Lp, Type *AccessTy,
     return std::nullopt;
   }
 
-  // Check the step is constant.
-  const SCEV *Step = AR->getStepRecurrence(*PSE.getSE());
-
   // Calculate the pointer stride and check if it is constant.
+  // If we allow strided pointers we also check the add recurrence
----------------
david-arm wrote:

nit: Looks like the comments aren't making full use of the 80 characters per line.

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


More information about the llvm-commits mailing list