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

Anshil Gandhi via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 2 21:33:33 PDT 2026


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

>From 87e45f4ad4f655591ce85250f713cf0ba64b2e4a 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] [SBVec] Rename BottomUpVec to BundleVec

---
 llvm/docs/SandboxVectorizer.md                | 16 +++----
 .../Passes/{BottomUpVec.h => BundleVec.h}     | 41 +++++++++---------
 .../SandboxVectorizer/Passes/LoadStoreVec.h   |  2 +-
 .../Passes/RegionsFromMetadata.h              |  2 +-
 .../SandboxVectorizer/Passes/SeedCollection.h |  2 +-
 llvm/lib/Transforms/Vectorize/CMakeLists.txt  |  2 +-
 .../Passes/{BottomUpVec.cpp => BundleVec.cpp} | 43 +++++++++----------
 .../SandboxVectorizer/Passes/PassRegistry.def |  2 +-
 .../SandboxVectorizer/SandboxVectorizer.cpp   |  8 ++--
 .../SandboxVectorizerPassBuilder.cpp          |  2 +-
 .../SandboxVectorizer/allow_files.ll          | 16 +++----
 .../{bottomup_basic.ll => bundle_basic.ll}    |  4 +-
 ...mup_seed_slice.ll => bundle_seed_slice.ll} |  2 +-
 ...lice_pow2.ll => bundle_seed_slice_pow2.ll} |  4 +-
 .../SandboxVectorizer/bundle_vec_aux_arg.ll   | 13 ++++++
 .../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 +-
 .../SandboxVectorizer/special_opcodes.ll      |  2 +-
 .../Transforms/SandboxVectorizer/stop_at.ll   |  6 +--
 .../Transforms/SandboxVectorizer/stop_bndl.ll | 10 ++---
 .../SandboxVectorizer/topdown_vec.ll          |  2 +-
 .../llvm/lib/Transforms/Vectorize/BUILD.gn    |  2 +-
 28 files changed, 105 insertions(+), 94 deletions(-)
 rename llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/{BottomUpVec.h => BundleVec.h} (77%)
 rename llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/{BottomUpVec.cpp => BundleVec.cpp} (94%)
 rename llvm/test/Transforms/SandboxVectorizer/{bottomup_basic.ll => bundle_basic.ll} (99%)
 rename llvm/test/Transforms/SandboxVectorizer/{bottomup_seed_slice.ll => bundle_seed_slice.ll} (92%)
 rename llvm/test/Transforms/SandboxVectorizer/{bottomup_seed_slice_pow2.ll => bundle_seed_slice_pow2.ll} (92%)
 create mode 100644 llvm/test/Transforms/SandboxVectorizer/bundle_vec_aux_arg.ll

