Generating .mlir files

I would like to know if there’s a way to manually generate .mlir files. By that, I mean writing the .mlir files by hand without going from the original program in my DSL and then generating the .mlir. I noticed that there are .mlir files in this repository (GitHub - Lewuathe/mlir-hello: MLIR Sample dialect), but I didn’t see any tool in the code that assists in generating the .mlir files. Therefore, I assume that they were written manually.

Although I didn’t know the good tool to generate the .mlir files, the .mlir files in that repository was written by hand as you said.

I think we may be able to generate .mlir file by using C API or Python binding and dump the module, which is requiring you to write program though.