[llvm] [NFC][SBVec] Rename BottomUpVec to SLPTreeVec (PR #213197)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 30 21:24:43 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-vectorizers
@llvm/pr-subscribers-llvm-transforms
Author: Anshil Gandhi (gandhi56)
<details>
<summary>Changes</summary>
---
Patch is 42.83 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/213197.diff
26 Files Affected:
- (modified) llvm/docs/SandboxVectorizer.md (+8-8)
- (modified) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/LoadStoreVec.h (+1-1)
- (modified) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/RegionsFromMetadata.h (+1-1)
- (renamed) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/SLPTreeVec.h (+10-9)
- (modified) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/SeedCollection.h (+1-1)
- (modified) llvm/lib/Transforms/Vectorize/CMakeLists.txt (+1-1)
- (modified) llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/PassRegistry.def (+1-1)
- (renamed) llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/SLPTreeVec.cpp (+22-23)
- (modified) llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizer.cpp (+3-3)
- (modified) llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizerPassBuilder.cpp (+1-1)
- (modified) llvm/test/Transforms/SandboxVectorizer/allow_files.ll (+8-8)
- (modified) llvm/test/Transforms/SandboxVectorizer/cross_bbs.ll (+1-1)
- (modified) llvm/test/Transforms/SandboxVectorizer/default_pass_pipeline.ll (+1-1)
- (modified) llvm/test/Transforms/SandboxVectorizer/external_uses.ll (+1-1)
- (modified) llvm/test/Transforms/SandboxVectorizer/load_store_vec.ll (+1-1)
- (modified) llvm/test/Transforms/SandboxVectorizer/pack.ll (+1-1)
- (modified) llvm/test/Transforms/SandboxVectorizer/pack_reuse_end_to_end.ll (+2-2)
- (modified) llvm/test/Transforms/SandboxVectorizer/repeated_instrs.ll (+1-1)
- (modified) llvm/test/Transforms/SandboxVectorizer/scheduler.ll (+1-1)
- (renamed) llvm/test/Transforms/SandboxVectorizer/slp_tree_basic.ll (+2-2)
- (renamed) llvm/test/Transforms/SandboxVectorizer/slp_tree_seed_slice.ll (+1-1)
- (renamed) llvm/test/Transforms/SandboxVectorizer/slp_tree_seed_slice_pow2.ll (+2-2)
- (modified) llvm/test/Transforms/SandboxVectorizer/special_opcodes.ll (+1-1)
- (modified) llvm/test/Transforms/SandboxVectorizer/stop_at.ll (+3-3)
- (modified) llvm/test/Transforms/SandboxVectorizer/stop_bndl.ll (+5-5)
- (modified) llvm/utils/gn/secondary/llvm/lib/Transforms/Vectorize/BUILD.gn (+1-1)
``````````diff
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/S...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/213197
More information about the llvm-commits
mailing list