[Mlir-commits] [mlir] 86b0117 - Remove TOSA test passes from non test registration.

Stella Laurenzo llvmlistbot at llvm.org
Sat Nov 7 18:40:06 PST 2020


Author: Stella Laurenzo
Date: 2020-11-07T18:34:11-08:00
New Revision: 86b011777ea475461e0958a43b84c121f460c1ac

URL: https://github.com/llvm/llvm-project/commit/86b011777ea475461e0958a43b84c121f460c1ac
DIFF: https://github.com/llvm/llvm-project/commit/86b011777ea475461e0958a43b84c121f460c1ac.diff

LOG: Remove TOSA test passes from non test registration.

* Wires them in the same way that peer-dialect test passes are registered.
* Fixes the build for -DLLVM_INCLUDE_TESTS=OFF.

Differential Revision: https://reviews.llvm.org/D91022

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/Tosa/Transforms/Passes.td
    mlir/test/lib/Dialect/Tosa/TosaTestPasses.cpp
    mlir/tools/mlir-opt/mlir-opt.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/Tosa/Transforms/Passes.td b/mlir/include/mlir/Dialect/Tosa/Transforms/Passes.td
index 25a4400ca267..09998037518a 100644
--- a/mlir/include/mlir/Dialect/Tosa/Transforms/Passes.td
+++ b/mlir/include/mlir/Dialect/Tosa/Transforms/Passes.td
@@ -24,14 +24,3 @@ def TosaMakeBroadcastable : FunctionPass<"tosa-make-broadcastable"> {
 
   let constructor = "createTosaMakeBroadcastablePass()";
 }
-
-// TOSA Test Passes
-
-def TosaTestQuantUtils : FunctionPass<"tosa-test-quant-utils"> {
-  let summary = "TOSA Test: Exercise the APIs in QuantUtils.cpp";
-  let description = [{
-    Exercises the API that builds a quantized type from min/max quantized range.
-  }];
-
-  let constructor = "createTosaTestQuantUtilAPIPass()";
-}

diff  --git a/mlir/test/lib/Dialect/Tosa/TosaTestPasses.cpp b/mlir/test/lib/Dialect/Tosa/TosaTestPasses.cpp
index b9728e236013..77787cc90620 100644
--- a/mlir/test/lib/Dialect/Tosa/TosaTestPasses.cpp
+++ b/mlir/test/lib/Dialect/Tosa/TosaTestPasses.cpp
@@ -20,6 +20,8 @@
 #include "mlir/Pass/Pass.h"
 #include "mlir/Transforms/GreedyPatternRewriteDriver.h"
 
+#define PASS_NAME "tosa-test-quant-utils"
+
 using namespace mlir;
 using namespace mlir::tosa;
 
@@ -176,7 +178,7 @@ ConvertTosaConv2DOp::matchAndRewrite(Operation *op,
 namespace {
 
 struct TosaTestQuantUtilAPI
-    : public TosaTestQuantUtilsBase<TosaTestQuantUtilAPI> {
+    : public PassWrapper<TosaTestQuantUtilAPI, FunctionPass> {
   void runOnFunction() override;
 };
 
@@ -192,6 +194,9 @@ void TosaTestQuantUtilAPI::runOnFunction() {
 
 } // anonymous namespace
 
-std::unique_ptr<Pass> mlir::tosa::createTosaTestQuantUtilAPIPass() {
-  return std::make_unique<TosaTestQuantUtilAPI>();
+namespace mlir {
+void registerTosaTestQuantUtilAPIPass() {
+  PassRegistration<TosaTestQuantUtilAPI>(
+      PASS_NAME, "TOSA Test: Exercise the APIs in QuantUtils.cpp.");
 }
+} // namespace mlir

diff  --git a/mlir/tools/mlir-opt/mlir-opt.cpp b/mlir/tools/mlir-opt/mlir-opt.cpp
index 7517fb6ec267..e16021a6d431 100644
--- a/mlir/tools/mlir-opt/mlir-opt.cpp
+++ b/mlir/tools/mlir-opt/mlir-opt.cpp
@@ -48,6 +48,7 @@ void registerTestReducer();
 void registerTestSpirvEntryPointABIPass();
 void registerTestSpirvModuleCombinerPass();
 void registerTestTraitsPass();
+void registerTosaTestQuantUtilAPIPass();
 void registerVectorizerTestPass();
 
 namespace test {
@@ -111,6 +112,7 @@ void registerTestPasses() {
   registerTestSpirvModuleCombinerPass();
   registerTestTraitsPass();
   registerVectorizerTestPass();
+  registerTosaTestQuantUtilAPIPass();
 
   test::registerConvertCallOpPass();
   test::registerInliner();


        


More information about the Mlir-commits mailing list