[llvm] [LAA] Prepare to handle diff type sizes v2 (PR #161238)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 13 03:37:37 PDT 2026


================
@@ -2267,32 +2286,22 @@ MemoryDepChecker::isDependent(const MemAccessInfo &A, unsigned AIdx,
   uint64_t ConstDist =
       match(Dist, m_scev_APInt(APDist)) ? APDist->abs().getZExtValue() : 0;
 
-  // Attempt to prove strided accesses independent.
-  if (APDist) {
-    // If the distance between accesses and their strides are known constants,
-    // check whether the accesses interlace each other.
-    if (ConstDist > 0 && CommonStride && CommonStride > 1 && HasSameSize &&
-        areStridedAccessesIndependent(ConstDist, *CommonStride, TypeByteSize)) {
-      LLVM_DEBUG(dbgs() << "LAA: Strided accesses are independent\n");
-      return Dependence::NoDep;
-    }
-  } else {
-    if (!LoopGuards)
-      LoopGuards.emplace(
-          ScalarEvolution::LoopGuards::collect(InnermostLoop, SE));
-    Dist = SE.applyLoopGuards(Dist, *LoopGuards);
+  // Attempt to prove strided accesses independent. If the distance between
+  // accesses and their strides are known constants, check whether the accesses
+  // interlace each other.
+  if (ConstDist && CommonStride && CommonStride > 1 && HasSameSize &&
----------------
fhahn wrote:

I think it would be good to not migrate all call sites that use the common size in a single change, but split this up, so we can make sure we have tests for each change

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


More information about the llvm-commits mailing list