[llvm] [NFC][SBVec] Rename BottomUpVec to SLPTreeVec (PR #213197)

Anshil Gandhi via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 30 21:23:55 PDT 2026


https://github.com/gandhi56 created https://github.com/llvm/llvm-project/pull/213197

None

>From 531f8af7eb59eec403ea41856a507998f9c88a09 Mon Sep 17 00:00:00 2001
From: Anshil Gandhi <gandhi21299 at gmail.com>
Date: Fri, 31 Jul 2026 00:16:13 -0400
Subject: [PATCH] [NFC] Rename BottomUpVec to SLPTreeVec

---
 llvm/docs/SandboxVectorizer.md                | 16 +++----
 .../SandboxVectorizer/Passes/LoadStoreVec.h   |  2 +-
 .../Passes/RegionsFromMetadata.h              |  2 +-
 .../Passes/{BottomUpVec.h => SLPTreeVec.h}    | 19 ++++----
 .../SandboxVectorizer/Passes/SeedCollection.h |  2 +-
 llvm/lib/Transforms/Vectorize/CMakeLists.txt  |  2 +-
 .../SandboxVectorizer/Passes/PassRegistry.def |  2 +-
 .../{BottomUpVec.cpp => SLPTreeVec.cpp}       | 45 +++++++++----------
 .../SandboxVectorizer/SandboxVectorizer.cpp   |  6 +--
 .../SandboxVectorizerPassBuilder.cpp          |  2 +-
 .../SandboxVectorizer/allow_files.ll          | 16 +++----
 .../Transforms/SandboxVectorizer/cross_bbs.ll |  2 +-
 .../default_pass_pipeline.ll                  |  2 +-
 .../SandboxVectorizer/external_uses.ll        |  2 +-
 .../SandboxVectorizer/load_store_vec.ll       |  2 +-
 .../test/Transforms/SandboxVectorizer/pack.ll |  2 +-
 .../pack_reuse_end_to_end.ll                  |  4 +-
 .../SandboxVectorizer/repeated_instrs.ll      |  2 +-
 .../Transforms/SandboxVectorizer/scheduler.ll |  2 +-
 .../{bottomup_basic.ll => slp_tree_basic.ll}  |  4 +-
 ...p_seed_slice.ll => slp_tree_seed_slice.ll} |  2 +-
 ...ce_pow2.ll => slp_tree_seed_slice_pow2.ll} |  4 +-
 .../SandboxVectorizer/special_opcodes.ll      |  2 +-
 .../Transforms/SandboxVectorizer/stop_at.ll   |  6 +--
 .../Transforms/SandboxVectorizer/stop_bndl.ll | 10 ++---
 .../llvm/lib/Transforms/Vectorize/BUILD.gn    |  2 +-
 26 files changed, 81 insertions(+), 81 deletions(-)
 rename llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/{BottomUpVec.h => SLPTreeVec.h} (88%)
 rename llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/{BottomUpVec.cpp => SLPTreeVec.cpp} (93%)
 rename llvm/test/Transforms/SandboxVectorizer/{bottomup_basic.ll => slp_tree_basic.ll} (99%)
 rename llvm/test/Transforms/SandboxVectorizer/{bottomup_seed_slice.ll => slp_tree_seed_slice.ll} (92%)
 rename llvm/test/Transforms/SandboxVectorizer/{bottomup_seed_slice_pow2.ll => slp_tree_seed_slice_pow2.ll} (92%)

