Do we need OOP dialect in MLIR?

As far as I know, MLIR helps people create their own programming languages. However, there is no oop dialect in MLIR, which means we need to manage structure/class data layout and member functions by ourselves. Things gets worse when we need to use structures or member functions in prebuilt c++/rust libraries(because we need to stimulate their data layout).
Above all, do we need OOP dialect to help create oop languages? I would try my best to create this dialect if you all think it is valuable.

Checkout the Clang IR project:

1 Like

When will this ir merge into mlir?

Maybe never. Projects don’t have to live in mlir/ to be good and reusable. It may eventually join the LLVM monorepo, but most likely as a separate top-level subproject.

As to your original question, MLIR is not exactly a tool for building programming languages. It is a tool for building abstractions internal to compilers, which may be closer or farther from input languages, or not even connected to the canonical understanding of a language (e.g., if one doesn’t consider TOSA or Linalg a language in their own right). That being said, there may be folks interested specifically in modeling of, e.g., nested data structures or virtual function calls.

Consider our guidelines on contributing a new dialect, which indicate presence of a user and maintainer community as a criterion for acceptance. Note that we already have some support for data layout modeling.

2 Likes