[llvm] [LAA] Support backward dependences with non-constant distance. (PR #91525)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Wed May 8 13:16:24 PDT 2024
================
@@ -2179,11 +2180,23 @@ MemoryDepChecker::Dependence::DepType MemoryDepChecker::isDependent(
// If MinNumIter is 4 (Say if a user forces the vectorization factor to be 4),
// the minimum distance needed is 28, which is greater than distance. It is
// not safe to do vectorization.
+
+ // We know that Dist is positive, but it may not be constant. Use the signed
+ // minimum for computations below, as this ensures we compute the closest
+ // possible dependence distance.
+ int64_t MinDistance = SE.getSignedRangeMin(Dist).getSExtValue();
----------------
fhahn wrote:
We bail out with `if (!SE.isKnownPositive(Dist))` (line 2123), but that might not be sufficient?
https://github.com/llvm/llvm-project/pull/91525
More information about the llvm-commits
mailing list