[llvm] [DA] do not handle array accesses of different offsets (PR #123436)

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Mon May 12 06:57:43 PDT 2025


================
@@ -10971,6 +10971,52 @@ bool ScalarEvolution::isKnownToBeAPowerOfTwo(const SCEV *S, bool OrZero,
   return all_of(Mul->operands(), NonRecursive) && (OrZero || isKnownNonZero(S));
 }
 
+bool ScalarEvolution::isKnownMultipleOf(
+    const SCEV *S, uint64_t M,
+    SmallVectorImpl<const SCEVPredicate *> &Assumptions) {
+  if (M == 0)
+    return false;
+  if (M == 1)
+    return true;
+
+  // Recursively check AddRec operands.
----------------
Meinersbur wrote:

Consider adding a comment in the sense of:
> An AddRecExpr is a multiple of M if it starts with a multiple of M and at every steps only adds multiples of M.

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


More information about the llvm-commits mailing list