Integrating MLIR into a Python-to-C Transpiler:

I am currently working on a Python-to-C transpiler that converts Python code into C code, and use Clang for compilation from C to Binary. The transpiler utilizes Python’s Abstract Syntax Tree (AST) to generate an extended AST and generate the corresponding C code. Recently, I have been assigned the task of integrating MLIR (Multi-Level Intermediate Representation) into this project.

  • Considering that the C code generated by the transpiler is already will be compiled with Clang using the -O3 optimization flag (or -polly for polly optimization), what additional benefits can MLIR offer in terms of performance and optimization?

  • How can MLIR be effectively integrated into an existing Python-to-C transpiler project that already utilizes Clang for final compilation output?

GitHub - zero9178/Pylir: An optimizing ahead-of-time Python Compiler uses several MLIR dialects to model python language constructs, i.e., dicts.

1 Like

thank you