[llvm] [SLP] Vectorize select-addressed loads as masked-load blends (PR #210455)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 20 18:48:14 PDT 2026


================
@@ -13017,6 +13090,16 @@ void BoUpSLP::buildTreeRec(ArrayRef<Value *> VLRef, unsigned Depth,
                 << "SLP: added a new TreeEntry (non-consecutive LoadInst).\n";
             TE->dump());
         break;
+      case TreeEntry::BlendedLoadVectorize:
+        // Load blended (via `select`) from two candidate bases, emitted as two
+        // masked loads plus a select (see isSelectedBaseLoad). No per-lane
+        // address operand to recurse into, so Operands stays the real pointer
+        // operand list.
+        TE = newTreeEntry(VL, TreeEntry::BlendedLoadVectorize, Bundle, S,
+                          UserTreeIdx, ReuseShuffleIndices);
+        LLVM_DEBUG(dbgs() << "SLP: added a new TreeEntry (blended LoadInst).\n";
+                   TE->dump());
+        break;
----------------
alexey-bataev wrote:

- We can, don't want todo it in this patch, it will require some extra work for handling such load nodes

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


More information about the llvm-commits mailing list