Skip to content

Commit

Permalink
Reland "[Vectorize] Fix warnings"" (#105772)
Browse files Browse the repository at this point in the history
Revert was wrong, 

The bot is still broken
https://lab.llvm.org/buildbot/#/builders/51/builds/2838

Reverts #105771
  • Loading branch information
vitalybuka authored Aug 23, 2024
1 parent e15abb7 commit 351f4a5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9297,7 +9297,7 @@ class BoUpSLP::ShuffleCostEstimator : public BaseShuffleAnalysis {
for (unsigned Idx = 0, Sz = CommonMask.size(); Idx < Sz; ++Idx)
if (CommonMask[Idx] != PoisonMaskElem)
CommonMask[Idx] = Idx;
for (const auto [E, Idx] : SubVectors) {
for (const auto &[E, Idx] : SubVectors) {
Cost += ::getShuffleCost(
TTI, TTI::SK_InsertSubvector,
FixedVectorType::get(ScalarTy, CommonMask.size()), std::nullopt,
Expand Down Expand Up @@ -12455,7 +12455,7 @@ class BoUpSLP::ShuffleInstructionBuilder final : public BaseShuffleAnalysis {
for (unsigned Idx = 0, Sz = CommonMask.size(); Idx < Sz; ++Idx)
if (CommonMask[Idx] != PoisonMaskElem)
CommonMask[Idx] = Idx;
for (const auto [E, Idx] : SubVectors) {
for (const auto &[E, Idx] : SubVectors) {
Vec = Builder.CreateInsertVector(
Vec->getType(), Vec, E->VectorizedValue, Builder.getInt64(Idx));
if (!CommonMask.empty()) {
Expand Down Expand Up @@ -12636,7 +12636,7 @@ ResTy BoUpSLP::processBuildVector(const TreeEntry *E, Type *ScalarTy,
E->ReuseShuffleIndices.end());
SmallVector<Value *> GatheredScalars(E->Scalars.begin(), E->Scalars.end());
// Clear values, to be replaced by insertvector instructions.
for (const auto [EIdx, Idx] : E->CombinedEntriesWithIndices)
for (const auto &[EIdx, Idx] : E->CombinedEntriesWithIndices)
for_each(MutableArrayRef(GatheredScalars)
.slice(Idx, VectorizableTree[EIdx]->getVectorFactor()),
[&](Value *&V) { V = PoisonValue::get(V->getType()); });
Expand Down Expand Up @@ -13073,7 +13073,7 @@ ResTy BoUpSLP::processBuildVector(const TreeEntry *E, Type *ScalarTy,
}

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

0 comments on commit 351f4a5

Please sign in to comment.