mlir-tutorial icon indicating copy to clipboard operation
mlir-tutorial copied to clipboard

Shared Library Build Option

Open monowaranjum opened this issue 1 year ago • 2 comments
trafficstars

Hi, Thank you so much for the tutorial series. It is really great and helped me a lot to understand a few core concepts of MLIR framework.

I was wondering if you can also include a tutorial where you show the way to build the passes as standalone shared library and show the process to call load the dialect and the pass library from command line using mlir-opt. I think this would be a great addition to the already great tutorial series.

Thanks in advance.

monowaranjum avatar Nov 27 '23 21:11 monowaranjum

I was not aware this is possible. Where did you hear about it?

j2kun avatar Nov 27 '23 22:11 j2kun

Hi. Thank you for the response. Here is the way it works in LLVM :

opt -load <shared-lib-of-some-pass.so> --<name-of-the-pass-registered-in-passmanager> <other-options> <input-ir-file>

Here is what was proposed similar for MLIR:

https://discourse.llvm.org/t/rfc-load-pass-plugin-for-mlir-opt/65049

Here is what I see when I run mlir-opt --help | grep plugin.

image

So I thought that this functionality may have been added. But I can not find any code example or documentation of this feature.

I built MLIR from source based on this commit: 28b27c1b10ae8d1f5b4fb9df691e8cf0da9be3f6

monowaranjum avatar Nov 28 '23 16:11 monowaranjum