[llvm] [SLP] Vectorize full insertvalue buildvector sequences (PR #200274)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 9 10:48:15 PDT 2026


================
@@ -13483,6 +13521,38 @@ unsigned BoUpSLP::canMapToVector(Type *T) const {
   return N;
 }
 
+bool BoUpSLP::canVectorStoreInsertValue(const TreeEntry *E) const {
+  if (E->getOpcode() != Instruction::InsertValue ||
+      E->State != TreeEntry::Vectorize)
+    return false;
+
+  bool HasStore = false;
+  for (Value *V : E->Scalars) {
+    auto *IV = dyn_cast<InsertValueInst>(V);
+    if (!IV || isDeleted(IV))
+      return false;
+
+    bool HasExternalUser = false;
----------------
alexey-bataev wrote:

They are in a different scope. HasExternalUses is unique for each value, while HasStore is accumulated for all values

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


More information about the llvm-commits mailing list