@@ -1903,37 +1903,13 @@ isLoopVariantIndirectAddress(ArrayRef<const Value *> UnderlyingObjects,
1903
1903
});
1904
1904
}
1905
1905
1906
- namespace {
1907
- struct DepDistanceStrideAndSizeInfo {
1908
- const SCEV *Dist;
1909
- uint64_t StrideA;
1910
- uint64_t StrideB;
1911
- uint64_t TypeByteSize;
1912
- bool AIsWrite;
1913
- bool BIsWrite;
1914
-
1915
- DepDistanceStrideAndSizeInfo (const SCEV *Dist, uint64_t StrideA,
1916
- uint64_t StrideB, uint64_t TypeByteSize,
1917
- bool AIsWrite, bool BIsWrite)
1918
- : Dist(Dist), StrideA(StrideA), StrideB(StrideB),
1919
- TypeByteSize (TypeByteSize), AIsWrite(AIsWrite), BIsWrite(BIsWrite) {}
1920
- };
1921
- } // namespace
1922
-
1923
- // Get the dependence distance, strides, type size and whether it is a write for
1924
- // the dependence between A and B. Returns a DepType, if we can prove there's
1925
- // no dependence or the analysis fails. Outlined to lambda to limit he scope
1926
- // of various temporary variables, like A/BPtr, StrideA/BPtr and others.
1927
- // Returns either the dependence result, if it could already be determined, or a
1928
- // struct containing (Distance, Stride, TypeSize, AIsWrite, BIsWrite).
1929
- static std::variant<MemoryDepChecker::Dependence::DepType,
1930
- DepDistanceStrideAndSizeInfo>
1931
- getDependenceDistanceStrideAndSize (
1906
+ std::variant<MemoryDepChecker::Dependence::DepType,
1907
+ MemoryDepChecker::DepDistanceStrideAndSizeInfo>
1908
+ MemoryDepChecker::getDependenceDistanceStrideAndSize (
1932
1909
const AccessAnalysis::MemAccessInfo &A, Instruction *AInst,
1933
1910
const AccessAnalysis::MemAccessInfo &B, Instruction *BInst,
1934
- const DenseMap<Value *, const SCEV *> &Strides,
1935
- const DenseMap<Value *, SmallVector<const Value *, 16 >> &UnderlyingObjects,
1936
- PredicatedScalarEvolution &PSE, const Loop *InnermostLoop) {
1911
+ const DenseMap<Value *, SmallVector<const Value *, 16 >>
1912
+ &UnderlyingObjects) {
1937
1913
auto &DL = InnermostLoop->getHeader ()->getModule ()->getDataLayout ();
1938
1914
auto &SE = *PSE.getSE ();
1939
1915
auto [APtr, AIsWrite] = A;
@@ -1952,9 +1928,11 @@ getDependenceDistanceStrideAndSize(
1952
1928
return MemoryDepChecker::Dependence::Unknown;
1953
1929
1954
1930
int64_t StrideAPtr =
1955
- getPtrStride (PSE, ATy, APtr, InnermostLoop, Strides, true ).value_or (0 );
1931
+ getPtrStride (PSE, ATy, APtr, InnermostLoop, SymbolicStrides, true )
1932
+ .value_or (0 );
1956
1933
int64_t StrideBPtr =
1957
- getPtrStride (PSE, BTy, BPtr, InnermostLoop, Strides, true ).value_or (0 );
1934
+ getPtrStride (PSE, BTy, BPtr, InnermostLoop, SymbolicStrides, true )
1935
+ .value_or (0 );
1958
1936
1959
1937
const SCEV *Src = PSE.getSCEV (APtr);
1960
1938
const SCEV *Sink = PSE.getSCEV (BPtr);
@@ -2033,8 +2011,7 @@ MemoryDepChecker::Dependence::DepType MemoryDepChecker::isDependent(
2033
2011
// Get the dependence distance, stride, type size and what access writes for
2034
2012
// the dependence between A and B.
2035
2013
auto Res = getDependenceDistanceStrideAndSize (
2036
- A, InstMap[AIdx], B, InstMap[BIdx], SymbolicStrides, UnderlyingObjects,
2037
- PSE, InnermostLoop);
2014
+ A, InstMap[AIdx], B, InstMap[BIdx], UnderlyingObjects);
2038
2015
if (std::holds_alternative<Dependence::DepType>(Res))
2039
2016
return std::get<Dependence::DepType>(Res);
2040
2017
0 commit comments