[llvm] [SLP][REVEC] Fix insertelement has multiple uses. (PR #102329)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 8 06:43:43 PDT 2024


================
@@ -6402,6 +6402,14 @@ BoUpSLP::TreeEntry::EntryState BoUpSLP::getScalarsVectorizationState(
       return TreeEntry::NeedToGather;
     }
 
+    if (any_of(VL, [&SourceVectors](Value *V) {
+          if (SourceVectors.contains(V))
+            return !V->hasOneUse();
+          // The last InsertElement can have multiple uses.
+          return false;
+        }))
----------------
alexey-bataev wrote:

Need to add a check that this only REVEC specific

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


More information about the llvm-commits mailing list