[llvm] [LAA] Support different strides & non constant dep distances using SCEV. (PR #88039)

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 16 05:47:15 PDT 2024


================
@@ -2028,68 +2029,105 @@ MemoryDepChecker::Dependence::DepType MemoryDepChecker::isDependent(
   if (std::holds_alternative<Dependence::DepType>(Res))
     return std::get<Dependence::DepType>(Res);
 
-  const auto &[Dist, Stride, TypeByteSize, AIsWrite, BIsWrite] =
+  const auto &[Dist, StrideA, StrideB, TypeByteSize, AIsWrite, BIsWrite] =
       std::get<DepDistanceStrideAndSizeInfo>(Res);
   bool HasSameSize = TypeByteSize > 0;
 
+  uint64_t CommonStride = StrideA == StrideB ? StrideA : 0;
----------------
Meinersbur wrote:

Isn't `0` a valid stride (i.e. indexed by a constant)? 
```suggestion
  std::optional<uint64_t> CommonStride = StrideA == StrideB ? StrideA : None;
```

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


More information about the llvm-commits mailing list