@@ -6908,7 +6908,7 @@ void BoUpSLP::tryToVectorizeGatheredLoads(
6908
6908
return L1.second > L2.second;
6909
6909
};
6910
6910
6911
- auto IsMaskedGatherSupported = [&](ArrayRef<LoadInst *> Loads) {
6911
+ auto IsMaskedGatherSupported = [&, TTI = TTI ](ArrayRef<LoadInst *> Loads) {
6912
6912
ArrayRef<Value *> Values(reinterpret_cast<Value *const *>(Loads.begin()),
6913
6913
Loads.size());
6914
6914
Align Alignment = computeCommonAlignment<LoadInst>(Values);
@@ -7075,9 +7075,10 @@ void BoUpSLP::tryToVectorizeGatheredLoads(
7075
7075
}
7076
7076
SmallVector<std::pair<LoadInst *, int>> LocalLoadsDists(LoadsDists);
7077
7077
SmallVector<LoadInst *> OriginalLoads(LocalLoadsDists.size());
7078
- transform(
7079
- LoadsDists, OriginalLoads.begin(),
7080
- [](const std::pair<LoadInst *, int> &L) { return L.first; });
7078
+ transform(LoadsDists, OriginalLoads.begin(),
7079
+ [](const std::pair<LoadInst *, int> &L) -> LoadInst * {
7080
+ return L.first;
7081
+ });
7081
7082
stable_sort(LocalLoadsDists, LoadSorter);
7082
7083
SmallVector<LoadInst *> Loads;
7083
7084
unsigned MaxConsecutiveDistance = 0;
@@ -7304,7 +7305,8 @@ void BoUpSLP::tryToVectorizeGatheredLoads(
7304
7305
if (!Ref.empty() && !NonVectorized.empty() &&
7305
7306
std::accumulate(
7306
7307
Ref.begin(), Ref.end(), 0u,
7307
- [](unsigned S, ArrayRef<std::pair<LoadInst *, int>> LoadsDists) {
7308
+ [](unsigned S,
7309
+ ArrayRef<std::pair<LoadInst *, int>> LoadsDists) -> unsigned {
7308
7310
return S + LoadsDists.size();
7309
7311
}) != NonVectorized.size() &&
7310
7312
IsMaskedGatherSupported(NonVectorized)) {
@@ -16979,8 +16981,9 @@ void BoUpSLP::optimizeGatherSequence() {
16979
16981
// and its mask indeces are the same as in the first one or undefs. E.g.
16980
16982
// shuffle %0, poison, <0, 0, 0, undef> is less defined than shuffle %0,
16981
16983
// poison, <0, 0, 0, 0>.
16982
- auto &&IsIdenticalOrLessDefined = [this](Instruction *I1, Instruction *I2,
16983
- SmallVectorImpl<int> &NewMask) {
16984
+ auto &&IsIdenticalOrLessDefined = [TTI = TTI](Instruction *I1,
16985
+ Instruction *I2,
16986
+ SmallVectorImpl<int> &NewMask) {
16984
16987
if (I1->getType() != I2->getType())
16985
16988
return false;
16986
16989
auto *SI1 = dyn_cast<ShuffleVectorInst>(I1);
@@ -17774,7 +17777,7 @@ bool BoUpSLP::collectValuesToDemote(
17774
17777
BitWidth = std::max(BitWidth, BitWidth1);
17775
17778
return BitWidth > 0 && OrigBitWidth >= (BitWidth * 2);
17776
17779
};
17777
- auto FinalAnalysis = [&]() {
17780
+ auto FinalAnalysis = [&, TTI = TTI ]() {
17778
17781
if (!IsProfitableToDemote)
17779
17782
return false;
17780
17783
bool Res = all_of(
0 commit comments