[Mlir-commits] [mlir] [mlir][transform] Add an op for replacing values with function calls (PR #78398)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Wed Jan 17 01:58:13 PST 2024


================
@@ -280,6 +280,28 @@ def PatternDescriptorOpInterface : OpInterface<"PatternDescriptorOpInterface"> {
   ];
 }
 
+def TypeConversionOpInterface : OpInterface<"TypeConversionOpInterface"> {
+  let description = [{
+    This interface should be implemented by ops that populate type casting
+    of a `transform.cast_and_inline` op. It provides a method to populate a
+    type converter with source/target materialization patterns.
+  }];
+
+  let cppNamespace = "::mlir::transform";
+
+  let methods = [
+    InterfaceMethod<
+      /*desc=*/[{
+        Populate the given type converter with source/target materialization
+        functions.
+      }],
+      /*returnType=*/"void",
+      /*name=*/"populateTypeMaterializations",
+      /*arguments=*/(ins "::mlir::TypeConverter &":$converter)
+    >
+  ];
----------------
ftynse wrote:

Can this somehow be merged with `TypeConverterBuilderOpInterface`? E.g., have an op that creates the converter and sets up materializations correctly. Or modify the existing interface so that it can update a preexisting converter somehow (do we need a converter handle)?

https://github.com/llvm/llvm-project/pull/78398


More information about the Mlir-commits mailing list