@@ -1917,14 +1917,30 @@ isLoopVariantIndirectAddress(ArrayRef<const Value *> UnderlyingObjects,
1917
1917
});
1918
1918
}
1919
1919
1920
- // Get the dependence distance, stride, type size in whether i is a write for
1920
+ namespace {
1921
+ struct DepDistanceStrideAndSizeInfo {
1922
+ const SCEV *Dist;
1923
+ uint64_t Stride;
1924
+ uint64_t TypeByteSize;
1925
+ bool AIsWrite;
1926
+ bool BIsWrite;
1927
+
1928
+ DepDistanceStrideAndSizeInfo (const SCEV *Dist, uint64_t Stride,
1929
+ uint64_t TypeByteSize, bool AIsWrite,
1930
+ bool BIsWrite)
1931
+ : Dist(Dist), Stride(Stride), TypeByteSize(TypeByteSize),
1932
+ AIsWrite (AIsWrite), BIsWrite(BIsWrite) {}
1933
+ };
1934
+ } // namespace
1935
+
1936
+ // Get the dependence distance, stride, type size and whether it is a write for
1921
1937
// the dependence between A and B. Returns a DepType, if we can prove there's
1922
1938
// no dependence or the analysis fails. Outlined to lambda to limit he scope
1923
1939
// of various temporary variables, like A/BPtr, StrideA/BPtr and others.
1924
1940
// Returns either the dependence result, if it could already be determined, or a
1925
- // tuple with (Distance, Stride, TypeSize, AIsWrite, BIsWrite).
1941
+ // struct containing (Distance, Stride, TypeSize, AIsWrite, BIsWrite).
1926
1942
static std::variant<MemoryDepChecker::Dependence::DepType,
1927
- std::tuple< const SCEV *, uint64_t , uint64_t , bool , bool > >
1943
+ DepDistanceStrideAndSizeInfo >
1928
1944
getDependenceDistanceStrideAndSize (
1929
1945
const AccessAnalysis::MemAccessInfo &A, Instruction *AInst,
1930
1946
const AccessAnalysis::MemAccessInfo &B, Instruction *BInst,
@@ -1993,7 +2009,8 @@ getDependenceDistanceStrideAndSize(
1993
2009
if (!HasSameSize)
1994
2010
TypeByteSize = 0 ;
1995
2011
uint64_t Stride = std::abs (StrideAPtr);
1996
- return std::make_tuple (Dist, Stride, TypeByteSize, AIsWrite, BIsWrite);
2012
+ return DepDistanceStrideAndSizeInfo (Dist, Stride, TypeByteSize, AIsWrite,
2013
+ BIsWrite);
1997
2014
}
1998
2015
1999
2016
MemoryDepChecker::Dependence::DepType MemoryDepChecker::isDependent (
@@ -2012,7 +2029,7 @@ MemoryDepChecker::Dependence::DepType MemoryDepChecker::isDependent(
2012
2029
return std::get<Dependence::DepType>(Res);
2013
2030
2014
2031
const auto &[Dist, Stride, TypeByteSize, AIsWrite, BIsWrite] =
2015
- std::get<std::tuple< const SCEV *, uint64_t , uint64_t , bool , bool > >(Res);
2032
+ std::get<DepDistanceStrideAndSizeInfo >(Res);
2016
2033
bool HasSameSize = TypeByteSize > 0 ;
2017
2034
2018
2035
ScalarEvolution &SE = *PSE.getSE ();
0 commit comments