diff --git a/llvm/docs/SandboxVectorizer.md b/llvm/docs/SandboxVectorizer.md
index b2fe9b44b85dd..d82caefb84259 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, a `Bundle 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│ │     Bundle     │ │ 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,bundle-vec(bottom-up),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 |
+| `bundle-vec`              | BundleVec.h                 | Region   | An SLP-style vectorizer that forms bundles by recursively walking the use-def (def-use) chains bottom-up (top-down). It can vectorize both scalars and vectors. Requires a `bottom-up` or `top-down` argument, e.g. `bundle-vec(bottom-up)` |
 | `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 Bundle 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 `bundle-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 bundle vectorizer if the invocation count is greater or equal to `<num>`. |
+| `-sbvec-stop-bndl=<num>`        | Limits the vectorization depth of the bundle 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/BottomUpVec.h b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/BundleVec.h
similarity index 77%
rename from llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.h
rename to llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/BundleVec.h
index fec4192f7626e..8cc2b8ffe5cd8 100644
--- a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.h
+++ b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/BundleVec.h
@@ -1,4 +1,4 @@
-//===- BottomUpVec.h --------------------------------------------*- C++ -*-===//
+//===- BundleVec.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,12 +6,12 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// A vectorizer pass that walks the def-use chain bottom-up or top-down,
-// depending on the auxiliary pass argument.
+// A vectorizer pass that forms bundles by walking the def-use chain bottom-up
+// or top-down, depending on the auxiliary pass argument.
 //
 
-#ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_BOTTOMUPVEC_H
-#define LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_BOTTOMUPVEC_H
+#ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_BUNDLEVEC_H
+#define LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_BUNDLEVEC_H
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
@@ -29,20 +29,20 @@ namespace llvm::sandboxir {
 /// 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 (loads) to consecutive memory
-/// addresses. Starting from the seed instructions, it walks up (down) the
-/// use-def (def-use) chains looking for more instructions that can be
-/// vectorized. This pass will generate vector code if it can legally vectorize
-/// the code, regardless of whether it is 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 {
+/// addresses. Starting from the seed instructions, it recursively walks up
+/// (down) the use-def (def-use) chains, forming a bundle of instructions per
+/// operand (user) position, for as long as these bundles can be vectorized.
+/// This pass will generate vector code if it can legally vectorize the code,
+/// regardless of whether it is 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 BundleVec final : public RegionPass {
 private:
   /// Set to true whenever the pass modifies the IR.
   bool Change = false;
   static constexpr StringRef TopDownArgStr = "top-down";
   static constexpr StringRef BottomUpArgStr = "bottom-up";
-  /// Direction for vectorization, defaults to bottom-up.
+  /// Direction for vectorization, set from the mandatory aux argument.
   SchedDirection Dir;
   /// The original instructions that are potentially dead after vectorization.
   DenseSet<Instruction *> DeadInstrCandidates;
@@ -50,7 +50,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.
@@ -108,17 +108,16 @@ class LLVM_ABI BottomUpVec final : public RegionPass {
   bool tryVectorize(ArrayRef<Value *> Seeds, LegalityAnalysis &Legality);
 
 public:
-  BottomUpVec(StringRef AuxArg) : RegionPass("bottom-up-vec") {
-    /// TODO: Drop the AuxArg.empty() part
-    if (AuxArg.empty() || AuxArg == BottomUpArgStr) {
+  BundleVec(StringRef AuxArg) : RegionPass("bundle-vec") {
+    if (AuxArg == BottomUpArgStr) {
       Dir = SchedDirection::BottomUp;
     } else if (AuxArg == TopDownArgStr) {
       Dir = SchedDirection::TopDown;
     } else {
       std::string ErrStr;
       raw_string_ostream ErrSS(ErrStr);
-      ErrSS << "bottom-up-vec only supports '" << BottomUpArgStr << "' or '"
-            << TopDownArgStr << "' aux argument!\n";
+      ErrSS << "bundle-vec requires either '" << BottomUpArgStr << "' or '"
+            << TopDownArgStr << "' as its aux argument!\n";
       reportFatalUsageError(ErrStr.c_str());
     }
   }
@@ -128,4 +127,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_BUNDLEVEC_H
diff --git a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/LoadStoreVec.h b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/LoadStoreVec.h
index 9b762cac553b8..7d771bf49f897 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 bundle 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..56745f0327461 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 bundle vectorizer.
 //
 
 #ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_REGIONSFROMMETADATA_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..277fed23efc25 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 bundle 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..7a134a375309e 100644
--- a/llvm/lib/Transforms/Vectorize/CMakeLists.txt
+++ b/llvm/lib/Transforms/Vectorize/CMakeLists.txt
@@ -8,7 +8,7 @@ add_llvm_component_library(LLVMVectorize
   SandboxVectorizer/InstrMaps.cpp
   SandboxVectorizer/Interval.cpp
   SandboxVectorizer/Legality.cpp
-  SandboxVectorizer/Passes/BottomUpVec.cpp
+  SandboxVectorizer/Passes/BundleVec.cpp
   SandboxVectorizer/Passes/LoadStoreVec.cpp
   SandboxVectorizer/Passes/PackReuse.cpp
   SandboxVectorizer/Passes/RegionsFromBBs.cpp
diff --git a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.cpp b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/BundleVec.cpp
similarity index 94%
rename from llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.cpp
rename to llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/BundleVec.cpp
index 77d47b6bbc1e7..a0cc78c465db5 100644
--- a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.cpp
+++ b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/BundleVec.cpp
@@ -1,4 +1,4 @@
-//===- BottomUpVec.cpp - A bottom-up vectorizer pass ----------------------===//
+//===- BundleVec.cpp - A bundle-forming SLP-style 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/BundleVec.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/SandboxIR/Function.h"
 #include "llvm/SandboxIR/Instruction.h"
@@ -65,8 +65,8 @@ static BasicBlock::iterator getInsertPointAfterInstrs(ArrayRef<Value *> Vals,
   return std::next(BotI->getIterator());
 }
 
-Value *BottomUpVec::createVectorInstr(ArrayRef<Value *> Bndl,
-                                      ArrayRef<Value *> Operands) {
+Value *BundleVec::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); }) &&
@@ -176,7 +176,7 @@ Value *BottomUpVec::createVectorInstr(ArrayRef<Value *> Bndl,
   return NewI;
 }
 
-void BottomUpVec::tryEraseDeadInstrs() {
+void BundleVec::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)
@@ -196,14 +196,14 @@ void BottomUpVec::tryEraseDeadInstrs() {
   DeadInstrCandidates.clear();
 }
 
-Value *BottomUpVec::createShuffle(Value *VecOp, const ShuffleMask &Mask,
-                                  BasicBlock *UserBB) {
+Value *BundleVec::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 *BundleVec::createPack(ArrayRef<Value *> ToPack, BasicBlock *UserBB) {
   BasicBlock::iterator WhereIt = getInsertPointAfterInstrs(ToPack, UserBB);
 
   Type *ScalarTy = VecUtils::getCommonScalarType(ToPack);
@@ -254,7 +254,7 @@ Value *BottomUpVec::createPack(ArrayRef<Value *> ToPack, BasicBlock *UserBB) {
   return LastInsert;
 }
 
-void BottomUpVec::collectPotentiallyDeadInstrs(ArrayRef<Value *> Bndl) {
+void BundleVec::collectPotentiallyDeadInstrs(ArrayRef<Value *> Bndl) {
   for (Value *V : Bndl)
     DeadInstrCandidates.insert(cast<Instruction>(V));
   // Also collect the GEPs of vectorized loads and stores.
@@ -279,9 +279,9 @@ void BottomUpVec::collectPotentiallyDeadInstrs(ArrayRef<Value *> Bndl) {
   }
 }
 
-Action *BottomUpVec::vectorizeRec(ArrayRef<Value *> Bndl,
-                                  ArrayRef<Value *> UserBndl, unsigned Depth,
-                                  LegalityAnalysis &Legality) {
+Action *BundleVec::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";
@@ -358,17 +358,17 @@ Action *BottomUpVec::vectorizeRec(ArrayRef<Value *> Bndl,
 }
 
 #ifndef NDEBUG
-void BottomUpVec::ActionsVector::print(raw_ostream &OS) const {
+void BundleVec::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 BundleVec::ActionsVector::dump() const { print(dbgs()); }
 #endif // NDEBUG
 
-void BottomUpVec::emitUnpacksForExternalUses(const ArrayRef<Value *> Bndl,
-                                             Value *Vec) {
+void BundleVec::emitUnpacksForExternalUses(const ArrayRef<Value *> Bndl,
+                                           Value *Vec) {
   // Find where we should emit the unpacks.
   BasicBlock::iterator WhereIt;
   if (auto *VecI = dyn_cast<Instruction>(Vec)) {
@@ -405,7 +405,7 @@ void BottomUpVec::emitUnpacksForExternalUses(const ArrayRef<Value *> Bndl,
   }
 }
 
-Value *BottomUpVec::emitVectors() {
+Value *BundleVec::emitVectors() {
   Value *NewVec = nullptr;
   for (const auto &ActionPtr : Actions) {
     ArrayRef<Value *> Bndl = ActionPtr->Bndl;
@@ -570,11 +570,10 @@ Value *BottomUpVec::emitVectors() {
   return NewVec;
 }
 
-bool BottomUpVec::tryVectorize(ArrayRef<Value *> Bndl,
-                               LegalityAnalysis &Legality) {
+bool BundleVec::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();
@@ -589,7 +588,7 @@ bool BottomUpVec::tryVectorize(ArrayRef<Value *> Bndl,
   return Change;
 }
 
-bool BottomUpVec::runOnRegion(Region &Rgn, const Analyses &A) {
+bool BundleVec::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/Passes/PassRegistry.def b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/PassRegistry.def
index 10ba595910ee9..f1e06b0d70d61 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("bundle-vec", ::llvm::sandboxir::BundleVec)
 REGION_PASS("load-store-vec", ::llvm::sandboxir::LoadStoreVec)
 
 #undef REGION_PASS
diff --git a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizer.cpp
index 55eb54ae39ad0..01a161bd2b8d8 100644
--- a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizer.cpp
@@ -49,12 +49,12 @@ 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
+    //         - Bundle 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-"
-        "revert>",
+        "seed-collection<tr-save,bundle-vec(bottom-up),load-store-vec,"
+        "tr-accept-or-revert>",
         sandboxir::SandboxVectorizerPassBuilder::createFunctionPass);
   } else {
     // Create the user-defined pipeline.
@@ -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 BundleVec 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..7e4b088903cfa 100644
--- a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizerPassBuilder.cpp
+++ b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizerPassBuilder.cpp
@@ -1,6 +1,6 @@
 #include "llvm/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizerPassBuilder.h"
 
-#include "llvm/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.h"
+#include "llvm/Transforms/Vectorize/SandboxVectorizer/Passes/BundleVec.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"
diff --git a/llvm/test/Transforms/SandboxVectorizer/allow_files.ll b/llvm/test/Transforms/SandboxVectorizer/allow_files.ll
index 0929eca6a1047..b2c62e4b57a57 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,bundle-vec(bottom-up),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,bundle-vec(bottom-up),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,bundle-vec(bottom-up),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,bundle-vec(bottom-up),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,bundle-vec(bottom-up),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,bundle-vec(bottom-up),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,bundle-vec(bottom-up),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,bundle-vec(bottom-up),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/bottomup_basic.ll b/llvm/test/Transforms/SandboxVectorizer/bundle_basic.ll
similarity index 99%
rename from llvm/test/Transforms/SandboxVectorizer/bottomup_basic.ll
rename to llvm/test/Transforms/SandboxVectorizer/bundle_basic.ll
index 6d846cfe73e8f..9bc2120b67dce 100644
--- a/llvm/test/Transforms/SandboxVectorizer/bottomup_basic.ll
+++ b/llvm/test/Transforms/SandboxVectorizer/bundle_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,bundle-vec(bottom-up),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,bundle-vec(bottom-up),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/bundle_seed_slice.ll
similarity index 92%
rename from llvm/test/Transforms/SandboxVectorizer/bottomup_seed_slice.ll
rename to llvm/test/Transforms/SandboxVectorizer/bundle_seed_slice.ll
index 4219281c47a55..f3401bdec0db3 100644
--- a/llvm/test/Transforms/SandboxVectorizer/bottomup_seed_slice.ll
+++ b/llvm/test/Transforms/SandboxVectorizer/bundle_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,bundle-vec(bottom-up),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/bundle_seed_slice_pow2.ll
similarity index 92%
rename from llvm/test/Transforms/SandboxVectorizer/bottomup_seed_slice_pow2.ll
rename to llvm/test/Transforms/SandboxVectorizer/bundle_seed_slice_pow2.ll
index eeba283d71dd1..4576a801de359 100644
--- a/llvm/test/Transforms/SandboxVectorizer/bottomup_seed_slice_pow2.ll
+++ b/llvm/test/Transforms/SandboxVectorizer/bundle_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,bundle-vec(bottom-up),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,bundle-vec(bottom-up),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/bundle_vec_aux_arg.ll b/llvm/test/Transforms/SandboxVectorizer/bundle_vec_aux_arg.ll
new file mode 100644
index 0000000000000..1bea2a1bb47a7
--- /dev/null
+++ b/llvm/test/Transforms/SandboxVectorizer/bundle_vec_aux_arg.ll
@@ -0,0 +1,13 @@
+; RUN: not opt -passes=sandbox-vectorizer -sbvec-passes="seed-collection<tr-save,bundle-vec,tr-accept>" %s -disable-output 2>&1 | FileCheck %s
+; RUN: not opt -passes=sandbox-vectorizer -sbvec-passes="seed-collection<tr-save,bundle-vec(sideways),tr-accept>" %s -disable-output 2>&1 | FileCheck %s
+; RUN: opt -passes=sandbox-vectorizer -sbvec-passes="seed-collection<tr-save,bundle-vec(bottom-up),tr-accept>" %s -disable-output
+; RUN: opt -passes=sandbox-vectorizer -sbvec-passes="seed-collection<tr-save,bundle-vec(top-down),tr-accept>" %s -disable-output
+
+; The direction argument is mandatory: neither a missing nor an unrecognized
+; argument is accepted.
+
+; CHECK: LLVM ERROR: bundle-vec requires either 'bottom-up' or 'top-down' as its aux argument!
+
+define void @aux_arg(ptr %ptr) {
+  ret void
+}
diff --git a/llvm/test/Transforms/SandboxVectorizer/cross_bbs.ll b/llvm/test/Transforms/SandboxVectorizer/cross_bbs.ll
index 21d2d9ba752e8..8c000e7d6ebdb 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,bundle-vec(bottom-up),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..3bdb36d88ca3c 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: bundle-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..738fe03376730 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,bundle-vec(bottom-up),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..4708871dee4fd 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 bundle-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..3c530070467d6 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,bundle-vec(bottom-up),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..f29cff768963d 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,bundle-vec(bottom-up),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,bundle-vec(bottom-up),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..6344ebc18d95d 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,bundle-vec(bottom-up),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..fb271887d5f34 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,bundle-vec(bottom-up),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/special_opcodes.ll b/llvm/test/Transforms/SandboxVectorizer/special_opcodes.ll
index be618df418318..9243e97fbad9a 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,bundle-vec(bottom-up),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..6959c4a3f7140 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,bundle-vec(bottom-up),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,bundle-vec(bottom-up),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,bundle-vec(bottom-up),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..8c754f329786e 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,bundle-vec(bottom-up),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,bundle-vec(bottom-up),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,bundle-vec(bottom-up),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,bundle-vec(bottom-up),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,bundle-vec(bottom-up),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/test/Transforms/SandboxVectorizer/topdown_vec.ll b/llvm/test/Transforms/SandboxVectorizer/topdown_vec.ll
index 9e7a2f236d86b..9eb579d66ac9a 100644
--- a/llvm/test/Transforms/SandboxVectorizer/topdown_vec.ll
+++ b/llvm/test/Transforms/SandboxVectorizer/topdown_vec.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-collect-seeds=loads -sbvec-passes="seed-collection<tr-save,bottom-up-vec(top-down),tr-accept>" %s -S | FileCheck %s
+; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-collect-seeds=loads -sbvec-passes="seed-collection<tr-save,bundle-vec(top-down),tr-accept>" %s -S | FileCheck %s
 
 define void @load_fadd_store(ptr %ptr, ptr %ptr2) {
 ; CHECK-LABEL: define void @load_fadd_store(
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..2bf81d07c10d2 100644
--- a/llvm/utils/gn/secondary/llvm/lib/Transforms/Vectorize/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/lib/Transforms/Vectorize/BUILD.gn
@@ -21,7 +21,7 @@ static_library("Vectorize") {
     "SandboxVectorizer/InstrMaps.cpp",
     "SandboxVectorizer/Interval.cpp",
     "SandboxVectorizer/Legality.cpp",
-    "SandboxVectorizer/Passes/BottomUpVec.cpp",
+    "SandboxVectorizer/Passes/BundleVec.cpp",
     "SandboxVectorizer/Passes/LoadStoreVec.cpp",
     "SandboxVectorizer/Passes/PackReuse.cpp",
     "SandboxVectorizer/Passes/RegionsFromBBs.cpp",



More information about the llvm-commits mailing list