@@ -1781,14 +1781,14 @@ void MemoryDepChecker::mergeInStatus(VectorizationSafetyStatus S) {
1781
1781
Status = S;
1782
1782
}
1783
1783
1784
- // / Given a dependence-distance \p Dist between two
1785
- // / memory accesses, that have strides in the same direction whose absolute
1786
- // / value of the maximum stride is given in \p MaxStride, and that have the same
1787
- // / type size \p TypeByteSize, in a loop whose maximum backedge taken count is
1788
- // / \p MaxBTC, check if it is possible to prove statically that the dependence
1784
+ // / Given a dependence-distance \p Dist between two memory accesses, that have
1785
+ // / strides in the same direction whose absolute value of the maximum stride is
1786
+ // / given in \p MaxStride, in a loop whose maximum backedge taken count is \p
1787
+ // / MaxBTC, check if it is possible to prove statically that the dependence
1789
1788
// / distance is larger than the range that the accesses will travel through the
1790
1789
// / execution of the loop. If so, return true; false otherwise. This is useful
1791
1790
// / for example in loops such as the following (PR31098):
1791
+ // /
1792
1792
// / for (i = 0; i < D; ++i) {
1793
1793
// / = out[i];
1794
1794
// / out[i+D] =
@@ -1844,8 +1844,8 @@ static bool isSafeDependenceDistance(const DataLayout &DL, ScalarEvolution &SE,
1844
1844
}
1845
1845
1846
1846
// / Check the dependence for two accesses with the same stride \p Stride.
1847
- // / \p Distance is the positive distance and \p TypeByteSize is type size in
1848
- // / bytes.
1847
+ // / \p Distance is the positive distance in bytes, and \p TypeByteSize is type
1848
+ // / size in bytes.
1849
1849
// /
1850
1850
// / \returns true if they are independent.
1851
1851
static bool areStridedAccessesIndependent (uint64_t Distance, uint64_t Stride,
@@ -1983,13 +1983,14 @@ MemoryDepChecker::getDependenceDistanceStrideAndSize(
1983
1983
return MemoryDepChecker::Dependence::Unknown;
1984
1984
}
1985
1985
1986
- TypeSize AStoreSz = DL.getTypeStoreSize (ATy),
1987
- BStoreSz = DL.getTypeStoreSize (BTy);
1986
+ TypeSize AStoreSz = DL.getTypeStoreSize (ATy);
1987
+ TypeSize BStoreSz = DL.getTypeStoreSize (BTy);
1988
1988
1989
1989
// If store sizes are not the same, set TypeByteSize to zero, so we can check
1990
- // it in the caller.
1991
- uint64_t ASz = DL.getTypeAllocSize (ATy), BSz = DL.getTypeAllocSize (BTy),
1992
- TypeByteSize = AStoreSz == BStoreSz ? BSz : 0 ;
1990
+ // it in the caller isDependent.
1991
+ uint64_t ASz = DL.getTypeAllocSize (ATy);
1992
+ uint64_t BSz = DL.getTypeAllocSize (BTy);
1993
+ uint64_t TypeByteSize = (AStoreSz == BStoreSz) ? BSz : 0 ;
1993
1994
1994
1995
uint64_t StrideAScaled = std::abs (StrideAPtrInt) * ASz;
1995
1996
uint64_t StrideBScaled = std::abs (StrideBPtrInt) * BSz;
@@ -2159,7 +2160,7 @@ MemoryDepChecker::isDependent(const MemAccessInfo &A, unsigned AIdx,
2159
2160
// B[i] = A[i] + 1;
2160
2161
// }
2161
2162
//
2162
- // Two accesses in memory (stride is 2):
2163
+ // Two accesses in memory (stride is 4 * 2):
2163
2164
// | A[0] | | A[2] | | A[4] | | A[6] | |
2164
2165
// | B[0] | | B[2] | | B[4] |
2165
2166
//
0 commit comments