- Is there any command that generate a specific mlir dialect file for a given source code (e.g: python file) ?
- Is there any command that lowers mlir to llvm-ir?
No. The client (language) is expected to write the lowering to whatever dialect mix they see fit. They may also introduce additional dialects that match the semantics of their language better. For C++, you can look at Polygeist. For Fortran, you can look at Flang. I’m not aware of any Python frontend.
For an MLIR module consisting only of dialects that have registered an LLVM IR translation interface implementation (LLVM, OpenMP, NVVM, etc. dialects),
mlir-translate --mlir-to-llvmir is the command. Any other dialects must be converted (lowered). The specific details depend on the dialects.
Actually I think there is some work in Numba with a lowering to MLIR (of course it isn’t full-fledge python either).