[Mlir-commits] [mlir] [mlir][bufferization] Support custom types at function boundaries (PR #159766)

Andrei Golubev llvmlistbot at llvm.org
Mon Sep 22 01:11:03 PDT 2025


================
@@ -43,6 +43,18 @@ def Bufferization_TensorLikeTypeInterface
       /*args=*/(ins
         "::mlir::bufferization::BufferLikeType":$bufferType,
         "::llvm::function_ref<::mlir::InFlightDiagnostic()>":$emitError)
+    >,
+    InterfaceMethod<[{
----------------
andrey-golubev wrote:

i don't need to access the function (at least in my custom types), i'm actually intrigued why the `FunctionArgTypeConverterFn` needs it (e.g. the option function doesn't even take an index, so one has no info about *which* argument they're dealing with).

thought of the interface here because this seems to be aligned with what we've discussed before:
* we (mostly) have options to customize builtin types behaviour
* interface methods on top of tensor-like / buffer-like is where users provide customization for user types

out of the obvious challenges, doing this via options practically means users have to create their own "pass" (i.e. bufferizeOp() has to be seeded with different functions that aren't really configurable outside of C++).

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


More information about the Mlir-commits mailing list