[Mlir-commits] [mlir] d563211 - Fix test dialect to avoid using an unregistered dialect

Mehdi Amini llvmlistbot at llvm.org
Mon Mar 13 08:51:20 PDT 2023


Author: Mehdi Amini
Date: 2023-03-13T16:51:01+01:00
New Revision: d563211f75080995ed9037861185d45ccf812cca

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

LOG: Fix test dialect to avoid using an unregistered dialect

Fixes #61374

Added: 
    

Modified: 
    mlir/test/IR/pretty_printed_region_op.mlir
    mlir/test/lib/Dialect/Test/TestDialect.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/test/IR/pretty_printed_region_op.mlir b/mlir/test/IR/pretty_printed_region_op.mlir
index f009231735a57..0a81f9d53a309 100644
--- a/mlir/test/IR/pretty_printed_region_op.mlir
+++ b/mlir/test/IR/pretty_printed_region_op.mlir
@@ -5,14 +5,14 @@
 // -----
 
 func.func @pretty_printed_region_op(%arg0 : f32, %arg1 : f32) -> (f32) {
-// CHECK-CUSTOM:  test.pretty_printed_region %arg1, %arg0 start special.op end : (f32, f32) -> f32
+// CHECK-CUSTOM:  test.pretty_printed_region %arg1, %arg0 start test.special.op end : (f32, f32) -> f32
 // CHECK-GENERIC: "test.pretty_printed_region"(%arg1, %arg0)
 // CHECK-GENERIC:   ^bb0(%arg[[x:[0-9]+]]: f32, %arg[[y:[0-9]+]]: f32
-// CHECK-GENERIC:     %[[RES:.*]] = "special.op"(%arg[[x]], %arg[[y]]) : (f32, f32) -> f32
+// CHECK-GENERIC:     %[[RES:.*]] = "test.special.op"(%arg[[x]], %arg[[y]]) : (f32, f32) -> f32
 // CHECK-GENERIC:     "test.return"(%[[RES]]) : (f32) -> ()
 // CHECK-GENERIC:  : (f32, f32) -> f32
 
-  %res = test.pretty_printed_region %arg1, %arg0 start special.op end : (f32, f32) -> (f32) loc("some_NameLoc")
+  %res = test.pretty_printed_region %arg1, %arg0 start test.special.op end : (f32, f32) -> (f32) loc("some_NameLoc")
   return %res : f32
 }
 
@@ -22,13 +22,13 @@ func.func @pretty_printed_region_op(%arg0 : f32, %arg1 : f32) -> (f32) {
 // CHECK-CUSTOM:  test.pretty_printed_region %arg1, %arg0
 // CHECK-GENERIC: "test.pretty_printed_region"(%arg1, %arg0)
 // CHECK:          ^bb0(%arg[[x:[0-9]+]]: f32, %arg[[y:[0-9]+]]: f32):
-// CHECK:            %[[RES:.*]] = "non.special.op"(%arg[[x]], %arg[[y]]) : (f32, f32) -> f32
+// CHECK:            %[[RES:.*]] = "test.non.special.op"(%arg[[x]], %arg[[y]]) : (f32, f32) -> f32
 // CHECK:            "test.return"(%[[RES]]) : (f32) -> ()
 // CHECK:          : (f32, f32) -> f32
 
   %0 = test.pretty_printed_region %arg1, %arg0 ({
     ^bb0(%arg2: f32, %arg3: f32):
-      %1 = "non.special.op"(%arg2, %arg3) : (f32, f32) -> f32
+      %1 = "test.non.special.op"(%arg2, %arg3) : (f32, f32) -> f32
       "test.return"(%1) : (f32) -> ()
     }) : (f32, f32) -> f32
     return %0 : f32
@@ -39,11 +39,11 @@ func.func @pretty_printed_region_op(%arg0 : f32, %arg1 : f32) -> (f32) {
 func.func @pretty_printed_region_op_deferred_loc(%arg0 : f32, %arg1 : f32) -> (f32) {
 // CHECK-LOCATION: "test.pretty_printed_region"(%arg1, %arg0)
 // CHECK-LOCATION:   ^bb0(%arg[[x:[0-9]+]]: f32 loc("foo"), %arg[[y:[0-9]+]]: f32 loc("foo")
-// CHECK-LOCATION:     %[[RES:.*]] = "special.op"(%arg[[x]], %arg[[y]]) : (f32, f32) -> f32
+// CHECK-LOCATION:     %[[RES:.*]] = "test.special.op"(%arg[[x]], %arg[[y]]) : (f32, f32) -> f32
 // CHECK-LOCATION:     "test.return"(%[[RES]]) : (f32) -> ()
 // CHECK-LOCATION:  : (f32, f32) -> f32
 
-  %res = test.pretty_printed_region %arg1, %arg0 start special.op end : (f32, f32) -> (f32) loc("foo")
+  %res = test.pretty_printed_region %arg1, %arg0 start test.special.op end : (f32, f32) -> (f32) loc("foo")
   return %res : f32
 }
 

diff  --git a/mlir/test/lib/Dialect/Test/TestDialect.cpp b/mlir/test/lib/Dialect/Test/TestDialect.cpp
index 160637a128f56..97c77b0eb4898 100644
--- a/mlir/test/lib/Dialect/Test/TestDialect.cpp
+++ b/mlir/test/lib/Dialect/Test/TestDialect.cpp
@@ -1118,10 +1118,10 @@ void PrettyPrintedRegionOp::print(OpAsmPrinter &p) {
   // Assuming that region has a single non-terminator inner-op, if the inner-op
   // meets some criteria (which in this case is a simple one  based on the name
   // of inner-op), then we can print the entire region in a succinct way.
-  // Here we assume that the prototype of "special.op" can be trivially derived
+  // Here we assume that the prototype of "test.special.op" can be trivially derived
   // while parsing it back.
-  if (innerOp.getName().getStringRef().equals("special.op")) {
-    p << " start special.op end";
+  if (innerOp.getName().getStringRef().equals("test.special.op")) {
+    p << " start test.special.op end";
   } else {
     p << " (";
     p.printRegion(getRegion());


        


More information about the Mlir-commits mailing list