[Mlir-commits] [mlir] 72c65b6 - [mlir] Move TestDialect and its passes to mlir::test namespace.

Alexander Belyaev llvmlistbot at llvm.org
Thu Nov 5 06:29:51 PST 2020


Author: Alexander Belyaev
Date: 2020-11-05T15:29:15+01:00
New Revision: 72c65b698e3af6d1826dad43cb57d4ec06844fcc

URL: https://github.com/llvm/llvm-project/commit/72c65b698e3af6d1826dad43cb57d4ec06844fcc
DIFF: https://github.com/llvm/llvm-project/commit/72c65b698e3af6d1826dad43cb57d4ec06844fcc.diff

LOG: [mlir] Move TestDialect and its passes to mlir::test namespace.

TestDialect has many operations and they all live in ::mlir namespace.
Sometimes it is not clear whether the ops used in the code for the test passes
belong to Standard or to Test dialects.

Also, with this change it is easier to understand what test passes registered
in mlir-opt are actually passes in mlir/test.

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

Added: 
    

Modified: 
    mlir/test/lib/Dialect/Test/TestDialect.cpp
    mlir/test/lib/Dialect/Test/TestDialect.h
    mlir/test/lib/Dialect/Test/TestOps.td
    mlir/test/lib/Dialect/Test/TestPatterns.cpp
    mlir/test/lib/Dialect/Test/TestTraits.cpp
    mlir/test/lib/Dialect/Test/TestTypeDefs.td
    mlir/test/lib/Dialect/Test/TestTypes.cpp
    mlir/test/lib/Dialect/Test/TestTypes.h
    mlir/test/lib/IR/TestInterfaces.cpp
    mlir/test/lib/IR/TestTypes.cpp
    mlir/test/lib/Transforms/TestAffineLoopParametricTiling.cpp
    mlir/test/lib/Transforms/TestCallGraph.cpp
    mlir/test/lib/Transforms/TestConstantFold.cpp
    mlir/test/lib/Transforms/TestConvVectorization.cpp
    mlir/test/lib/Transforms/TestConvertCallOp.cpp
    mlir/test/lib/Transforms/TestConvertGPUKernelToCubin.cpp
    mlir/test/lib/Transforms/TestConvertGPUKernelToHsaco.cpp
    mlir/test/lib/Transforms/TestDominance.cpp
    mlir/test/lib/Transforms/TestDynamicPipeline.cpp
    mlir/test/lib/Transforms/TestExpandMemRefReshape.cpp
    mlir/test/lib/Transforms/TestExpandTanh.cpp
    mlir/test/lib/Transforms/TestFinalizingBufferize.cpp
    mlir/test/lib/Transforms/TestGpuParallelLoopMapping.cpp
    mlir/test/lib/Transforms/TestInlining.cpp
    mlir/test/lib/Transforms/TestLinalgCodegenStrategy.cpp
    mlir/test/lib/Transforms/TestLinalgFusionTransforms.cpp
    mlir/test/lib/Transforms/TestLinalgHoisting.cpp
    mlir/test/lib/Transforms/TestLinalgTransforms.cpp
    mlir/test/lib/Transforms/TestLiveness.cpp
    mlir/test/lib/Transforms/TestLoopFusion.cpp
    mlir/test/lib/Transforms/TestLoopMapping.cpp
    mlir/test/lib/Transforms/TestLoopParametricTiling.cpp
    mlir/test/lib/Transforms/TestLoopUnrolling.cpp
    mlir/test/lib/Transforms/TestMemRefBoundCheck.cpp
    mlir/test/lib/Transforms/TestMemRefDependenceCheck.cpp
    mlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp
    mlir/test/lib/Transforms/TestOpaqueLoc.cpp
    mlir/test/lib/Transforms/TestSCFUtils.cpp
    mlir/test/lib/Transforms/TestVectorTransforms.cpp
    mlir/tools/mlir-opt/mlir-opt.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/test/lib/Dialect/Test/TestDialect.cpp b/mlir/test/lib/Dialect/Test/TestDialect.cpp
index ffc59aad7d18..a14fd0b2aac9 100644
--- a/mlir/test/lib/Dialect/Test/TestDialect.cpp
+++ b/mlir/test/lib/Dialect/Test/TestDialect.cpp
@@ -20,8 +20,9 @@
 #include "llvm/ADT/StringSwitch.h"
 
 using namespace mlir;
+using namespace mlir::test;
 
-void mlir::registerTestDialect(DialectRegistry &registry) {
+void mlir::test::registerTestDialect(DialectRegistry &registry) {
   registry.insert<TestDialect>();
 }
 

diff  --git a/mlir/test/lib/Dialect/Test/TestDialect.h b/mlir/test/lib/Dialect/Test/TestDialect.h
index 7eb189b515ca..3b9e8c5d9ef8 100644
--- a/mlir/test/lib/Dialect/Test/TestDialect.h
+++ b/mlir/test/lib/Dialect/Test/TestDialect.h
@@ -38,7 +38,9 @@
 #include "TestOps.h.inc"
 
 namespace mlir {
+namespace test {
 void registerTestDialect(DialectRegistry &registry);
-} // end namespace mlir
+} // namespace test
+} // namespace mlir
 
 #endif // MLIR_TESTDIALECT_H