diff --git a/llvm/docs/SandboxVectorizer.md b/llvm/docs/SandboxVectorizer.md
index b2fe9b44b85dd..7916e6444ab90 100644
--- a/llvm/docs/SandboxVectorizer.md
+++ b/llvm/docs/SandboxVectorizer.md
@@ -32,7 +32,7 @@ The first component is the conversion of `LLVM IR to Sandbox IR` which converts
 From this point on the pass operates on Sandbox IR.
 The main entry point to the internal pass pipeline is the `Sandbox IR Function Pass Manger`, which runs all registered function passes.
 The following figure lists only a single Sandbox IR function pass, the `Seed Collection Pass` which goes over the instructions in the function and collects vectorization candidates, like Stores to consecutive memory addresses, and forms a [Region](#region).
-The `Seed Collection Pass` itself contains its own Region pass pipeline, which in the following example contains a `Transaction Save` pass, a `Bottom-Up Vectorization` pass, a `Pack Reuse` pass and a `Transaction Accept/Revert` pass.
+The `Seed Collection Pass` itself contains its own Region pass pipeline, which in the following example contains a `Transaction Save` pass, an `SLP-Tree Vectorization` pass, a `Pack Reuse` pass and a `Transaction Accept/Revert` pass.
 
 ```
 ┌────────────────────────────────── Sandbox Vectorizer LLVM Function Pass ─────────────────────────────┐
@@ -43,7 +43,7 @@ The `Seed Collection Pass` itself contains its own Region pass pipeline, which i
 │ │       │ │ │                                                                                  │   │ │
 │ │       │ │ │ ┌───────┐  For   ┌─────────────── sanboxir::Region Pass Manager ───────────────┐ │   │ │
 │ │LLVM IR│ │ │ │Collect│  each  │ ┌───────────┐ ┌────────────────┐ ┌───────┐ ┌──────────────┐ │ │   │ │
-│ │  to   │ │ │ │ Seeds │ Region │ │Transaction│ │   Bottom─Up    │ │ Pack  │ │ Transaction  │ │ │   │ │
+│ │  to   │ │ │ │ Seeds │ Region │ │Transaction│ │    SLP─Tree    │ │ Pack  │ │ Transaction  │ │ │   │ │
 │ │Sandbox│ │ │ │Create │ ─────> │ │   Save    │ │ Vectorization  │ │ Reuse │ │Accept/Revert │ │ │   │ │
 │ │  IR   │ │ │ │Regions│        │ └───────────┘ └────────────────┘ └───────┘ └──────────────┘ │ │   │ │
 │ │       │ │ │ └───────┘        └─────────────────────────────────────────────────────────────┘ │   │ │
@@ -59,7 +59,7 @@ You can specify your own custom pipeline with the `-sbvec-passes=` argument to `
 The pipeline shown above is equivalent to this:
 
 ```shell
-$ opt -p=sandbox-vectorizer -sbvec-passes='seed-collection<tr-save,bottom-up-vec,pack-reuse,tr-accept>' file.ll
+$ opt -p=sandbox-vectorizer -sbvec-passes='seed-collection<tr-save,slp-tree-vec,pack-reuse,tr-accept>' file.ll
 ```
 
 If the user does not define a pipeline, the Sandbox Vectorizer will run its default pass-pipeline, which is set in the constructor of the `SandboxVectorizerPass`.
@@ -75,7 +75,7 @@ There are two types of passes: [Transformation Passes](#transformation-passes) t
 |  **Pass Name**            |         **File Name**       | **Type** |                     **Description**                     |
 |---------------------------|-----------------------------|----------|---------------------------------------------------------|
 | `seed-collection`         | SeedCollection.h            | Function | Collects the instructions to start vectorizing from, creates a region and runs the region-pass pipeline |
-| `bottom-up-vec`           | BottomUpVec.h               | Region   | An SLP-style bottom-up vectorizer. It can vectorize both scalars and vectors |
+| `slp-tree-vec`            | SLPTreeVec.h                | Region   | An SLP-style bottom-up vectorizer. It can vectorize both scalars and vectors |
 | `pack-reuse`              | PackReuse.h                 | Region   | A pass that de-duplicates packs                         |
 | `load-store-vec`          | LoadStoreVec.h              | Region   | Vectorize load-store chains                             |
 
@@ -179,7 +179,7 @@ So the following example defines one region (region `!0`) containing all three `
    !2 = !{i32 1}
 ```
 
-The auxiliary vector is currently used by the Seed Collection pass to communicate a group of seed instructions to the Bottom-Up-Vectorizer pass.
+The auxiliary vector is currently used by the Seed Collection pass to communicate a group of seed instructions to the SLP-Tree-Vectorizer pass.
 
 ## Testing Sandbox Vectorizer Passes In Isolation
 
@@ -264,7 +264,7 @@ The main interface function for the Dependency Graph is `DependencyGraph::extend
 ### InstrMaps
 
 Instruction Maps is a helper data structure that maintains a mapping between the original (often scalar) instructions and their corresponding vector instructions and the reverse.
-It is used by the `bottom-up-vec` region pass for tracing vector instructions back to the original instructions and the reverse.
+It is used by the `slp-tree-vec` region pass for tracing vector instructions back to the original instructions and the reverse.
 
 
 ## Debugging
@@ -275,5 +275,5 @@ There are a couple of useful `cl::opt` options for debugging the vectorizer, tha
 |---------------------------------|----------------------------------------------------|
 | `-sbvec-allow-files=<regex>`    | Enables the Sandbox Vectorizer as a whole only for source files matching the comma-separated list of regular expressions. |
 | `-sbvec-passes=<pass-pipeline>` | Allows you to change the internal pass pipeline and skip any potentially broken passes. |
-| `-sbvec-stop-at=<num>`          | Will stop invoking the bottom-up-vectorizer if the invocation count is greater or equal to `<num>`. |
-| `-sbvec-stop-bndl=<num>`        | Limits the vectorization depth of the bottom-up vectorizer to `<num>`. This means that the vectorizer will emit a pack and stop vectorizing further. |
+| `-sbvec-stop-at=<num>`          | Will stop invoking the slp-tree-vectorizer if the invocation count is greater or equal to `<num>`. |
+| `-sbvec-stop-bndl=<num>`        | Limits the vectorization depth of the SLP-tree vectorizer to `<num>`. This means that the vectorizer will emit a pack and stop vectorizing further. |
diff --git a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/LoadStoreVec.h b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/LoadStoreVec.h
index 9b762cac553b8..3ae6fc5d8b54e 100644
--- a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/LoadStoreVec.h
+++ b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/LoadStoreVec.h
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 //
 // A pass that vectorizes short store-load chains.
-// Unlike generic bottom-up vectorization, this pass can vectorize instructions
+// Unlike generic SLP-tree vectorization, this pass can vectorize instructions
 // of different types.
 //
 
diff --git a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/RegionsFromMetadata.h b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/RegionsFromMetadata.h
index ea6b66389b335..a0ccb3606fafa 100644
--- a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/RegionsFromMetadata.h
+++ b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/RegionsFromMetadata.h
@@ -8,7 +8,7 @@
 //
 // A SandboxIR function pass that builds regions from IR metadata and then runs
 // a pipeline of region passes on them. This is useful to test region passes in
-// isolation without relying on the output of the bottom-up vectorizer.
+// isolation without relying on the output of the SLP-tree vectorizer.
 //
 
 #ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_REGIONSFROMMETADATA_H
diff --git a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.h b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/SLPTreeVec.h
similarity index 88%
rename from llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.h
rename to llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/SLPTreeVec.h
index 50ac1ecbf9f23..291687788daeb 100644
--- a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.h
+++ b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/SLPTreeVec.h
@@ -1,4 +1,4 @@
-//===- BottomUpVec.h --------------------------------------------*- C++ -*-===//
+//===- SLPTreeVec.h ---------------------------------------------*- C++ -*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -6,11 +6,12 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// A Bottom-Up Vectorizer pass.
+// An SLP-style vectorizer pass that builds a bottom-up / top-down vectorization
+// tree.
 //
 
-#ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_BOTTOMUPVEC_H
-#define LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_BOTTOMUPVEC_H
+#ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_SLPTREEVEC_H
+#define LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_SLPTREEVEC_H
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
@@ -22,7 +23,7 @@
 
 namespace llvm::sandboxir {
 
-/// This is a simple bottom-up vectorizer Region pass.
+/// This is a simple SLP-style vectorizer Region pass.
 /// It expects a "seed slice" as an input in the Region's Aux vector.
 /// The "seed slice" is a vector of instructions that can be used as a starting
 /// point for vectorization, like stores to consecutive memory addresses.
@@ -32,7 +33,7 @@ namespace llvm::sandboxir {
 /// profitable or not. For now profitability is checked at the end of the region
 /// pass pipeline by a dedicated pass that accepts or rejects the IR
 /// transaction, depending on the cost.
-class LLVM_ABI BottomUpVec final : public RegionPass {
+class LLVM_ABI SLPTreeVec final : public RegionPass {
   bool Change = false;
   /// The original instructions that are potentially dead after vectorization.
   DenseSet<Instruction *> DeadInstrCandidates;
@@ -40,7 +41,7 @@ class LLVM_ABI BottomUpVec final : public RegionPass {
   std::unique_ptr<InstrMaps> IMaps;
   /// Counter used for force-stopping the vectorizer after this many
   /// invocations. Used for debugging miscompiles.
-  unsigned long BottomUpInvocationCnt = 0;
+  unsigned long InvocationCnt = 0;
 
   /// Creates and returns a vector instruction that replaces the instructions in
   /// \p Bndl. \p Operands are the already vectorized operands.
@@ -98,7 +99,7 @@ class LLVM_ABI BottomUpVec final : public RegionPass {
   bool tryVectorize(ArrayRef<Value *> Seeds, LegalityAnalysis &Legality);
 
 public:
-  BottomUpVec(StringRef AuxArg) : RegionPass("bottom-up-vec") {
+  SLPTreeVec(StringRef AuxArg) : RegionPass("slp-tree-vec") {
     assert(AuxArg.empty() && "This pass ignores aux arg!");
   }
   bool runOnRegion(Region &Rgn, const Analyses &A) final;
@@ -106,4 +107,4 @@ class LLVM_ABI BottomUpVec final : public RegionPass {
 
 } // namespace llvm::sandboxir
 
-#endif // LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_BOTTOMUPVEC_H
+#endif // LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_SLPTREEVEC_H
diff --git a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/SeedCollection.h b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/SeedCollection.h
index 80c779b32d2b6..de71605482934 100644
--- a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/SeedCollection.h
+++ b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/SeedCollection.h
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// The seed-collection pass of the bottom-up vectorizer.
+// The seed-collection pass of the SLP-tree vectorizer.
 //
 
 #ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_SEEDCOLLECTION_H
diff --git a/llvm/lib/Transforms/Vectorize/CMakeLists.txt b/llvm/lib/Transforms/Vectorize/CMakeLists.txt
index 220e71491811e..5277f07e53c3b 100644
--- a/llvm/lib/Transforms/Vectorize/CMakeLists.txt
+++ b/llvm/lib/Transforms/Vectorize/CMakeLists.txt
@@ -8,11 +8,11 @@ add_llvm_component_library(LLVMVectorize
   SandboxVectorizer/InstrMaps.cpp
   SandboxVectorizer/Interval.cpp
   SandboxVectorizer/Legality.cpp
-  SandboxVectorizer/Passes/BottomUpVec.cpp
   SandboxVectorizer/Passes/LoadStoreVec.cpp
   SandboxVectorizer/Passes/PackReuse.cpp
   SandboxVectorizer/Passes/RegionsFromBBs.cpp
   SandboxVectorizer/Passes/RegionsFromMetadata.cpp
+  SandboxVectorizer/Passes/SLPTreeVec.cpp
   SandboxVectorizer/Passes/SeedCollection.cpp
   SandboxVectorizer/Passes/TransactionAcceptOrRevert.cpp
   SandboxVectorizer/Passes/TransactionSave.cpp
diff --git a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/PassRegistry.def b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/PassRegistry.def
index 10ba595910ee9..eb72581fa1ba5 100644
--- a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/PassRegistry.def
+++ b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/PassRegistry.def
@@ -25,7 +25,7 @@ REGION_PASS("tr-save", ::llvm::sandboxir::TransactionSave)
 REGION_PASS("tr-accept", ::llvm::sandboxir::TransactionAlwaysAccept)
 REGION_PASS("tr-revert", ::llvm::sandboxir::TransactionAlwaysRevert)
 REGION_PASS("tr-accept-or-revert", ::llvm::sandboxir::TransactionAcceptOrRevert)
-REGION_PASS("bottom-up-vec", ::llvm::sandboxir::BottomUpVec)
+REGION_PASS("slp-tree-vec", ::llvm::sandboxir::SLPTreeVec)
 REGION_PASS("load-store-vec", ::llvm::sandboxir::LoadStoreVec)
 
 #undef REGION_PASS
diff --git a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.cpp b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/SLPTreeVec.cpp
similarity index 93%
rename from llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.cpp
rename to llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/SLPTreeVec.cpp
index d0f8b7ad12e34..19b49ff0d0ac7 100644
--- a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.cpp
+++ b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/SLPTreeVec.cpp
@@ -1,4 +1,4 @@
-//===- BottomUpVec.cpp - A bottom-up vectorizer pass ----------------------===//
+//===- SLPTreeVec.cpp - An SLP-tree vectorizer pass -----------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.h"
+#include "llvm/Transforms/Vectorize/SandboxVectorizer/Passes/SLPTreeVec.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/SandboxIR/Function.h"
 #include "llvm/SandboxIR/Instruction.h"
@@ -64,8 +64,8 @@ static BasicBlock::iterator getInsertPointAfterInstrs(ArrayRef<Value *> Vals,
   return std::next(BotI->getIterator());
 }
 
-Value *BottomUpVec::createVectorInstr(ArrayRef<Value *> Bndl,
-                                      ArrayRef<Value *> Operands) {
+Value *SLPTreeVec::createVectorInstr(ArrayRef<Value *> Bndl,
+                                     ArrayRef<Value *> Operands) {
   auto CreateVectorInstr = [](ArrayRef<Value *> Bndl,
                               ArrayRef<Value *> Operands) -> Value * {
     assert(all_of(Bndl, [](auto *V) { return isa<Instruction>(V); }) &&
@@ -175,7 +175,7 @@ Value *BottomUpVec::createVectorInstr(ArrayRef<Value *> Bndl,
   return NewI;
 }
 
-void BottomUpVec::tryEraseDeadInstrs() {
+void SLPTreeVec::tryEraseDeadInstrs() {
   DenseMap<BasicBlock *, SmallVector<Instruction *>> SortedDeadInstrCandidates;
   // The dead instrs could span BBs, so we need to collect and sort them per BB.
   for (auto *DeadI : DeadInstrCandidates)
@@ -195,14 +195,14 @@ void BottomUpVec::tryEraseDeadInstrs() {
   DeadInstrCandidates.clear();
 }
 
-Value *BottomUpVec::createShuffle(Value *VecOp, const ShuffleMask &Mask,
-                                  BasicBlock *UserBB) {
+Value *SLPTreeVec::createShuffle(Value *VecOp, const ShuffleMask &Mask,
+                                 BasicBlock *UserBB) {
   BasicBlock::iterator WhereIt = getInsertPointAfterInstrs({VecOp}, UserBB);
   return ShuffleVectorInst::create(VecOp, VecOp, Mask, WhereIt,
                                    VecOp->getContext(), "VShuf");
 }
 
-Value *BottomUpVec::createPack(ArrayRef<Value *> ToPack, BasicBlock *UserBB) {
+Value *SLPTreeVec::createPack(ArrayRef<Value *> ToPack, BasicBlock *UserBB) {
   BasicBlock::iterator WhereIt = getInsertPointAfterInstrs(ToPack, UserBB);
 
   Type *ScalarTy = VecUtils::getCommonScalarType(ToPack);
@@ -253,7 +253,7 @@ Value *BottomUpVec::createPack(ArrayRef<Value *> ToPack, BasicBlock *UserBB) {
   return LastInsert;
 }
 
-void BottomUpVec::collectPotentiallyDeadInstrs(ArrayRef<Value *> Bndl) {
+void SLPTreeVec::collectPotentiallyDeadInstrs(ArrayRef<Value *> Bndl) {
   for (Value *V : Bndl)
     DeadInstrCandidates.insert(cast<Instruction>(V));
   // Also collect the GEPs of vectorized loads and stores.
@@ -278,9 +278,9 @@ void BottomUpVec::collectPotentiallyDeadInstrs(ArrayRef<Value *> Bndl) {
   }
 }
 
-Action *BottomUpVec::vectorizeRec(ArrayRef<Value *> Bndl,
-                                  ArrayRef<Value *> UserBndl, unsigned Depth,
-                                  LegalityAnalysis &Legality) {
+Action *SLPTreeVec::vectorizeRec(ArrayRef<Value *> Bndl,
+                                 ArrayRef<Value *> UserBndl, unsigned Depth,
+                                 LegalityAnalysis &Legality) {
   bool StopForDebug =
       DebugBndlCnt++ >= StopBundle && StopBundle != StopBundleDisabled;
   LLVM_DEBUG(dbgs() << DEBUG_PREFIX << "canVectorize() Bundle:\n";
@@ -331,17 +331,17 @@ Action *BottomUpVec::vectorizeRec(ArrayRef<Value *> Bndl,
 }
 
 #ifndef NDEBUG
-void BottomUpVec::ActionsVector::print(raw_ostream &OS) const {
+void SLPTreeVec::ActionsVector::print(raw_ostream &OS) const {
   for (auto [Idx, Action] : enumerate(Actions)) {
     Action->print(OS);
     OS << "\n";
   }
 }
-void BottomUpVec::ActionsVector::dump() const { print(dbgs()); }
+void SLPTreeVec::ActionsVector::dump() const { print(dbgs()); }
 #endif // NDEBUG
 
-void BottomUpVec::emitUnpacksForExternalUses(const ArrayRef<Value *> Bndl,
-                                             Value *Vec) {
+void SLPTreeVec::emitUnpacksForExternalUses(const ArrayRef<Value *> Bndl,
+                                            Value *Vec) {
   // Find where we should emit the unpacks.
   BasicBlock::iterator WhereIt;
   if (auto *VecI = dyn_cast<Instruction>(Vec)) {
@@ -372,7 +372,7 @@ void BottomUpVec::emitUnpacksForExternalUses(const ArrayRef<Value *> Bndl,
   }
 }
 
-Value *BottomUpVec::emitVectors() {
+Value *SLPTreeVec::emitVectors() {
   Value *NewVec = nullptr;
   for (const auto &ActionPtr : Actions) {
     ArrayRef<Value *> Bndl = ActionPtr->Bndl;
@@ -515,25 +515,24 @@ Value *BottomUpVec::emitVectors() {
   return NewVec;
 }
 
-bool BottomUpVec::tryVectorize(ArrayRef<Value *> Bndl,
-                               LegalityAnalysis &Legality) {
+bool SLPTreeVec::tryVectorize(ArrayRef<Value *> Bndl,
+                              LegalityAnalysis &Legality) {
   Change = false;
-  if (LLVM_UNLIKELY(BottomUpInvocationCnt++ >= StopAt &&
-                    StopAt != StopAtDisabled))
+  if (LLVM_UNLIKELY(InvocationCnt++ >= StopAt && StopAt != StopAtDisabled))
     return false;
   DeadInstrCandidates.clear();
   Legality.clear();
   Actions.clear();
   DebugBndlCnt = 0;
   vectorizeRec(Bndl, {}, /*Depth=*/0, Legality);
-  LLVM_DEBUG(dbgs() << DEBUG_PREFIX << "BottomUpVec: Vectorization Actions:\n";
+  LLVM_DEBUG(dbgs() << DEBUG_PREFIX << "SLPTreeVec: Vectorization Actions:\n";
              Actions.dump());
   emitVectors();
   tryEraseDeadInstrs();
   return Change;
 }
 
-bool BottomUpVec::runOnRegion(Region &Rgn, const Analyses &A) {
+bool SLPTreeVec::runOnRegion(Region &Rgn, const Analyses &A) {
   const auto &SeedSlice = Rgn.getAux();
   assert(SeedSlice.size() >= 2 && "Bad slice!");
   Function &F = *SeedSlice[0]->getParent()->getParent();
diff --git a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizer.cpp
index 55eb54ae39ad0..4ddf83cc1ad5e 100644
--- a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizer.cpp
@@ -49,11 +49,11 @@ SandboxVectorizerPass::SandboxVectorizerPass() : FPM("fpm") {
   if (UserDefinedPassPipeline == DefaultPipelineMagicStr) {
     // TODO: Add passes to the default pipeline. It currently contains:
     //       - Seed collection, which creates seed regions and runs the pipeline
-    //         - Bottom-up Vectorizer pass that starts from a seed
+    //         - SLP-tree Vectorizer pass that starts from a seed
     //         - Load-Store Vectorizer pass for load-store chains
     //         - Accept or revert IR state pass
     FPM.setPassPipeline(
-        "seed-collection<tr-save,bottom-up-vec,load-store-vec,tr-accept-or-"
+        "seed-collection<tr-save,slp-tree-vec,load-store-vec,tr-accept-or-"
         "revert>",
         sandboxir::SandboxVectorizerPassBuilder::createFunctionPass);
   } else {
@@ -133,7 +133,7 @@ bool SandboxVectorizerPass::runImpl(Function &LLVMF) {
     return false;
   }
 
-  // Create SandboxIR for LLVMF and run BottomUpVec on it.
+  // Create SandboxIR for LLVMF and run SLPTreeVec on it.
   sandboxir::Function &F = *Ctx->createFunction(&LLVMF);
   sandboxir::Analyses A(*AA, *SE, *TTI);
   bool Change = FPM.runOnFunction(F, A);
diff --git a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizerPassBuilder.cpp b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizerPassBuilder.cpp
index e21c506b0d82b..b2ef0341a90d6 100644
--- a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizerPassBuilder.cpp
+++ b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizerPassBuilder.cpp
@@ -1,6 +1,5 @@
 #include "llvm/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizerPassBuilder.h"
 
-#include "llvm/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.h"
 #include "llvm/Transforms/Vectorize/SandboxVectorizer/Passes/LoadStoreVec.h"
 #include "llvm/Transforms/Vectorize/SandboxVectorizer/Passes/NullPass.h"
 #include "llvm/Transforms/Vectorize/SandboxVectorizer/Passes/PackReuse.h"
@@ -8,6 +7,7 @@
 #include "llvm/Transforms/Vectorize/SandboxVectorizer/Passes/PrintRegion.h"
 #include "llvm/Transforms/Vectorize/SandboxVectorizer/Passes/RegionsFromBBs.h"
 #include "llvm/Transforms/Vectorize/SandboxVectorizer/Passes/RegionsFromMetadata.h"
+#include "llvm/Transforms/Vectorize/SandboxVectorizer/Passes/SLPTreeVec.h"
 #include "llvm/Transforms/Vectorize/SandboxVectorizer/Passes/SeedCollection.h"
 #include "llvm/Transforms/Vectorize/SandboxVectorizer/Passes/TransactionAcceptOrRevert.h"
 #include "llvm/Transforms/Vectorize/SandboxVectorizer/Passes/TransactionAlwaysAccept.h"
diff --git a/llvm/test/Transforms/SandboxVectorizer/allow_files.ll b/llvm/test/Transforms/SandboxVectorizer/allow_files.ll
index 0929eca6a1047..02ff8f87fc559 100644
--- a/llvm/test/Transforms/SandboxVectorizer/allow_files.ll
+++ b/llvm/test/Transforms/SandboxVectorizer/allow_files.ll
@@ -1,11 +1,11 @@
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" -sbvec-allow-files="some_other_file" %s -S | FileCheck %s --check-prefix=ALLOW_OTHER
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" -sbvec-allow-files="allow_files.ll" %s -S | FileCheck %s --check-prefix=ALLOW_THIS
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" -sbvec-allow-files="al.*_files.ll" %s -S | FileCheck %s --check-prefix=ALLOW_REGEX
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" -sbvec-allow-files="some_file,.*_files.ll,some_other_file" %s -S | FileCheck %s --check-prefix=ALLOW_REGEX_CSV
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" -sbvec-allow-files="allow" %s -S | FileCheck %s --check-prefix=ALLOW_BAD_REGEX
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" -sbvec-allow-files="some_file,some_other_file1,some_other_file2" %s -S | FileCheck %s --check-prefix=ALLOW_OTHER_CSV
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" -sbvec-allow-files="" %s -S | FileCheck %s --check-prefix=ALLOW_EMPTY
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" %s -S | FileCheck %s --check-prefix=DEFAULT
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>" -sbvec-allow-files="some_other_file" %s -S | FileCheck %s --check-prefix=ALLOW_OTHER
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>" -sbvec-allow-files="allow_files.ll" %s -S | FileCheck %s --check-prefix=ALLOW_THIS
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>" -sbvec-allow-files="al.*_files.ll" %s -S | FileCheck %s --check-prefix=ALLOW_REGEX
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>" -sbvec-allow-files="some_file,.*_files.ll,some_other_file" %s -S | FileCheck %s --check-prefix=ALLOW_REGEX_CSV
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>" -sbvec-allow-files="allow" %s -S | FileCheck %s --check-prefix=ALLOW_BAD_REGEX
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>" -sbvec-allow-files="some_file,some_other_file1,some_other_file2" %s -S | FileCheck %s --check-prefix=ALLOW_OTHER_CSV
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>" -sbvec-allow-files="" %s -S | FileCheck %s --check-prefix=ALLOW_EMPTY
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>" %s -S | FileCheck %s --check-prefix=DEFAULT
 
 ; Checks the command-line option `-sbvec-allow-files`.
 define void @widen(ptr %ptr) {
diff --git a/llvm/test/Transforms/SandboxVectorizer/cross_bbs.ll b/llvm/test/Transforms/SandboxVectorizer/cross_bbs.ll
index 21d2d9ba752e8..02e469e1ad79c 100644
--- a/llvm/test/Transforms/SandboxVectorizer/cross_bbs.ll
+++ b/llvm/test/Transforms/SandboxVectorizer/cross_bbs.ll
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" %s -S | FileCheck %s
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>" %s -S | FileCheck %s
 
 define void @cross_bbs(ptr %ptr) {
 ; CHECK-LABEL: define void @cross_bbs(
diff --git a/llvm/test/Transforms/SandboxVectorizer/default_pass_pipeline.ll b/llvm/test/Transforms/SandboxVectorizer/default_pass_pipeline.ll
index 86000da42c799..dc126a1e9558c 100644
--- a/llvm/test/Transforms/SandboxVectorizer/default_pass_pipeline.ll
+++ b/llvm/test/Transforms/SandboxVectorizer/default_pass_pipeline.ll
@@ -7,7 +7,7 @@ define void @pipeline() {
 ; CHECK: fpm
 ; CHECK: seed-collection
 ; CHECK: rpm
-; CHECK: bottom-up-vec
+; CHECK: slp-tree-vec
 ; CHECK: tr-accept-or-revert
 ; CHECK-EMPTY:
   ret void
diff --git a/llvm/test/Transforms/SandboxVectorizer/external_uses.ll b/llvm/test/Transforms/SandboxVectorizer/external_uses.ll
index 593965ab01680..eb56014d3750b 100644
--- a/llvm/test/Transforms/SandboxVectorizer/external_uses.ll
+++ b/llvm/test/Transforms/SandboxVectorizer/external_uses.ll
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" %s -S | FileCheck %s
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>" %s -S | FileCheck %s
 
 ; Checks the handling of users outside the vectorized graph.
 
diff --git a/llvm/test/Transforms/SandboxVectorizer/load_store_vec.ll b/llvm/test/Transforms/SandboxVectorizer/load_store_vec.ll
index cebccdee6ec01..5ea84c466e7d5 100644
--- a/llvm/test/Transforms/SandboxVectorizer/load_store_vec.ll
+++ b/llvm/test/Transforms/SandboxVectorizer/load_store_vec.ll
@@ -117,7 +117,7 @@ define void @load_store_vec_loads_not_consecutive(ptr %ptr) {
   ret void
 }
 
-; Vectorize same types, even if bottom-up-vec could do so too.
+; Vectorize same types, even if slp-tree-vec could do so too.
 define void @load_store_vec_same_types(ptr %ptr) {
 ; CHECK-LABEL: define void @load_store_vec_same_types(
 ; CHECK-SAME: ptr [[PTR:%.*]]) {
diff --git a/llvm/test/Transforms/SandboxVectorizer/pack.ll b/llvm/test/Transforms/SandboxVectorizer/pack.ll
index 743d705fd48ff..0d01a2379140f 100644
--- a/llvm/test/Transforms/SandboxVectorizer/pack.ll
+++ b/llvm/test/Transforms/SandboxVectorizer/pack.ll
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" %s -S | FileCheck %s
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>" %s -S | FileCheck %s
 
 define void @pack_constants(ptr %ptr) {
 ; CHECK-LABEL: define void @pack_constants(
diff --git a/llvm/test/Transforms/SandboxVectorizer/pack_reuse_end_to_end.ll b/llvm/test/Transforms/SandboxVectorizer/pack_reuse_end_to_end.ll
index 0861c7827c91c..0fdc6f004da2b 100644
--- a/llvm/test/Transforms/SandboxVectorizer/pack_reuse_end_to_end.ll
+++ b/llvm/test/Transforms/SandboxVectorizer/pack_reuse_end_to_end.ll
@@ -1,6 +1,6 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" %s -S | FileCheck %s --check-prefix NOREUSE
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,pack-reuse,tr-accept>" %s -S | FileCheck %s --check-prefix PKREUSE
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>" %s -S | FileCheck %s --check-prefix NOREUSE
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,pack-reuse,tr-accept>" %s -S | FileCheck %s --check-prefix PKREUSE
 
 define void @pack_reuse(ptr %ptr, ptr %ptrX, ptr %ptrY) {
 ; NOREUSE-LABEL: define void @pack_reuse(
diff --git a/llvm/test/Transforms/SandboxVectorizer/repeated_instrs.ll b/llvm/test/Transforms/SandboxVectorizer/repeated_instrs.ll
index 621261dcd83b8..675b7ba3596f6 100644
--- a/llvm/test/Transforms/SandboxVectorizer/repeated_instrs.ll
+++ b/llvm/test/Transforms/SandboxVectorizer/repeated_instrs.ll
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" %s -S | FileCheck %s
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>" %s -S | FileCheck %s
 
 define i32 @repeated_splat(ptr %ptr, i32 %v) #0 {
 ; CHECK-LABEL: define i32 @repeated_splat(
diff --git a/llvm/test/Transforms/SandboxVectorizer/scheduler.ll b/llvm/test/Transforms/SandboxVectorizer/scheduler.ll
index 86016b86f0830..50742efb0751c 100644
--- a/llvm/test/Transforms/SandboxVectorizer/scheduler.ll
+++ b/llvm/test/Transforms/SandboxVectorizer/scheduler.ll
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" %s -S | FileCheck %s
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>" %s -S | FileCheck %s
 
 ; This used to crash because the newly added pack   instructions would not update
 ; the DAG and scheduler, leading to def-after-use.
diff --git a/llvm/test/Transforms/SandboxVectorizer/bottomup_basic.ll b/llvm/test/Transforms/SandboxVectorizer/slp_tree_basic.ll
similarity index 99%
rename from llvm/test/Transforms/SandboxVectorizer/bottomup_basic.ll
rename to llvm/test/Transforms/SandboxVectorizer/slp_tree_basic.ll
index 6d846cfe73e8f..29f2e2bceb2bf 100644
--- a/llvm/test/Transforms/SandboxVectorizer/bottomup_basic.ll
+++ b/llvm/test/Transforms/SandboxVectorizer/slp_tree_basic.ll
@@ -1,6 +1,6 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" %s -S | FileCheck %s
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-revert>" %s -S | FileCheck %s --check-prefix REVERT
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>" %s -S | FileCheck %s
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-revert>" %s -S | FileCheck %s --check-prefix REVERT
 
 define void @store_load(ptr %ptr) {
 ; CHECK-LABEL: define void @store_load(
diff --git a/llvm/test/Transforms/SandboxVectorizer/bottomup_seed_slice.ll b/llvm/test/Transforms/SandboxVectorizer/slp_tree_seed_slice.ll
similarity index 92%
rename from llvm/test/Transforms/SandboxVectorizer/bottomup_seed_slice.ll
rename to llvm/test/Transforms/SandboxVectorizer/slp_tree_seed_slice.ll
index 4219281c47a55..b57c73cc9d344 100644
--- a/llvm/test/Transforms/SandboxVectorizer/bottomup_seed_slice.ll
+++ b/llvm/test/Transforms/SandboxVectorizer/slp_tree_seed_slice.ll
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" %s -S | FileCheck %s
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>" %s -S | FileCheck %s
 
 
 declare void @foo()
diff --git a/llvm/test/Transforms/SandboxVectorizer/bottomup_seed_slice_pow2.ll b/llvm/test/Transforms/SandboxVectorizer/slp_tree_seed_slice_pow2.ll
similarity index 92%
rename from llvm/test/Transforms/SandboxVectorizer/bottomup_seed_slice_pow2.ll
rename to llvm/test/Transforms/SandboxVectorizer/slp_tree_seed_slice_pow2.ll
index eeba283d71dd1..fcf62f296118a 100644
--- a/llvm/test/Transforms/SandboxVectorizer/bottomup_seed_slice_pow2.ll
+++ b/llvm/test/Transforms/SandboxVectorizer/slp_tree_seed_slice_pow2.ll
@@ -1,6 +1,6 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2=false -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" %s -S | FileCheck %s --check-prefix=POW2
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2=true -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" %s -S | FileCheck %s --check-prefix=NON-POW2
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2=false -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>" %s -S | FileCheck %s --check-prefix=POW2
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2=true -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>" %s -S | FileCheck %s --check-prefix=NON-POW2
 
 define void @pow2(ptr %ptr, float %val) {
 ; POW2-LABEL: define void @pow2(
diff --git a/llvm/test/Transforms/SandboxVectorizer/special_opcodes.ll b/llvm/test/Transforms/SandboxVectorizer/special_opcodes.ll
index be618df418318..7b5be197ef562 100644
--- a/llvm/test/Transforms/SandboxVectorizer/special_opcodes.ll
+++ b/llvm/test/Transforms/SandboxVectorizer/special_opcodes.ll
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" %s -S | FileCheck %s
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>" %s -S | FileCheck %s
 
 ; This file includes tests for opcodes that need special checks.
 
diff --git a/llvm/test/Transforms/SandboxVectorizer/stop_at.ll b/llvm/test/Transforms/SandboxVectorizer/stop_at.ll
index ae93c4fc28707..fc9581b751965 100644
--- a/llvm/test/Transforms/SandboxVectorizer/stop_at.ll
+++ b/llvm/test/Transforms/SandboxVectorizer/stop_at.ll
@@ -1,7 +1,7 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" --sbvec-stop-at=0 %s -S | FileCheck %s --check-prefix=STOPAT0
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" --sbvec-stop-at=1 %s -S | FileCheck %s --check-prefix=STOPAT1
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" --sbvec-stop-at=2 %s -S | FileCheck %s --check-prefix=STOPAT2
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>" --sbvec-stop-at=0 %s -S | FileCheck %s --check-prefix=STOPAT0
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>" --sbvec-stop-at=1 %s -S | FileCheck %s --check-prefix=STOPAT1
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>" --sbvec-stop-at=2 %s -S | FileCheck %s --check-prefix=STOPAT2
 
 define void @widen(ptr %ptrA, ptr %ptrB) {
 ; STOPAT0-LABEL: define void @widen(
diff --git a/llvm/test/Transforms/SandboxVectorizer/stop_bndl.ll b/llvm/test/Transforms/SandboxVectorizer/stop_bndl.ll
index cd099956a2c38..6e996e51d26b6 100644
--- a/llvm/test/Transforms/SandboxVectorizer/stop_bndl.ll
+++ b/llvm/test/Transforms/SandboxVectorizer/stop_bndl.ll
@@ -1,9 +1,9 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" -sbvec-stop-bndl=0 %s -S | FileCheck %s --check-prefix=STOP0
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" -sbvec-stop-bndl=1 %s -S | FileCheck %s --check-prefix=STOP1
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" -sbvec-stop-bndl=2 %s -S | FileCheck %s --check-prefix=STOP2
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>" -sbvec-stop-bndl=3 %s -S | FileCheck %s --check-prefix=STOP3
-; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,bottom-up-vec,tr-accept>"  %s -S | FileCheck %s --check-prefix=NOSTOP
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>" -sbvec-stop-bndl=0 %s -S | FileCheck %s --check-prefix=STOP0
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>" -sbvec-stop-bndl=1 %s -S | FileCheck %s --check-prefix=STOP1
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>" -sbvec-stop-bndl=2 %s -S | FileCheck %s --check-prefix=STOP2
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>" -sbvec-stop-bndl=3 %s -S | FileCheck %s --check-prefix=STOP3
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="seed-collection<tr-save,slp-tree-vec,tr-accept>"  %s -S | FileCheck %s --check-prefix=NOSTOP
 
 define void @stop_bndl(ptr %ptr) {
 ; STOP0-LABEL: define void @stop_bndl(
diff --git a/llvm/utils/gn/secondary/llvm/lib/Transforms/Vectorize/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/Transforms/Vectorize/BUILD.gn
index 5f78fdfe5a052..d8da93d27e4ef 100644
--- a/llvm/utils/gn/secondary/llvm/lib/Transforms/Vectorize/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/lib/Transforms/Vectorize/BUILD.gn
@@ -21,11 +21,11 @@ static_library("Vectorize") {
     "SandboxVectorizer/InstrMaps.cpp",
     "SandboxVectorizer/Interval.cpp",
     "SandboxVectorizer/Legality.cpp",
-    "SandboxVectorizer/Passes/BottomUpVec.cpp",
     "SandboxVectorizer/Passes/LoadStoreVec.cpp",
     "SandboxVectorizer/Passes/PackReuse.cpp",
     "SandboxVectorizer/Passes/RegionsFromBBs.cpp",
     "SandboxVectorizer/Passes/RegionsFromMetadata.cpp",
+    "SandboxVectorizer/Passes/SLPTreeVec.cpp",
     "SandboxVectorizer/Passes/SeedCollection.cpp",
     "SandboxVectorizer/Passes/TransactionAcceptOrRevert.cpp",
     "SandboxVectorizer/Passes/TransactionSave.cpp",



More information about the llvm-commits mailing list