[Mlir-commits] [mlir] [mlir] Expose loadAllAvailableDialects to mlir-opt (PR #86374)

Mehdi Amini llvmlistbot at llvm.org
Sat Mar 23 10:32:49 PDT 2024


joker-eph wrote:

> Consider for example a unit test that leverages the one shot bufferize pass. The test has tensor, func, and let's say dialect X. When bufferizing, tensor bufferizes with memref ops, and dialect X bufferizes with dialect Y ops. The memref dialect is loaded by the one shot bufferization as part of the dependent dialects, but who is responsible to load Y?


Thanks @mfrancio for elaborating!

For dialect X to bufferize  to dialect Y, the bufferization interface must be registered.
Either this comes with dialect X, or the interface is registered as an extension.
Either way this interface implementation is what should bring the dialect Y.

here is an in-tree example of the latter: https://github.com/llvm/llvm-project/blob/3a63f737e29a2382c8ec26c0d360bd77c01a27a1/mlir/lib/Dialect/Tensor/Transforms/BufferizableOpInterfaceImpl.cpp#L1067

for the former case, it should be listed in the dependent dialects of dialect x itself.

Let me know if that addresses your problem!


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


More information about the Mlir-commits mailing list