[PATCH] D108763: Use type sizes when determining dependence

Jolanta Jensen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 4 08:55:49 PDT 2021


jolanta.jensen marked 2 inline comments as done.
jolanta.jensen added inline comments.


================
Comment at: llvm/lib/Analysis/LoopAccessAnalysis.cpp:1530
   if (!C) {
-    if (!isa<SCEVCouldNotCompute>(Dist) &&
-        TypeByteSize == DL.getTypeAllocSize(BTy) &&
+    if (!isa<SCEVCouldNotCompute>(Dist) && SizesAreSame &&
         isSafeDependenceDistance(DL, *(PSE.getSE()),
----------------
sdesmalen wrote:
> Is it worth also having a negative and positive test for this case, one where the sizes are not the same (guaranteed dependence) and one where the sizes are the same (no dependence). I think we at least need a positive test (i.e. proving no dependence when the types are different, but the same size, because I don't think your current tests covers the case of an unknown dependence distance).
The test case has been extended to cover the positive case for unknown distance and the same sizes.


================
Comment at: llvm/lib/Analysis/LoopAccessAnalysis.cpp:1545
   // Attempt to prove strided accesses independent.
-  if (std::abs(Distance) > 0 && Stride > 1 && ATy == BTy &&
+  if (std::abs(Distance) > 0 && Stride > 1 && SizesAreSame &&
       areStridedAccessesIndependent(std::abs(Distance), Stride, TypeByteSize)) {
----------------
sdesmalen wrote:
> same question for this case.
The test case has been extended to cover this case.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108763/new/

https://reviews.llvm.org/D108763



More information about the llvm-commits mailing list