Skip to content

Commit 73708b1

Browse files
committed
fixup! fixup! [SandboxVec] Move seed collection into its own separate pass
Add comments to BottomUpVec and SeedColleciton classes.
1 parent 31a13f0 commit 73708b1

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@
2222

2323
namespace llvm::sandboxir {
2424

25+
/// This is a simple bottom-up vectorizer Region pass.
26+
/// It expects a "seed slice" as an input in the Region's Aux vector.
27+
/// The "seed slice" is a vector of instructions that can be used as a starting
28+
/// point for vectorization, like stores to consecutive memory addresses.
29+
/// Starting from the seed instructions, it walks up the def-use chain looking
30+
/// for more instructions that can be vectorized. This pass will generate vector
31+
/// code if it can legally vectorize the code, regardless of whether it is
32+
/// profitable or not. For now profitability is checked at the end of the region
33+
/// pass pipeline by a dedicated pass that accepts or rejects the IR
34+
/// transaction, depending on the cost.
2535
class BottomUpVec final : public RegionPass {
2636
bool Change = false;
2737
std::unique_ptr<LegalityAnalysis> Legality;

llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/SeedCollection.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717

1818
namespace llvm::sandboxir {
1919

20+
/// This pass collects the instructions that can become vectorization "seeds",
21+
/// like stores to consecutive memory addresses. It then goes over the collected
22+
/// seeds, slicing them into appropriately sized chunks, creating a Region with
23+
/// the seed slice as the Auxiliary vector and runs the region pass pipeline.
2024
class SeedCollection final : public FunctionPass {
2125

2226
/// The PM containing the pipeline of region passes.

0 commit comments

Comments
 (0)