[Mlir-commits] [mlir] 1e2b4ff - [mlir][linalg] Retire LinalgStrategyEnablePass
Guray Ozen
llvmlistbot at llvm.org
Fri Sep 9 06:14:01 PDT 2022
Author: Guray Ozen
Date: 2022-09-09T15:13:52+02:00
New Revision: 1e2b4ff9368777f8ef49fd7117f8de66c1afcccc
URL: https://github.com/llvm/llvm-project/commit/1e2b4ff9368777f8ef49fd7117f8de66c1afcccc
DIFF: https://github.com/llvm/llvm-project/commit/1e2b4ff9368777f8ef49fd7117f8de66c1afcccc.diff
LOG: [mlir][linalg] Retire LinalgStrategyEnablePass
This revision retires LinalgStrategyEnablePass.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D133557
Added:
Modified:
mlir/include/mlir/Dialect/Linalg/Passes.h
mlir/include/mlir/Dialect/Linalg/Passes.td
mlir/lib/Dialect/Linalg/Transforms/CodegenStrategy.cpp
mlir/lib/Dialect/Linalg/Transforms/LinalgStrategyPasses.cpp
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/Linalg/Passes.h b/mlir/include/mlir/Dialect/Linalg/Passes.h
index 6f195c7a5b3ef..820c5a870359d 100644
--- a/mlir/include/mlir/Dialect/Linalg/Passes.h
+++ b/mlir/include/mlir/Dialect/Linalg/Passes.h
@@ -143,12 +143,6 @@ std::unique_ptr<OperationPass<func::FuncOp>> createLinalgStrategyVectorizePass(
linalg::LinalgTransformationFilter(),
bool padVectorize = false);
-/// Create a LinalgStrategyEnablePass.
-std::unique_ptr<OperationPass<func::FuncOp>> createLinalgStrategyEnablePass(
- linalg::LinalgEnablingOptions opt = linalg::LinalgEnablingOptions(),
- const linalg::LinalgTransformationFilter &filter =
- linalg::LinalgTransformationFilter());
-
/// Create a LinalgStrategyLowerVectorsPass.
std::unique_ptr<OperationPass<func::FuncOp>>
createLinalgStrategyLowerVectorsPass(
diff --git a/mlir/include/mlir/Dialect/Linalg/Passes.td b/mlir/include/mlir/Dialect/Linalg/Passes.td
index ad90e084c465e..d12ef02de3600 100644
--- a/mlir/include/mlir/Dialect/Linalg/Passes.td
+++ b/mlir/include/mlir/Dialect/Linalg/Passes.td
@@ -253,18 +253,6 @@ def LinalgStrategyVectorizePass
];
}
-def LinalgStrategyEnablePass
- : Pass<"linalg-strategy-enable-pass", "func::FuncOp"> {
- let summary = "Configurable pass to enable the application of other "
- "pattern-based linalg passes.";
- let constructor = "mlir::createLinalgStrategyEnablePass()";
- let dependentDialects = ["linalg::LinalgDialect"];
- let options = [
- Option<"anchorFuncName", "anchor-func", "std::string", /*default=*/"",
- "Which func op is the anchor to latch on.">,
- ];
-}
-
def LinalgStrategyLowerVectorsPass
: Pass<"linalg-strategy-lower-vectors-pass", "func::FuncOp"> {
let summary = "Configurable pass to lower vector operations.";
diff --git a/mlir/lib/Dialect/Linalg/Transforms/CodegenStrategy.cpp b/mlir/lib/Dialect/Linalg/Transforms/CodegenStrategy.cpp
index 642d08f215e93..6787de380b289 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/CodegenStrategy.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/CodegenStrategy.cpp
@@ -42,8 +42,6 @@ void mlir::linalg::CodegenStrategy::configurePassPipeline(
: linalg::LinalgTransformationFilter(
t->filter, currentState, nextState);
t->addToPassPipeline(pm, filter);
- if (addEnablePass)
- pm.addPass(createLinalgStrategyEnablePass(linalgEnablingOptions));
}
pm.addPass(createLinalgStrategyRemoveMarkersPass());
}
diff --git a/mlir/lib/Dialect/Linalg/Transforms/LinalgStrategyPasses.cpp b/mlir/lib/Dialect/Linalg/Transforms/LinalgStrategyPasses.cpp
index 96061dcc621ac..05a47942c2da7 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/LinalgStrategyPasses.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/LinalgStrategyPasses.cpp
@@ -41,7 +41,6 @@ namespace mlir {
#define GEN_PASS_DEF_LINALGSTRATEGYDECOMPOSEPASS
#define GEN_PASS_DEF_LINALGSTRATEGYPEELPASS
#define GEN_PASS_DEF_LINALGSTRATEGYVECTORIZEPASS
-#define GEN_PASS_DEF_LINALGSTRATEGYENABLEPASS
#define GEN_PASS_DEF_LINALGSTRATEGYLOWERVECTORSPASS
#define GEN_PASS_DEF_LINALGSTRATEGYREMOVEMARKERSPASS
#include "mlir/Dialect/Linalg/Passes.h.inc"
@@ -272,57 +271,6 @@ struct LinalgStrategyVectorizePass
LinalgTransformationFilter filter;
};
-/// Configurable pass to enable the application of other pattern-based linalg
-/// passes.
-struct LinalgStrategyEnablePass
- : public impl::LinalgStrategyEnablePassBase<LinalgStrategyEnablePass> {
-
- LinalgStrategyEnablePass(LinalgEnablingOptions opt,
- LinalgTransformationFilter filt)
- : options(opt), filter(std::move(filt)) {}
-
- void runOnOperation() override {
- auto funcOp = getOperation();
- if (!anchorFuncName.empty() && funcOp.getName() != anchorFuncName)
- return;
-
- MLIRContext *context = funcOp.getContext();
- RewritePatternSet patterns =
- linalg::getLinalgTilingCanonicalizationPatterns(context);
- scf::populateSCFForLoopCanonicalizationPatterns(patterns);
- if (failed(applyPatternsAndFoldGreedily(funcOp, std::move(patterns))))
- return signalPassFailure();
-
- if (options.licm) {
- funcOp->walk([&](LoopLikeOpInterface loopLike) {
- moveLoopInvariantCode(loopLike);
- });
- }
-
- // Gathers all innermost loops through a post order pruned walk.
- funcOp.walk([](Operation *op) {
- if (auto forOp = dyn_cast<AffineForOp>(op))
- (void)promoteIfSingleIteration(forOp);
- else if (auto forOp = dyn_cast<scf::ForOp>(op))
- (void)promoteIfSingleIteration(forOp);
- });
- if (options.hoistRedundantVectorTransfers)
- hoistRedundantVectorTransfers(funcOp);
-
- if (options.hoistRedundantVectorTransfersOnTensor)
- hoistRedundantVectorTransfersOnTensor(funcOp);
-
- // Run CSE to cleanup after canonicalization.
- OpPassManager dynamicPM("func.func");
- dynamicPM.addPass(createCSEPass());
- if (failed(runPipeline(dynamicPM, funcOp)))
- return signalPassFailure();
- }
-
- LinalgEnablingOptions options;
- LinalgTransformationFilter filter;
-};
-
/// Configurable pass to lower vector operations.
struct LinalgStrategyLowerVectorsPass
: public impl::LinalgStrategyLowerVectorsPassBase<
@@ -454,13 +402,6 @@ mlir::createLinalgStrategyVectorizePass(
padVectorize);
}
-/// Create a LinalgStrategyEnablePass.
-std::unique_ptr<OperationPass<func::FuncOp>>
-mlir::createLinalgStrategyEnablePass(LinalgEnablingOptions opt,
- const LinalgTransformationFilter &filter) {
- return std::make_unique<LinalgStrategyEnablePass>(opt, filter);
-}
-
/// Create a LinalgStrategyLowerVectorsPass.
std::unique_ptr<OperationPass<func::FuncOp>>
mlir::createLinalgStrategyLowerVectorsPass(
More information about the Mlir-commits
mailing list