diff  --git a/mlir/test/lib/Dialect/Test/TestOps.td b/mlir/test/lib/Dialect/Test/TestOps.td
index 41a21b5c376f..1ed6c545ff83 100644
--- a/mlir/test/lib/Dialect/Test/TestOps.td
+++ b/mlir/test/lib/Dialect/Test/TestOps.td
@@ -21,7 +21,7 @@ include "mlir/Interfaces/SideEffectInterfaces.td"
 
 def Test_Dialect : Dialect {
   let name = "test";
-  let cppNamespace = "::mlir";
+  let cppNamespace = "::mlir::test";
   let hasOperationAttrVerify = 1;
   let hasRegionArgAttrVerify = 1;
   let hasRegionResultAttrVerify = 1;
@@ -89,8 +89,8 @@ def MultiTensorRankOf : TEST_Op<"multi_tensor_rank_of"> {
 }
 
 def TEST_TestType : DialectType<Test_Dialect,
-    CPred<"$_self.isa<::mlir::TestType>()">, "test">,
-    BuildableType<"$_builder.getType<::mlir::TestType>()">;
+    CPred<"$_self.isa<::mlir::test::TestType>()">, "test">,
+    BuildableType<"$_builder.getType<::mlir::test::TestType>()">;
 
 //===----------------------------------------------------------------------===//
 // Test Symbols

diff  --git a/mlir/test/lib/Dialect/Test/TestPatterns.cpp b/mlir/test/lib/Dialect/Test/TestPatterns.cpp
index 5958105090a4..40ae9ad52636 100644
--- a/mlir/test/lib/Dialect/Test/TestPatterns.cpp
+++ b/mlir/test/lib/Dialect/Test/TestPatterns.cpp
@@ -16,6 +16,7 @@
 #include "mlir/Transforms/GreedyPatternRewriteDriver.h"
 
 using namespace mlir;
+using namespace mlir::test;
 
 // Native function for testing NativeCodeCall
 static Value chooseOperand(Value input1, Value input2, BoolAttr choice) {
@@ -955,6 +956,7 @@ struct TestMergeBlocksPatternDriver
 //===----------------------------------------------------------------------===//
 
 namespace mlir {
+namespace test {
 void registerPatternsTestPass() {
   PassRegistration<TestReturnTypeDriver>("test-return-type",
                                          "Run return type functions");
@@ -987,4 +989,5 @@ void registerPatternsTestPass() {
       "test-merge-blocks",
       "Test Merging operation in ConversionPatternRewriter"};
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/Dialect/Test/TestTraits.cpp b/mlir/test/lib/Dialect/Test/TestTraits.cpp
index dbd05aee7ac1..d398c44c6bc1 100644
--- a/mlir/test/lib/Dialect/Test/TestTraits.cpp
+++ b/mlir/test/lib/Dialect/Test/TestTraits.cpp
@@ -11,6 +11,7 @@
 #include "mlir/Transforms/GreedyPatternRewriteDriver.h"
 
 using namespace mlir;
+using namespace mlir::test;
 
 //===----------------------------------------------------------------------===//
 // Trait Folder.

diff  --git a/mlir/test/lib/Dialect/Test/TestTypeDefs.td b/mlir/test/lib/Dialect/Test/TestTypeDefs.td
index d755d91bb5d6..75fffa11cb21 100644
--- a/mlir/test/lib/Dialect/Test/TestTypeDefs.td
+++ b/mlir/test/lib/Dialect/Test/TestTypeDefs.td
@@ -55,7 +55,7 @@ def IntegerType : Test_Type<"TestInteger"> {
   let parameters = (
     ins
     // SignednessSemantics is defined below.
-    "::mlir::TestIntegerType::SignednessSemantics":$signedness,
+    "::mlir::test::TestIntegerType::SignednessSemantics":$signedness,
     "unsigned":$width
   );
 
@@ -108,7 +108,7 @@ class FieldInfo_Type<string name> : Test_Type<name> {
     // An ArrayRef of something which requires allocation in the storage
     // constructor.
     ArrayRefOfSelfAllocationParameter<
-      "::mlir::FieldInfo", // FieldInfo is defined/declared in TestTypes.h.
+      "::mlir::test::FieldInfo", // FieldInfo is defined/declared in TestTypes.h.
       "Models struct fields">: $fields
   );
 

diff  --git a/mlir/test/lib/Dialect/Test/TestTypes.cpp b/mlir/test/lib/Dialect/Test/TestTypes.cpp
index 1eb5347758f4..0a91be30b53a 100644
--- a/mlir/test/lib/Dialect/Test/TestTypes.cpp
+++ b/mlir/test/lib/Dialect/Test/TestTypes.cpp
@@ -18,6 +18,7 @@
 #include "llvm/ADT/TypeSwitch.h"
 
 using namespace mlir;
+using namespace mlir::test;
 
 // Custom parser for SignednessSemantics.
 static ParseResult
@@ -87,21 +88,23 @@ void CompoundAType::print(DialectAsmPrinter &printer) const {
 // namespace. Declare them here, then define them immediately below. Separating
 // the declaration and definition adheres to the LLVM coding standards.
 namespace mlir {
+namespace test {
 // FieldInfo is used as part of a parameter, so equality comparison is
 // compulsory.
 static bool operator==(const FieldInfo &a, const FieldInfo &b);
 // FieldInfo is used as part of a parameter, so a hash will be computed.
 static llvm::hash_code hash_value(const FieldInfo &fi); // NOLINT
+} // namespace test
 } // namespace mlir
 
 // FieldInfo is used as part of a parameter, so equality comparison is
 // compulsory.
-static bool mlir::operator==(const FieldInfo &a, const FieldInfo &b) {
+static bool mlir::test::operator==(const FieldInfo &a, const FieldInfo &b) {
   return a.name == b.name && a.type == b.type;
 }
 
 // FieldInfo is used as part of a parameter, so a hash will be computed.
-static llvm::hash_code mlir::hash_value(const FieldInfo &fi) { // NOLINT
+static llvm::hash_code mlir::test::hash_value(const FieldInfo &fi) { // NOLINT
   return llvm::hash_combine(fi.name, fi.type);
 }
 

diff  --git a/mlir/test/lib/Dialect/Test/TestTypes.h b/mlir/test/lib/Dialect/Test/TestTypes.h
index 371171f4b753..fdde7a433f0a 100644
--- a/mlir/test/lib/Dialect/Test/TestTypes.h
+++ b/mlir/test/lib/Dialect/Test/TestTypes.h
@@ -23,6 +23,7 @@
 #include "mlir/IR/Types.h"
 
 namespace mlir {
+namespace test {
 
 /// FieldInfo represents a field in the StructType data type. It is used as a
 /// parameter in TestTypeDefs.td.
@@ -36,12 +37,14 @@ struct FieldInfo {
   }
 };
 
+} // namespace test
 } // namespace mlir
 
 #define GET_TYPEDEF_CLASSES
 #include "TestTypeDefs.h.inc"
 
 namespace mlir {
+namespace test {
 
 #include "TestTypeInterfaces.h.inc"
 
@@ -104,6 +107,7 @@ class TestRecursiveType
   StringRef getName() { return getImpl()->name; }
 };
 
-} // end namespace mlir
+} // namespace test
+} // namespace mlir
 
 #endif // MLIR_TESTTYPES_H

diff  --git a/mlir/test/lib/IR/TestInterfaces.cpp b/mlir/test/lib/IR/TestInterfaces.cpp
index c48d582c01c3..369001f3540a 100644
--- a/mlir/test/lib/IR/TestInterfaces.cpp
+++ b/mlir/test/lib/IR/TestInterfaces.cpp
@@ -10,6 +10,7 @@
 #include "mlir/Pass/Pass.h"
 
 using namespace mlir;
+using namespace mlir::test;
 
 namespace {
 /// This test checks various aspects of Type interface generation and
@@ -34,8 +35,10 @@ struct TestTypeInterfaces
 } // end anonymous namespace
 
 namespace mlir {
+namespace test {
 void registerTestInterfaces() {
   PassRegistration<TestTypeInterfaces> pass("test-type-interfaces",
                                             "Test type interface support.");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/IR/TestTypes.cpp b/mlir/test/lib/IR/TestTypes.cpp
index 43b2c05c7572..0d652a4a0b26 100644
--- a/mlir/test/lib/IR/TestTypes.cpp
+++ b/mlir/test/lib/IR/TestTypes.cpp
@@ -11,6 +11,7 @@
 #include "mlir/Pass/Pass.h"
 
 using namespace mlir;
+using namespace mlir::test;
 
 namespace {
 struct TestRecursiveTypesPass
@@ -36,7 +37,7 @@ struct TestRecursiveTypesPass
     signalPassFailure();
   }
 };
-} // end namespace
+} // namespace
 
 LogicalResult TestRecursiveTypesPass::createIRWithTypes() {
   MLIRContext *ctx = &getContext();
@@ -69,10 +70,12 @@ LogicalResult TestRecursiveTypesPass::createIRWithTypes() {
 }
 
 namespace mlir {
+namespace test {
 
 void registerTestRecursiveTypesPass() {
   PassRegistration<TestRecursiveTypesPass> reg(
       "test-recursive-types", "Test support for recursive types");
 }
 
-} // end namespace mlir
+} // namespace test
+} // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestAffineLoopParametricTiling.cpp b/mlir/test/lib/Transforms/TestAffineLoopParametricTiling.cpp
index 5d369e62ae43..cd4d91f60bc2 100644
--- a/mlir/test/lib/Transforms/TestAffineLoopParametricTiling.cpp
+++ b/mlir/test/lib/Transforms/TestAffineLoopParametricTiling.cpp
@@ -20,7 +20,6 @@ using namespace mlir;
 #define DEBUG_TYPE "test-affine-parametric-tile"
 
 namespace {
-
 struct TestAffineLoopParametricTiling
     : public PassWrapper<TestAffineLoopParametricTiling, FunctionPass> {
   void runOnFunction() override;
@@ -82,9 +81,11 @@ void TestAffineLoopParametricTiling::runOnFunction() {
 }
 
 namespace mlir {
+namespace test {
 void registerTestAffineLoopParametricTilingPass() {
   PassRegistration<TestAffineLoopParametricTiling>(
       "test-affine-parametric-tile",
       "Tile affine loops using SSA values as tile sizes");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestCallGraph.cpp b/mlir/test/lib/Transforms/TestCallGraph.cpp
index bd651a5dfe2c..56182e28cd87 100644
--- a/mlir/test/lib/Transforms/TestCallGraph.cpp
+++ b/mlir/test/lib/Transforms/TestCallGraph.cpp
@@ -27,8 +27,10 @@ struct TestCallGraphPass
 } // end anonymous namespace
 
 namespace mlir {
+namespace test {
 void registerTestCallGraphPass() {
   PassRegistration<TestCallGraphPass> pass(
       "test-print-callgraph", "Print the contents of a constructed callgraph.");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestConstantFold.cpp b/mlir/test/lib/Transforms/TestConstantFold.cpp
index 089d450aaf37..d7b062e58825 100644
--- a/mlir/test/lib/Transforms/TestConstantFold.cpp
+++ b/mlir/test/lib/Transforms/TestConstantFold.cpp
@@ -65,8 +65,10 @@ void TestConstantFold::runOnFunction() {
 }
 
 namespace mlir {
+namespace test {
 void registerTestConstantFold() {
   PassRegistration<TestConstantFold>("test-constant-fold",
                                      "Test operation constant folding");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestConvVectorization.cpp b/mlir/test/lib/Transforms/TestConvVectorization.cpp
index 196f3ad841db..51c2807394d8 100644
--- a/mlir/test/lib/Transforms/TestConvVectorization.cpp
+++ b/mlir/test/lib/Transforms/TestConvVectorization.cpp
@@ -124,8 +124,10 @@ void TestConvVectorization::runOnOperation() {
 }
 
 namespace mlir {
+namespace test {
 void registerTestConvVectorization() {
   PassRegistration<TestConvVectorization> testTransformPatternsPass(
       "test-conv-vectorization", "Test vectorization of convolutions");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestConvertCallOp.cpp b/mlir/test/lib/Transforms/TestConvertCallOp.cpp
index 7beba01ca9ae..a612738c5dcc 100644
--- a/mlir/test/lib/Transforms/TestConvertCallOp.cpp
+++ b/mlir/test/lib/Transforms/TestConvertCallOp.cpp
@@ -19,9 +19,10 @@ using namespace mlir;
 namespace {
 
 class TestTypeProducerOpConverter
-    : public ConvertOpToLLVMPattern<TestTypeProducerOp> {
+    : public ConvertOpToLLVMPattern<test::TestTypeProducerOp> {
 public:
-  using ConvertOpToLLVMPattern<TestTypeProducerOp>::ConvertOpToLLVMPattern;
+  using ConvertOpToLLVMPattern<
+      test::TestTypeProducerOp>::ConvertOpToLLVMPattern;
 
   LogicalResult
   matchAndRewrite(Operation *op, ArrayRef<Value> operands,
@@ -43,7 +44,7 @@ class TestConvertCallOp
 
     // Populate type conversions.
     LLVMTypeConverter type_converter(m.getContext());
-    type_converter.addConversion([&](TestType type) {
+    type_converter.addConversion([&](test::TestType type) {
       return LLVM::LLVMType::getInt8PtrTy(m.getContext());
     });
 
@@ -55,7 +56,7 @@ class TestConvertCallOp
     // Set target.
     ConversionTarget target(getContext());
     target.addLegalDialect<LLVM::LLVMDialect>();
-    target.addIllegalDialect<TestDialect>();
+    target.addIllegalDialect<test::TestDialect>();
     target.addIllegalDialect<StandardOpsDialect>();
 
     if (failed(applyPartialConversion(m, target, std::move(patterns))))
@@ -66,10 +67,12 @@ class TestConvertCallOp
 } // namespace
 
 namespace mlir {
+namespace test {
 void registerConvertCallOpPass() {
   PassRegistration<TestConvertCallOp>(
       "test-convert-call-op",
       "Tests conversion of `std.call` to `llvm.call` in "
       "presence of custom types");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestConvertGPUKernelToCubin.cpp b/mlir/test/lib/Transforms/TestConvertGPUKernelToCubin.cpp
index a347b2c28031..ac217a2956d7 100644
--- a/mlir/test/lib/Transforms/TestConvertGPUKernelToCubin.cpp
+++ b/mlir/test/lib/Transforms/TestConvertGPUKernelToCubin.cpp
@@ -11,6 +11,7 @@
 #include "mlir/Pass/PassManager.h"
 #include "mlir/Target/NVVMIR.h"
 #include "llvm/Support/TargetSelect.h"
+
 using namespace mlir;
 
 #if MLIR_CUDA_CONVERSIONS_ENABLED
@@ -21,6 +22,7 @@ static OwnedBlob compilePtxToCubinForTesting(const std::string &, Location,
 }
 
 namespace mlir {
+namespace test {
 void registerTestConvertGPUKernelToCubinPass() {
   PassPipelineRegistration<>(
       "test-kernel-to-cubin",
@@ -37,5 +39,6 @@ void registerTestConvertGPUKernelToCubinPass() {
             "nvptx64-nvidia-cuda", "sm_35", "+ptx60", "nvvm.cubin"));
       });
 }
+} // namespace test
 } // namespace mlir
 #endif

diff  --git a/mlir/test/lib/Transforms/TestConvertGPUKernelToHsaco.cpp b/mlir/test/lib/Transforms/TestConvertGPUKernelToHsaco.cpp
index 54293a8099b4..f7036c92ec05 100644
--- a/mlir/test/lib/Transforms/TestConvertGPUKernelToHsaco.cpp
+++ b/mlir/test/lib/Transforms/TestConvertGPUKernelToHsaco.cpp
@@ -11,6 +11,7 @@
 #include "mlir/Pass/PassManager.h"
 #include "mlir/Target/ROCDLIR.h"
 #include "llvm/Support/TargetSelect.h"
+
 using namespace mlir;
 
 #if MLIR_ROCM_CONVERSIONS_ENABLED
@@ -21,6 +22,7 @@ static OwnedBlob compileIsaToHsacoForTesting(const std::string &, Location,
 }
 
 namespace mlir {
+namespace test {
 void registerTestConvertGPUKernelToHsacoPass() {
   PassPipelineRegistration<>(
       "test-kernel-to-hsaco",
@@ -37,5 +39,6 @@ void registerTestConvertGPUKernelToHsacoPass() {
             "amdgcn-amd-amdhsa", "gfx900", "-code-object-v3", "rocdl.hsaco"));
       });
 }
+} // namespace test
 } // namespace mlir
 #endif

diff  --git a/mlir/test/lib/Transforms/TestDominance.cpp b/mlir/test/lib/Transforms/TestDominance.cpp
index fd83e603ca2b..a138f88244a5 100644
--- a/mlir/test/lib/Transforms/TestDominance.cpp
+++ b/mlir/test/lib/Transforms/TestDominance.cpp
@@ -82,9 +82,11 @@ struct TestDominancePass : public PassWrapper<TestDominancePass, FunctionPass> {
 } // end anonymous namespace
 
 namespace mlir {
+namespace test {
 void registerTestDominancePass() {
   PassRegistration<TestDominancePass>(
       "test-print-dominance",
       "Print the dominance information for multiple regions.");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestDynamicPipeline.cpp b/mlir/test/lib/Transforms/TestDynamicPipeline.cpp
index 21e89a3a6165..57c5a598dbe4 100644
--- a/mlir/test/lib/Transforms/TestDynamicPipeline.cpp
+++ b/mlir/test/lib/Transforms/TestDynamicPipeline.cpp
@@ -103,12 +103,14 @@ class TestDynamicPipelinePass
       *this, "op-name", llvm::cl::MiscFlags::CommaSeparated,
       llvm::cl::desc("List of function name to apply the pipeline to")};
 };
-} // end namespace
+} // namespace
 
 namespace mlir {
+namespace test {
 void registerTestDynamicPipelinePass() {
   PassRegistration<TestDynamicPipelinePass>(
       "test-dynamic-pipeline", "Tests the dynamic pipeline feature by applying "
                                "a pipeline on a selected set of functions");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestExpandMemRefReshape.cpp b/mlir/test/lib/Transforms/TestExpandMemRefReshape.cpp
index ddb340a97ab4..13e13c363cc6 100644
--- a/mlir/test/lib/Transforms/TestExpandMemRefReshape.cpp
+++ b/mlir/test/lib/Transforms/TestExpandMemRefReshape.cpp
@@ -30,8 +30,10 @@ void TestExpandMemRefReshapePass::runOnFunction() {
 }
 
 namespace mlir {
+namespace test {
 void registerTestExpandMemRefReshapePass() {
   PassRegistration<TestExpandMemRefReshapePass> pass(
       "test-expand-memref-reshape", "Test expanding memref reshape");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestExpandTanh.cpp b/mlir/test/lib/Transforms/TestExpandTanh.cpp
index c33625bf24af..4baffacfae15 100644
--- a/mlir/test/lib/Transforms/TestExpandTanh.cpp
+++ b/mlir/test/lib/Transforms/TestExpandTanh.cpp
@@ -30,8 +30,10 @@ void TestExpandTanhPass::runOnFunction() {
 }
 
 namespace mlir {
+namespace test {
 void registerTestExpandTanhPass() {
   PassRegistration<TestExpandTanhPass> pass("test-expand-tanh",
                                             "Test expanding tanh");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestFinalizingBufferize.cpp b/mlir/test/lib/Transforms/TestFinalizingBufferize.cpp
index b7d48c66cae6..f74f8aef153e 100644
--- a/mlir/test/lib/Transforms/TestFinalizingBufferize.cpp
+++ b/mlir/test/lib/Transforms/TestFinalizingBufferize.cpp
@@ -50,15 +50,15 @@ struct TestFinalizingBufferizePass
   /// Converts tensor based test operations to buffer based ones using
   /// bufferize.
   class TensorBasedOpConverter
-      : public BufferizeOpConversionPattern<mlir::TensorBasedOp> {
+      : public BufferizeOpConversionPattern<test::TensorBasedOp> {
   public:
     using BufferizeOpConversionPattern<
-        mlir::TensorBasedOp>::BufferizeOpConversionPattern;
+        test::TensorBasedOp>::BufferizeOpConversionPattern;
 
     LogicalResult
-    matchAndRewrite(mlir::TensorBasedOp op, ArrayRef<Value> operands,
+    matchAndRewrite(test::TensorBasedOp op, ArrayRef<Value> operands,
                     ConversionPatternRewriter &rewriter) const final {
-      mlir::TensorBasedOpAdaptor adaptor(
+      mlir::test::TensorBasedOpAdaptor adaptor(
           operands, op.getOperation()->getAttrDictionary());
 
       // The input needs to be turned into a buffer first. Until then, bail out.
@@ -76,9 +76,9 @@ struct TestFinalizingBufferizePass
       Value newOutputBuffer = rewriter.create<AllocOp>(loc, memrefType);
 
       // Generate a new test operation that works on buffers.
-      rewriter.create<mlir::BufferBasedOp>(loc,
-                                           /*input=*/adaptor.input(),
-                                           /*output=*/newOutputBuffer);
+      rewriter.create<mlir::test::BufferBasedOp>(loc,
+                                                 /*input=*/adaptor.input(),
+                                                 /*output=*/newOutputBuffer);
 
       // Replace the results of the old op with the new output buffers.
       rewriter.replaceOp(op, newOutputBuffer);
@@ -87,7 +87,7 @@ struct TestFinalizingBufferizePass
   };
 
   void getDependentDialects(DialectRegistry &registry) const override {
-    registry.insert<TestDialect>();
+    registry.insert<test::TestDialect>();
   }
 
   void runOnOperation() override {
@@ -97,8 +97,8 @@ struct TestFinalizingBufferizePass
 
     // Mark all Standard operations legal.
     target.addLegalDialect<StandardOpsDialect>();
-    target.addLegalOp<MakeTupleOp>();
-    target.addLegalOp<GetTupleElementOp>();
+    target.addLegalOp<test::MakeTupleOp>();
+    target.addLegalOp<test::GetTupleElementOp>();
     target.addLegalOp<ModuleOp>();
     target.addLegalOp<ModuleTerminatorOp>();
 
@@ -106,7 +106,7 @@ struct TestFinalizingBufferizePass
     auto isLegalOperation = [&](Operation *op) {
       return converter.isLegal(op);
     };
-    target.addDynamicallyLegalDialect<TestDialect>(isLegalOperation);
+    target.addDynamicallyLegalDialect<test::TestDialect>(isLegalOperation);
 
     // Mark Standard Return operations illegal as long as one operand is tensor.
     target.addDynamicallyLegalOp<mlir::ReturnOp>([&](mlir::ReturnOp returnOp) {
@@ -144,7 +144,8 @@ struct TestFinalizingBufferizePass
           TypeRange TypeRange = inputs.getTypes();
           SmallVector<Type, 2> types(TypeRange.begin(), TypeRange.end());
           TupleType tuple = TupleType::get(types, builder.getContext());
-          mlir::Value value = builder.create<MakeTupleOp>(loc, tuple, inputs);
+          mlir::Value value =
+              builder.create<test::MakeTupleOp>(loc, tuple, inputs);
           return value;
         });
 
@@ -152,7 +153,7 @@ struct TestFinalizingBufferizePass
                                              TupleType resultType, Value value,
                                              SmallVectorImpl<Value> &values) {
       for (unsigned i = 0, e = resultType.size(); i < e; ++i) {
-        Value res = builder.create<GetTupleElementOp>(
+        Value res = builder.create<test::GetTupleElementOp>(
             loc, resultType.getType(i), value, builder.getI32IntegerAttr(i));
         values.push_back(res);
       }
@@ -160,8 +161,7 @@ struct TestFinalizingBufferizePass
     });
 
     OwningRewritePatternList patterns;
-    populateWithBufferizeOpConversionPatterns<mlir::ReturnOp, mlir::ReturnOp,
-                                              mlir::CopyOp>(
+    populateWithBufferizeOpConversionPatterns<ReturnOp, ReturnOp, test::CopyOp>(
         &context, converter, patterns);
     patterns.insert<TensorBasedOpConverter>(&context, converter);
 
@@ -173,6 +173,7 @@ struct TestFinalizingBufferizePass
 } // end anonymous namespace
 
 namespace mlir {
+namespace test {
 void registerTestFinalizingBufferizePass() {
   PassRegistration<
       TestFinalizingBufferizePass</*allowMemrefFunctionResults=*/false>>(
@@ -186,4 +187,5 @@ void registerTestPreparationPassWithAllowedMemrefResults() {
       "Tests finalizing buffierize conversions, allowing functions to have "
       "memref typed results.");
 }
-} // end namespace mlir
+} // namespace test
+} // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestGpuParallelLoopMapping.cpp b/mlir/test/lib/Transforms/TestGpuParallelLoopMapping.cpp
index 916b72037973..c553be62f657 100644
--- a/mlir/test/lib/Transforms/TestGpuParallelLoopMapping.cpp
+++ b/mlir/test/lib/Transforms/TestGpuParallelLoopMapping.cpp
@@ -28,12 +28,14 @@ class TestGpuGreedyParallelLoopMappingPass
       greedilyMapParallelSCFToGPU(region);
   }
 };
-} // end namespace
+} // namespace
 
 namespace mlir {
+namespace test {
 void registerTestGpuParallelLoopMappingPass() {
   PassRegistration<TestGpuGreedyParallelLoopMappingPass> registration(
       "test-gpu-greedy-parallel-loop-mapping",
       "Greedily maps all parallel loops to gpu hardware ids.");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestInlining.cpp b/mlir/test/lib/Transforms/TestInlining.cpp
index 27c0d0846269..c56a38eeded0 100644
--- a/mlir/test/lib/Transforms/TestInlining.cpp
+++ b/mlir/test/lib/Transforms/TestInlining.cpp
@@ -22,6 +22,7 @@
 #include "llvm/ADT/StringSet.h"
 
 using namespace mlir;
+using namespace mlir::test;
 
 namespace {
 struct Inliner : public PassWrapper<Inliner, FunctionPass> {
@@ -61,7 +62,9 @@ struct Inliner : public PassWrapper<Inliner, FunctionPass> {
 } // end anonymous namespace
 
 namespace mlir {
+namespace test {
 void registerInliner() {
   PassRegistration<Inliner>("test-inline", "Test inlining region calls");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestLinalgCodegenStrategy.cpp b/mlir/test/lib/Transforms/TestLinalgCodegenStrategy.cpp
index 57500bc8af8b..5e8c92c5aa04 100644
--- a/mlir/test/lib/Transforms/TestLinalgCodegenStrategy.cpp
+++ b/mlir/test/lib/Transforms/TestLinalgCodegenStrategy.cpp
@@ -143,8 +143,10 @@ void TestLinalgCodegenStrategy::runOnFunction() {
 }
 
 namespace mlir {
+namespace test {
 void registerTestLinalgCodegenStrategy() {
   PassRegistration<TestLinalgCodegenStrategy> testLinalgCodegenStrategyPass(
       "test-linalg-codegen-strategy", "Test Linalg Codegen Strategy.");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestLinalgFusionTransforms.cpp b/mlir/test/lib/Transforms/TestLinalgFusionTransforms.cpp
index 33f9429bdb27..06ff91eb074b 100644
--- a/mlir/test/lib/Transforms/TestLinalgFusionTransforms.cpp
+++ b/mlir/test/lib/Transforms/TestLinalgFusionTransforms.cpp
@@ -188,6 +188,7 @@ struct TestLinalgGreedyFusion
 } // namespace
 
 namespace mlir {
+namespace test {
 void registerTestLinalgFusionTransforms() {
   PassRegistration<TestLinalgFusionTransforms> testFusionTransformsPass(
       "test-linalg-fusion-transform-patterns",
@@ -198,4 +199,5 @@ void registerTestLinalgGreedyFusion() {
       "test-linalg-greedy-fusion",
       "Test Linalg fusion by applying a greedy test transformation.");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestLinalgHoisting.cpp b/mlir/test/lib/Transforms/TestLinalgHoisting.cpp
index 5d4031f90043..d78833e78f15 100644
--- a/mlir/test/lib/Transforms/TestLinalgHoisting.cpp
+++ b/mlir/test/lib/Transforms/TestLinalgHoisting.cpp
@@ -52,8 +52,10 @@ void TestLinalgHoisting::runOnFunction() {
 }
 
 namespace mlir {
+namespace test {
 void registerTestLinalgHoisting() {
   PassRegistration<TestLinalgHoisting> testTestLinalgHoistingPass(
       "test-linalg-hoisting", "Test Linalg hoisting functions.");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestLinalgTransforms.cpp b/mlir/test/lib/Transforms/TestLinalgTransforms.cpp
index a861b193602c..253d4adf903c 100644
--- a/mlir/test/lib/Transforms/TestLinalgTransforms.cpp
+++ b/mlir/test/lib/Transforms/TestLinalgTransforms.cpp
@@ -503,9 +503,11 @@ void TestLinalgTransforms::runOnFunction() {
 }
 
 namespace mlir {
+namespace test {
 void registerTestLinalgTransforms() {
   PassRegistration<TestLinalgTransforms> testTransformPatternsPass(
       "test-linalg-transform-patterns",
       "Test Linalg transformation patterns by applying them greedily.");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestLiveness.cpp b/mlir/test/lib/Transforms/TestLiveness.cpp
index e51ee1b5f154..5efacaf5c3b1 100644
--- a/mlir/test/lib/Transforms/TestLiveness.cpp
+++ b/mlir/test/lib/Transforms/TestLiveness.cpp
@@ -29,9 +29,11 @@ struct TestLivenessPass : public PassWrapper<TestLivenessPass, FunctionPass> {
 } // end anonymous namespace
 
 namespace mlir {
+namespace test {
 void registerTestLivenessPass() {
   PassRegistration<TestLivenessPass>(
       "test-print-liveness",
       "Print the contents of a constructed liveness information.");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestLoopFusion.cpp b/mlir/test/lib/Transforms/TestLoopFusion.cpp
index 8e6974d3735c..6cf1ae0895bd 100644
--- a/mlir/test/lib/Transforms/TestLoopFusion.cpp
+++ b/mlir/test/lib/Transforms/TestLoopFusion.cpp
@@ -192,8 +192,10 @@ void TestLoopFusion::runOnFunction() {
 }
 
 namespace mlir {
+namespace test {
 void registerTestLoopFusion() {
   PassRegistration<TestLoopFusion>("test-loop-fusion",
                                    "Tests loop fusion utility functions.");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestLoopMapping.cpp b/mlir/test/lib/Transforms/TestLoopMapping.cpp
index b8039b221153..d373b3933128 100644
--- a/mlir/test/lib/Transforms/TestLoopMapping.cpp
+++ b/mlir/test/lib/Transforms/TestLoopMapping.cpp
@@ -49,12 +49,14 @@ class TestLoopMappingPass
     });
   }
 };
-} // end namespace
+} // namespace
 
 namespace mlir {
+namespace test {
 void registerTestLoopMappingPass() {
   PassRegistration<TestLoopMappingPass>(
       "test-mapping-to-processing-elements",
       "test mapping a single loop on a virtual processor grid");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestLoopParametricTiling.cpp b/mlir/test/lib/Transforms/TestLoopParametricTiling.cpp
index a49a38ad50b4..264910182335 100644
--- a/mlir/test/lib/Transforms/TestLoopParametricTiling.cpp
+++ b/mlir/test/lib/Transforms/TestLoopParametricTiling.cpp
@@ -46,13 +46,15 @@ class SimpleParametricLoopTilingPass
       llvm::cl::desc(
           "fixed number of iterations that the outer loops should have")};
 };
-} // end namespace
+} // namespace
 
 namespace mlir {
+namespace test {
 void registerSimpleParametricTilingPass() {
   PassRegistration<SimpleParametricLoopTilingPass>(
       "test-extract-fixed-outer-loops",
       "test application of parametric tiling to the outer loops so that the "
       "ranges of outer loops become static");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestLoopUnrolling.cpp b/mlir/test/lib/Transforms/TestLoopUnrolling.cpp
index 396f08b2cba3..f67be1d3f2da 100644
--- a/mlir/test/lib/Transforms/TestLoopUnrolling.cpp
+++ b/mlir/test/lib/Transforms/TestLoopUnrolling.cpp
@@ -61,11 +61,13 @@ class TestLoopUnrollingPass
   Option<unsigned> loopDepth{*this, "loop-depth", llvm::cl::desc("Loop depth."),
                              llvm::cl::init(0)};
 };
-} // end namespace
+} // namespace
 
 namespace mlir {
+namespace test {
 void registerTestLoopUnrollingPass() {
   PassRegistration<TestLoopUnrollingPass>(
       "test-loop-unrolling", "Tests loop unrolling transformation");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestMemRefBoundCheck.cpp b/mlir/test/lib/Transforms/TestMemRefBoundCheck.cpp
index b7e84f695c71..a2df8706a339 100644
--- a/mlir/test/lib/Transforms/TestMemRefBoundCheck.cpp
+++ b/mlir/test/lib/Transforms/TestMemRefBoundCheck.cpp
@@ -46,8 +46,10 @@ void TestMemRefBoundCheck::runOnFunction() {
 }
 
 namespace mlir {
+namespace test {
 void registerMemRefBoundCheck() {
   PassRegistration<TestMemRefBoundCheck>(
       "test-memref-bound-check", "Check memref access bounds in a Function");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestMemRefDependenceCheck.cpp b/mlir/test/lib/Transforms/TestMemRefDependenceCheck.cpp
index 787c92737daf..3e96ca6450ca 100644
--- a/mlir/test/lib/Transforms/TestMemRefDependenceCheck.cpp
+++ b/mlir/test/lib/Transforms/TestMemRefDependenceCheck.cpp
@@ -111,9 +111,11 @@ void TestMemRefDependenceCheck::runOnFunction() {
 }
 
 namespace mlir {
+namespace test {
 void registerTestMemRefDependenceCheck() {
   PassRegistration<TestMemRefDependenceCheck> pass(
       "test-memref-dependence-check",
       "Checks dependences between all pairs of memref accesses.");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp b/mlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp
index dccd1ffd560d..e2a67b710ada 100644
--- a/mlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp
+++ b/mlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp
@@ -50,8 +50,10 @@ void TestMemRefStrideCalculation::runOnFunction() {
 }
 
 namespace mlir {
+namespace test {
 void registerTestMemRefStrideCalculation() {
   PassRegistration<TestMemRefStrideCalculation> pass(
       "test-memref-stride-calculation", "Test operation constant folding");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestOpaqueLoc.cpp b/mlir/test/lib/Transforms/TestOpaqueLoc.cpp
index 55b181cc9697..1d16ab7c7175 100644
--- a/mlir/test/lib/Transforms/TestOpaqueLoc.cpp
+++ b/mlir/test/lib/Transforms/TestOpaqueLoc.cpp
@@ -82,8 +82,10 @@ struct TestOpaqueLoc
 } // end anonymous namespace
 
 namespace mlir {
+namespace test {
 void registerTestOpaqueLoc() {
   PassRegistration<TestOpaqueLoc> pass(
       "test-opaque-loc", "Changes all leaf locations to opaque locations");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestSCFUtils.cpp b/mlir/test/lib/Transforms/TestSCFUtils.cpp
index 4b99f2550cc8..c4e2328fbe28 100644
--- a/mlir/test/lib/Transforms/TestSCFUtils.cpp
+++ b/mlir/test/lib/Transforms/TestSCFUtils.cpp
@@ -68,13 +68,15 @@ class TestSCFIfUtilsPass
     });
   }
 };
-} // end namespace
+} // namespace
 
 namespace mlir {
+namespace test {
 void registerTestSCFUtilsPass() {
   PassRegistration<TestSCFForUtilsPass>("test-scf-for-utils",
                                         "test scf.for utils");
   PassRegistration<TestSCFIfUtilsPass>("test-scf-if-utils",
                                        "test scf.if utils");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/test/lib/Transforms/TestVectorTransforms.cpp b/mlir/test/lib/Transforms/TestVectorTransforms.cpp
index e2a507fa1dfc..8daed18649d3 100644
--- a/mlir/test/lib/Transforms/TestVectorTransforms.cpp
+++ b/mlir/test/lib/Transforms/TestVectorTransforms.cpp
@@ -294,6 +294,7 @@ struct TestVectorTransferFullPartialSplitPatterns
 } // end anonymous namespace
 
 namespace mlir {
+namespace test {
 void registerTestVectorConversions() {
   PassRegistration<TestVectorToVectorConversion> vectorToVectorPass(
       "test-vector-to-vector-conversion",
@@ -327,4 +328,5 @@ void registerTestVectorConversions() {
       "test-vector-to-forloop",
       "Test conversion patterns to break up a vector op into a for loop");
 }
+} // namespace test
 } // namespace mlir

diff  --git a/mlir/tools/mlir-opt/mlir-opt.cpp b/mlir/tools/mlir-opt/mlir-opt.cpp
index 51a72ad05abb..d18cd116fcb3 100644
--- a/mlir/tools/mlir-opt/mlir-opt.cpp
+++ b/mlir/tools/mlir-opt/mlir-opt.cpp
@@ -27,36 +27,47 @@
 using namespace llvm;
 using namespace mlir;
 
-namespace mlir {
 // Defined in the test directory, no public header.
-void registerConvertCallOpPass();
+namespace mlir {
 void registerConvertToTargetEnvPass();
-void registerInliner();
-void registerMemRefBoundCheck();
 void registerPassManagerTestPass();
-void registerPatternsTestPass();
 void registerPrintOpAvailabilityPass();
 void registerSideEffectTestPasses();
-void registerSimpleParametricTilingPass();
 void registerSliceAnalysisTestPass();
 void registerSymbolTestPasses();
 void registerTestAffineDataCopyPass();
-void registerTestAffineLoopParametricTilingPass();
 void registerTestAffineLoopUnswitchingPass();
 void registerTestAllReduceLoweringPass();
+void registerTestFunc();
+void registerTestGpuMemoryPromotionPass();
+void registerTestLoopPermutationPass();
+void registerTestMatchers();
+void registerTestPrintDefUsePass();
+void registerTestPrintNestingPass();
+void registerTestReducer();
+void registerTestSpirvEntryPointABIPass();
+void registerTestSpirvModuleCombinerPass();
+void registerTestTraitsPass();
+void registerVectorizerTestPass();
+
+namespace test {
+void registerConvertCallOpPass();
+void registerInliner();
+void registerMemRefBoundCheck();
+void registerPatternsTestPass();
+void registerSimpleParametricTilingPass();
+void registerTestAffineLoopParametricTilingPass();
 void registerTestCallGraphPass();
 void registerTestConstantFold();
 void registerTestConvVectorization();
 void registerTestConvertGPUKernelToCubinPass();
 void registerTestConvertGPUKernelToHsacoPass();
-void registerTestDominancePass();
 void registerTestDialect(DialectRegistry &);
+void registerTestDominancePass();
 void registerTestDynamicPipelinePass();
 void registerTestExpandMemRefReshapePass();
 void registerTestExpandTanhPass();
 void registerTestFinalizingBufferizePass();
-void registerTestFunc();
-void registerTestGpuMemoryPromotionPass();
 void registerTestGpuParallelLoopMappingPass();
 void registerTestInterfaces();
 void registerTestLinalgCodegenStrategy();
@@ -67,85 +78,78 @@ void registerTestLinalgTransforms();
 void registerTestLivenessPass();
 void registerTestLoopFusion();
 void registerTestLoopMappingPass();
-void registerTestLoopPermutationPass();
 void registerTestLoopUnrollingPass();
-void registerTestMatchers();
 void registerTestMemRefDependenceCheck();
 void registerTestMemRefStrideCalculation();
 void registerTestOpaqueLoc();
 void registerTestPreparationPassWithAllowedMemrefResults();
-void registerTestPrintDefUsePass();
-void registerTestPrintNestingPass();
 void registerTestRecursiveTypesPass();
-void registerTestReducer();
-void registerTestSpirvEntryPointABIPass();
-void registerTestSpirvModuleCombinerPass();
 void registerTestSCFUtilsPass();
-void registerTestTraitsPass();
 void registerTestVectorConversions();
-void registerVectorizerTestPass();
+} // namespace test
 } // namespace mlir
 
 #ifdef MLIR_INCLUDE_TESTS
 void registerTestPasses() {
-  registerConvertCallOpPass();
   registerConvertToTargetEnvPass();
-  registerInliner();
-  registerMemRefBoundCheck();
   registerPassManagerTestPass();
-  registerPatternsTestPass();
   registerPrintOpAvailabilityPass();
   registerSideEffectTestPasses();
-  registerSimpleParametricTilingPass();
   registerSliceAnalysisTestPass();
   registerSymbolTestPasses();
   registerTestAffineDataCopyPass();
-  registerTestAllReduceLoweringPass();
   registerTestAffineLoopUnswitchingPass();
-  registerTestLoopPermutationPass();
-  registerTestCallGraphPass();
-  registerTestConvVectorization();
-  registerTestConstantFold();
-#if MLIR_CUDA_CONVERSIONS_ENABLED
-  registerTestConvertGPUKernelToCubinPass();
-#endif
-#if MLIR_ROCM_CONVERSIONS_ENABLED
-  registerTestConvertGPUKernelToHsacoPass();
-#endif
-  registerTestAffineLoopParametricTilingPass();
-  registerTestDominancePass();
-  registerTestDynamicPipelinePass();
-  registerTestFinalizingBufferizePass();
+  registerTestAllReduceLoweringPass();
   registerTestFunc();
-  registerTestExpandTanhPass();
-  registerTestExpandMemRefReshapePass();
   registerTestGpuMemoryPromotionPass();
-  registerTestInterfaces();
-  registerTestLinalgCodegenStrategy();
-  registerTestLinalgFusionTransforms();
-  registerTestLinalgGreedyFusion();
-  registerTestLinalgHoisting();
-  registerTestLinalgTransforms();
-  registerTestLivenessPass();
-  registerTestLoopFusion();
-  registerTestLoopMappingPass();
-  registerTestLoopUnrollingPass();
+  registerTestLoopPermutationPass();
   registerTestMatchers();
-  registerTestMemRefDependenceCheck();
-  registerTestMemRefStrideCalculation();
-  registerTestOpaqueLoc();
-  registerTestPreparationPassWithAllowedMemrefResults();
   registerTestPrintDefUsePass();
   registerTestPrintNestingPass();
-  registerTestRecursiveTypesPass();
   registerTestReducer();
-  registerTestGpuParallelLoopMappingPass();
   registerTestSpirvEntryPointABIPass();
   registerTestSpirvModuleCombinerPass();
-  registerTestSCFUtilsPass();
   registerTestTraitsPass();
-  registerTestVectorConversions();
   registerVectorizerTestPass();
+
+  test::registerConvertCallOpPass();
+  test::registerInliner();
+  test::registerMemRefBoundCheck();
+  test::registerPatternsTestPass();
+  test::registerSimpleParametricTilingPass();
+  test::registerTestAffineLoopParametricTilingPass();
+  test::registerTestCallGraphPass();
+  test::registerTestConstantFold();
+#if MLIR_CUDA_CONVERSIONS_ENABLED
+  test::registerTestConvertGPUKernelToCubinPass();
+#endif
+#if MLIR_ROCM_CONVERSIONS_ENABLED
+  test::registerTestConvertGPUKernelToHsacoPass();
+#endif
+  test::registerTestConvVectorization();
+  test::registerTestDominancePass();
+  test::registerTestDynamicPipelinePass();
+  test::registerTestExpandMemRefReshapePass();
+  test::registerTestExpandTanhPass();
+  test::registerTestFinalizingBufferizePass();
+  test::registerTestGpuParallelLoopMappingPass();
+  test::registerTestInterfaces();
+  test::registerTestLinalgCodegenStrategy();
+  test::registerTestLinalgFusionTransforms();
+  test::registerTestLinalgGreedyFusion();
+  test::registerTestLinalgHoisting();
+  test::registerTestLinalgTransforms();
+  test::registerTestLivenessPass();
+  test::registerTestLoopFusion();
+  test::registerTestLoopMappingPass();
+  test::registerTestLoopUnrollingPass();
+  test::registerTestMemRefDependenceCheck();
+  test::registerTestMemRefStrideCalculation();
+  test::registerTestOpaqueLoc();
+  test::registerTestPreparationPassWithAllowedMemrefResults();
+  test::registerTestRecursiveTypesPass();
+  test::registerTestSCFUtilsPass();
+  test::registerTestVectorConversions();
 }
 #endif
 
@@ -157,7 +161,7 @@ int main(int argc, char **argv) {
   DialectRegistry registry;
   registerAllDialects(registry);
 #ifdef MLIR_INCLUDE_TESTS
-  registerTestDialect(registry);
+  test::registerTestDialect(registry);
 #endif
   return failed(MlirOptMain(argc, argv, "MLIR modular optimizer driver\n",
                             registry,


        


More information about the Mlir-commits mailing list