Is there a tool helping translate a C code into MLIR?

There is nothing upstream, but several people mentioned working on C-related dialects. Here’s one example Playing around with a C dialect and wondering about how high-level it should be.

You will have to drive optimizations manually and, at this point, there’s nothing significantly interesting we can do at C level that existing tools don’t already do (i.e., loop transformations with the polyhedral model). Many existing transformations are better suited for a significantly higher levels of abstraction, with structured multi-dimensional arrays and semantically-loaded operations such as “convolution”, which are hard to extract form C abstractions.

We are interested in eventually exploring these kinds of optimizations though, so contributions in that direction are welcome.

1 Like