[llvm] [SLP]Try to vectorize small graph with extractelements, used in (PR #83468)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 1 04:16:02 PST 2024


================
@@ -8974,6 +8974,20 @@ bool BoUpSLP::isTreeTinyAndNotFullyVectorizable(bool ForReduction) const {
   if (isFullyVectorizableTinyTree(ForReduction))
     return false;
 
+  // Check if any of the gather node forms an insertelement buildvector
+  // somewhere.
+  if (any_of(VectorizableTree, [](const std::unique_ptr<TreeEntry> &TE) {
+        return TE->State == TreeEntry::NeedToGather &&
+               all_of(TE->Scalars, [](Value *V) {
+                 return isa<ExtractElementInst, UndefValue>(V) ||
+                        (!V->hasNUsesOrMore(8) &&
----------------
alexey-bataev wrote:

Yes, some upper limit. Will make it a named constant.

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


More information about the llvm-commits mailing list