Skip to content

Revert "[Vectorize] Fix warnings" #105771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

vitalybuka
Copy link
Collaborator

Triggers assert in compiler
https://lab.llvm.org/buildbot/#/builders/51/builds/2836

Instructions.cpp:1700: llvm::ShuffleVectorInst::ShuffleVectorInst(Value *, Value *, ArrayRef<int>, const Twine &, InsertPosition): Assertion `isValidOperands(V1, V2, Mask) && "Invalid shuffle vector instruction operands!"' failed.

This reverts commit a625435.

Created using spr 1.3.4
@vitalybuka vitalybuka merged commit 1519451 into main Aug 23, 2024
7 of 9 checks passed
@vitalybuka vitalybuka deleted the users/vitalybuka/spr/revert-vectorize-fix-warnings branch August 23, 2024 03:03
vitalybuka added a commit that referenced this pull request Aug 23, 2024
@llvmbot
Copy link
Member

llvmbot commented Aug 23, 2024

@llvm/pr-subscribers-llvm-transforms

Author: Vitaly Buka (vitalybuka)

Changes

Triggers assert in compiler
https://lab.llvm.org/buildbot/#/builders/51/builds/2836

Instructions.cpp:1700: llvm::ShuffleVectorInst::ShuffleVectorInst(Value *, Value *, ArrayRef&lt;int&gt;, const Twine &amp;, InsertPosition): Assertion `isValidOperands(V1, V2, Mask) &amp;&amp; "Invalid shuffle vector instruction operands!"' failed.

This reverts commit a625435.


Full diff: https://github.com/llvm/llvm-project/pull/105771.diff

1 Files Affected:

  • (modified) llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp (+4-4)
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index e8ab6839d9fa87..afaef6f9da9872 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);

vitalybuka added a commit that referenced this pull request Aug 23, 2024
cjdb pushed a commit to cjdb/llvm-project that referenced this pull request Aug 23, 2024
Triggers assert in compiler
https://lab.llvm.org/buildbot/#/builders/51/builds/2836

```
Instructions.cpp:1700: llvm::ShuffleVectorInst::ShuffleVectorInst(Value *, Value *, ArrayRef<int>, const Twine &, InsertPosition): Assertion `isValidOperands(V1, V2, Mask) && "Invalid shuffle vector instruction operands!"' failed.
```

This reverts commit a625435.
cjdb pushed a commit to cjdb/llvm-project that referenced this pull request Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants