[Mlir-commits] [mlir] c3a8ac7 - [mlir][test] Drop op type from test passes in TestPatterns.cpp

Matthias Springer llvmlistbot at llvm.org
Thu Jun 15 03:29:39 PDT 2023


Author: Matthias Springer
Date: 2023-06-15T12:23:58+02:00
New Revision: c3a8ac79b838eca5d01d4ac0f43ecadbd3bced8b

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

LOG: [mlir][test] Drop op type from test passes in TestPatterns.cpp

When possible, use `OperationPass<>` instead of `OperationPass<ModuleOp>` or `OperationPass<FuncOp>`.

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

Added: 
    

Modified: 
    mlir/test/lib/Dialect/Test/TestPatterns.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/test/lib/Dialect/Test/TestPatterns.cpp b/mlir/test/lib/Dialect/Test/TestPatterns.cpp
index 7a633415c83c8..16c85818605d7 100644
--- a/mlir/test/lib/Dialect/Test/TestPatterns.cpp
+++ b/mlir/test/lib/Dialect/Test/TestPatterns.cpp
@@ -200,7 +200,7 @@ struct HoistEligibleOps : public OpRewritePattern<test::OneRegionOp> {
 };
 
 struct TestPatternDriver
-    : public PassWrapper<TestPatternDriver, OperationPass<ModuleOp>> {
+    : public PassWrapper<TestPatternDriver, OperationPass<>> {
   MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(TestPatternDriver)
 
   TestPatternDriver() = default;
@@ -911,7 +911,7 @@ struct TestTypeConverter : public TypeConverter {
 };
 
 struct TestLegalizePatternDriver
-    : public PassWrapper<TestLegalizePatternDriver, OperationPass<ModuleOp>> {
+    : public PassWrapper<TestLegalizePatternDriver, OperationPass<>> {
   MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(TestLegalizePatternDriver)
 
   StringRef getArgument() const final { return "test-legalize-patterns"; }
@@ -1122,7 +1122,7 @@ struct TestRemapValueInRegion
 };
 
 struct TestRemappedValue
-    : public mlir::PassWrapper<TestRemappedValue, OperationPass<func::FuncOp>> {
+    : public mlir::PassWrapper<TestRemappedValue, OperationPass<>> {
   MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(TestRemappedValue)
 
   StringRef getArgument() const final { return "test-remapped-value"; }
@@ -1182,8 +1182,7 @@ struct RemoveTestDialectOps : public RewritePattern {
 };
 
 struct TestUnknownRootOpDriver
-    : public mlir::PassWrapper<TestUnknownRootOpDriver,
-                               OperationPass<func::FuncOp>> {
+    : public mlir::PassWrapper<TestUnknownRootOpDriver, OperationPass<>> {
   MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(TestUnknownRootOpDriver)
 
   StringRef getArgument() const final {
@@ -1357,7 +1356,7 @@ struct TestTypeConversionAnotherProducer
 };
 
 struct TestTypeConversionDriver
-    : public PassWrapper<TestTypeConversionDriver, OperationPass<ModuleOp>> {
+    : public PassWrapper<TestTypeConversionDriver, OperationPass<>> {
   MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(TestTypeConversionDriver)
 
   void getDependentDialects(DialectRegistry &registry) const override {
@@ -1494,8 +1493,7 @@ struct ForwardOperandPattern : public OpConversionPattern<TestTypeChangerOp> {
 };
 
 struct TestTargetMaterializationWithNoUses
-    : public PassWrapper<TestTargetMaterializationWithNoUses,
-                         OperationPass<ModuleOp>> {
+    : public PassWrapper<TestTargetMaterializationWithNoUses, OperationPass<>> {
   MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(
       TestTargetMaterializationWithNoUses)
 
@@ -1603,8 +1601,7 @@ struct TestMergeSingleBlockOps
 };
 
 struct TestMergeBlocksPatternDriver
-    : public PassWrapper<TestMergeBlocksPatternDriver,
-                         OperationPass<ModuleOp>> {
+    : public PassWrapper<TestMergeBlocksPatternDriver, OperationPass<>> {
   MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(TestMergeBlocksPatternDriver)
 
   StringRef getArgument() const final { return "test-merge-blocks"; }


        


More information about the Mlir-commits mailing list