[llvm-branch-commits] [llvm] b051ebc - Revert "Revert "[Vectorize] Fix warnings" (#105771)"
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Aug 22 20:03:19 PDT 2024
Author: Vitaly Buka
Date: 2024-08-22T20:03:14-07:00
New Revision: b051ebc7efb69953c6118b7f5615cc22e9636b7a
URL: https://github.com/llvm/llvm-project/commit/b051ebc7efb69953c6118b7f5615cc22e9636b7a
DIFF: https://github.com/llvm/llvm-project/commit/b051ebc7efb69953c6118b7f5615cc22e9636b7a.diff
LOG: Revert "Revert "[Vectorize] Fix warnings" (#105771)"
This reverts commit 151945151c3d29b3a6b3a630cf36942cab07fef9.
Added:
Modified:
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index afaef6f9da9872..e8ab6839d9fa87 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -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,
@@ -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()) {
@@ -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()); });
@@ -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);
More information about the llvm-branch-commits
mailing list