[Mlir-commits] [mlir] efc6fe9 - [MLIR][TOSA] Drop "OnTensors" suffix
Geoffrey Martin-Noble
llvmlistbot at llvm.org
Fri Oct 15 16:01:26 PDT 2021
Author: Geoffrey Martin-Noble
Date: 2021-10-15T16:01:19-07:00
New Revision: efc6fe963c114cd9c9436f754ff3e3c2f39041f8
URL: https://github.com/llvm/llvm-project/commit/efc6fe963c114cd9c9436f754ff3e3c2f39041f8
DIFF: https://github.com/llvm/llvm-project/commit/efc6fe963c114cd9c9436f754ff3e3c2f39041f8.diff
LOG: [MLIR][TOSA] Drop "OnTensors" suffix
This is the only lowering to Linalg Tosa has, so it's needlessly
verbose. Likely this was a carry over from IREE's usage where we
originally lowered to linalg on buffers (the only linalg that existed at
the time), so the everything on tensors needed the suffix. We're dropping
it in IREE also, having transitioned entirely to using Linalg on
tensors.
Reviewed By: sjarus
Differential Revision: https://reviews.llvm.org/D111911
Added:
Modified:
mlir/include/mlir/Conversion/Passes.td
mlir/include/mlir/Conversion/TosaToLinalg/TosaToLinalg.h
mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
mlir/lib/Conversion/TosaToLinalg/TosaToLinalgPass.cpp
mlir/test/Conversion/TosaToLinalg/tosa-to-linalg.mlir
Removed:
################################################################################
diff --git a/mlir/include/mlir/Conversion/Passes.td b/mlir/include/mlir/Conversion/Passes.td
index 493378590a94a..bab88b804be3b 100644
--- a/mlir/include/mlir/Conversion/Passes.td
+++ b/mlir/include/mlir/Conversion/Passes.td
@@ -592,14 +592,14 @@ def ConvertStandardToSPIRV : Pass<"convert-std-to-spirv", "ModuleOp"> {
// TosaToLinalg
//===----------------------------------------------------------------------===//
-def TosaToLinalgOnTensors : FunctionPass<"tosa-to-linalg-on-tensors"> {
+def TosaToLinalg : FunctionPass<"tosa-to-linalg"> {
let summary = "Lower TOSA to LinAlg on tensors";
let description = [{
Pass that converts TOSA operations to the equivalent operations using the
tensor operations in LinAlg.
}];
- let constructor = "tosa::createTosaToLinalgOnTensors()";
+ let constructor = "tosa::createTosaToLinalg()";
}
//===----------------------------------------------------------------------===//
diff --git a/mlir/include/mlir/Conversion/TosaToLinalg/TosaToLinalg.h b/mlir/include/mlir/Conversion/TosaToLinalg/TosaToLinalg.h
index 8ee5316c10cc1..b542833fa0e99 100644
--- a/mlir/include/mlir/Conversion/TosaToLinalg/TosaToLinalg.h
+++ b/mlir/include/mlir/Conversion/TosaToLinalg/TosaToLinalg.h
@@ -19,16 +19,15 @@
namespace mlir {
namespace tosa {
-std::unique_ptr<Pass> createTosaToLinalgOnTensors();
+std::unique_ptr<Pass> createTosaToLinalg();
/// Populates passes to convert from TOSA to Linalg on buffers. At the end of
/// the pass, the function will only contain linalg ops or standard ops if the
/// pipeline succeeds.
-void addTosaToLinalgOnTensorsPasses(OpPassManager &pm);
+void addTosaToLinalgPasses(OpPassManager &pm);
/// Populates conversion passes from TOSA dialect to Linalg dialect.
-void populateTosaToLinalgOnTensorsConversionPatterns(
- RewritePatternSet *patterns);
+void populateTosaToLinalgConversionPatterns(RewritePatternSet *patterns);
} // namespace tosa
} // namespace mlir
diff --git a/mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp b/mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
index 3d12042960634..960cfec86d96e 100644
--- a/mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
+++ b/mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
@@ -3012,7 +3012,7 @@ class AvgPool2dConverter : public OpRewritePattern<tosa::AvgPool2dOp> {
} // namespace
-void mlir::tosa::populateTosaToLinalgOnTensorsConversionPatterns(
+void mlir::tosa::populateTosaToLinalgConversionPatterns(
RewritePatternSet *patterns) {
patterns->add<
// clang-format off
diff --git a/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgPass.cpp b/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgPass.cpp
index 9e3d3d1f39cdc..11aab5828cfd0 100644
--- a/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgPass.cpp
+++ b/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgPass.cpp
@@ -30,8 +30,7 @@
using namespace mlir;
namespace {
-struct TosaToLinalgOnTensors
- : public TosaToLinalgOnTensorsBase<TosaToLinalgOnTensors> {
+struct TosaToLinalg : public TosaToLinalgBase<TosaToLinalg> {
public:
void getDependentDialects(DialectRegistry ®istry) const override {
registry.insert<arith::ArithmeticDialect, linalg::LinalgDialect,
@@ -55,18 +54,18 @@ struct TosaToLinalgOnTensors
target.markUnknownOpDynamicallyLegal([](Operation *) { return true; });
FuncOp func = getFunction();
- mlir::tosa::populateTosaToLinalgOnTensorsConversionPatterns(&patterns);
+ mlir::tosa::populateTosaToLinalgConversionPatterns(&patterns);
if (failed(applyFullConversion(func, target, std::move(patterns))))
signalPassFailure();
}
};
} // namespace
-std::unique_ptr<Pass> mlir::tosa::createTosaToLinalgOnTensors() {
- return std::make_unique<TosaToLinalgOnTensors>();
+std::unique_ptr<Pass> mlir::tosa::createTosaToLinalg() {
+ return std::make_unique<TosaToLinalg>();
}
-void mlir::tosa::addTosaToLinalgOnTensorsPasses(OpPassManager &pm) {
+void mlir::tosa::addTosaToLinalgPasses(OpPassManager &pm) {
pm.addNestedPass<FuncOp>(createTosaMakeBroadcastablePass());
- pm.addNestedPass<FuncOp>(createTosaToLinalgOnTensors());
+ pm.addNestedPass<FuncOp>(createTosaToLinalg());
}
diff --git a/mlir/test/Conversion/TosaToLinalg/tosa-to-linalg.mlir b/mlir/test/Conversion/TosaToLinalg/tosa-to-linalg.mlir
index ab828b14f6244..8d9db429a5dd7 100644
--- a/mlir/test/Conversion/TosaToLinalg/tosa-to-linalg.mlir
+++ b/mlir/test/Conversion/TosaToLinalg/tosa-to-linalg.mlir
@@ -1,4 +1,4 @@
-// RUN: mlir-opt --split-input-file --tosa-to-linalg-on-tensors %s -verify-diagnostics -o -| FileCheck %s
+// RUN: mlir-opt --split-input-file --tosa-to-linalg %s -verify-diagnostics -o -| FileCheck %s
// CHECK: #[[$MAP0:.*]] = affine_map<() -> ()>
More information about the Mlir-commits
mailing list