Skip to content

Commit 351f4a5

Browse files
authored
Reland "[Vectorize] Fix warnings"" (#105772)
Revert was wrong, The bot is still broken https://lab.llvm.org/buildbot/#/builders/51/builds/2838 Reverts #105771
1 parent e15abb7 commit 351f4a5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -9297,7 +9297,7 @@ class BoUpSLP::ShuffleCostEstimator : public BaseShuffleAnalysis {
92979297
for (unsigned Idx = 0, Sz = CommonMask.size(); Idx < Sz; ++Idx)
92989298
if (CommonMask[Idx] != PoisonMaskElem)
92999299
CommonMask[Idx] = Idx;
9300-
for (const auto [E, Idx] : SubVectors) {
9300+
for (const auto &[E, Idx] : SubVectors) {
93019301
Cost += ::getShuffleCost(
93029302
TTI, TTI::SK_InsertSubvector,
93039303
FixedVectorType::get(ScalarTy, CommonMask.size()), std::nullopt,
@@ -12455,7 +12455,7 @@ class BoUpSLP::ShuffleInstructionBuilder final : public BaseShuffleAnalysis {
1245512455
for (unsigned Idx = 0, Sz = CommonMask.size(); Idx < Sz; ++Idx)
1245612456
if (CommonMask[Idx] != PoisonMaskElem)
1245712457
CommonMask[Idx] = Idx;
12458-
for (const auto [E, Idx] : SubVectors) {
12458+
for (const auto &[E, Idx] : SubVectors) {
1245912459
Vec = Builder.CreateInsertVector(
1246012460
Vec->getType(), Vec, E->VectorizedValue, Builder.getInt64(Idx));
1246112461
if (!CommonMask.empty()) {
@@ -12636,7 +12636,7 @@ ResTy BoUpSLP::processBuildVector(const TreeEntry *E, Type *ScalarTy,
1263612636
E->ReuseShuffleIndices.end());
1263712637
SmallVector<Value *> GatheredScalars(E->Scalars.begin(), E->Scalars.end());
1263812638
// Clear values, to be replaced by insertvector instructions.
12639-
for (const auto [EIdx, Idx] : E->CombinedEntriesWithIndices)
12639+
for (const auto &[EIdx, Idx] : E->CombinedEntriesWithIndices)
1264012640
for_each(MutableArrayRef(GatheredScalars)
1264112641
.slice(Idx, VectorizableTree[EIdx]->getVectorFactor()),
1264212642
[&](Value *&V) { V = PoisonValue::get(V->getType()); });
@@ -13073,7 +13073,7 @@ ResTy BoUpSLP::processBuildVector(const TreeEntry *E, Type *ScalarTy,
1307313073
}
1307413074

1307513075
Value *BoUpSLP::createBuildVector(const TreeEntry *E, Type *ScalarTy) {
13076-
for (const auto [EIdx, _] : E->CombinedEntriesWithIndices)
13076+
for (const auto &[EIdx, _] : E->CombinedEntriesWithIndices)
1307713077
(void)vectorizeTree(VectorizableTree[EIdx].get(), /*PostponedPHIs=*/false);
1307813078
return processBuildVector<ShuffleInstructionBuilder, Value *>(E, ScalarTy,
1307913079
Builder, *this);

0 commit comments

Comments
 (0)