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

Ryotaro Kasuga via llvm-commits llvm-commits at lists.llvm.org
Thu May 8 03:45:52 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;
----------------
kasuga-fj wrote:

nit: What if `S` is also 0? This is a very special case, so I don't think we need to handle such a case carefully for now, but I would prefer to leave some TODO/FIXME comments for such a case. (For example, I think it's also reasonable to append a predicate for `S == 0` to `Assumptions` and return true here.)

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


More information about the llvm-commits mailing list