[llvm] [SLP][NFC] Extract VectorizableTree into own ForestTree class (PR #222805)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 11 06:20:01 PDT 2026


================
@@ -8215,28 +8354,28 @@ BoUpSLP::findExternalStoreUsersReorderIndices(TreeEntry *TE) const {
   return ExternalReorderIndices;
 }
 
-void BoUpSLP::buildTree(ArrayRef<Value *> Roots,
+void BoUpSLP::buildTree(ForestTree &FT, ArrayRef<Value *> Roots,
                         const SmallDenseSet<Value *> &UserIgnoreLst) {
   deleteTree();
   assert(TreeEntryToStridedPtrInfoMap.empty() &&
          "TreeEntryToStridedPtrInfoMap is not cleared");
   UserIgnoreList = &UserIgnoreLst;
   if (!allSameType(Roots))
     return;
-  buildTreeRec(Roots, 0, EdgeInfo());
+  buildTreeRec(FT, Roots, 0, EdgeInfo());
   // Build splat-gather subtrees here so the reordering passes cover them too.
-  tryToVectorizeSplatGatheredScalars();
+  tryToVectorizeSplatGatheredScalars(FT);
 }
 
-void BoUpSLP::buildTree(ArrayRef<Value *> Roots) {
+void BoUpSLP::buildTree(ForestTree &FT, ArrayRef<Value *> Roots) {
   deleteTree();
----------------
alexey-bataev wrote:

FT.VectorizableTree.clear();

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


More information about the llvm-commits mailing list