[llvm] [SLP][REVEC] Support more mask pattern usage in shufflevector. (PR #106212)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 27 05:44:03 PDT 2024


================
@@ -13971,9 +13967,16 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E, bool PostponedPHIs) {
           LLVM_DEBUG(dbgs() << "SLP: Diamond merged for " << *VL0 << ".\n");
           return E->VectorizedValue;
         }
-        // The current shufflevector usage always duplicate the source.
-        V = Builder.CreateShuffleVector(Src,
-                                        calculateShufflevectorMask(E->Scalars));
+        assert(isa<ShuffleVectorInst>(Src) &&
+               "Not supported shufflevector usage.");
+        ShuffleVectorInst *SVSrc = cast<ShuffleVectorInst>(Src);
----------------
alexey-bataev wrote:

```suggestion
        auto *SVSrc = cast<ShuffleVectorInst>(Src);
```


https://github.com/llvm/llvm-project/pull/106212


More information about the llvm-commits mailing list