Skip to content

Commit 29371d3

Browse files
authored
[AffineParallelize] expose options when creating pass (#124959)
Add a createAffineParallelizePass() that takes AffineParallelizeOptions so it can be customized in a pass pipeline.
1 parent 2e581dc commit 29371d3

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

mlir/include/mlir/Dialect/Affine/Passes.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ createSimplifyAffineStructuresPass();
4444
std::unique_ptr<OperationPass<func::FuncOp>>
4545
createAffineLoopInvariantCodeMotionPass();
4646

47-
/// Creates a pass to convert all parallel affine.for's into 1-d affine.parallel
48-
/// ops.
49-
std::unique_ptr<OperationPass<func::FuncOp>> createAffineParallelizePass();
50-
5147
/// Apply normalization transformations to affine loop-like ops. If
5248
/// `promoteSingleIter` is true, single iteration loops are promoted (i.e., the
5349
/// loop is replaced by its loop body).

mlir/include/mlir/Dialect/Affine/Passes.td

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,6 @@ def AffineVectorize : Pass<"affine-super-vectorize", "func::FuncOp"> {
370370

371371
def AffineParallelize : Pass<"affine-parallelize", "func::FuncOp"> {
372372
let summary = "Convert affine.for ops into 1-D affine.parallel";
373-
let constructor = "mlir::affine::createAffineParallelizePass()";
374373
let options = [
375374
Option<"maxNested", "max-nested", "unsigned", /*default=*/"-1u",
376375
"Maximum number of nested parallel loops to produce. "

mlir/lib/Dialect/Affine/Transforms/AffineParallelize.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ namespace {
4242
/// Convert all parallel affine.for op into 1-D affine.parallel op.
4343
struct AffineParallelize
4444
: public affine::impl::AffineParallelizeBase<AffineParallelize> {
45+
using AffineParallelizeBase<AffineParallelize>::AffineParallelizeBase;
46+
4547
void runOnOperation() override;
4648
};
4749

@@ -90,8 +92,3 @@ void AffineParallelize::runOnOperation() {
9092
}
9193
}
9294
}
93-
94-
std::unique_ptr<OperationPass<func::FuncOp>>
95-
mlir::affine::createAffineParallelizePass() {
96-
return std::make_unique<AffineParallelize>();
97-
}

0 commit comments

Comments
 (0)