IRDL is a dialect to represent dialects. The aim is to offer a self-contained and portable way to define dialects, without TableGen. This thread tracks the roadmap towards a first completeness goal. The goal is that once this roadmap is completed, IRDL is a compelling option to define real world dialects. If you are not familiar with IRDL, please check out the IRDL documentation page.
This is very much open to contributions! The work is divided into five main axes that can be worked on roughly independently. Each work item on the roadmap has a corresponding GitHub issue. If you are interested in any of them feel free to claim them on GitHub and discuss it there. Each issue has associated contact points of people that can answer questions or provide reviews!
I have added difficulty estimates but they don’t really mean much. The low difficulty items are for the most part good first contributions to MLIR though, if you are looking for one ![]()
C++ generator completeness
The goal is that IRDL dialects become first class citizens in MLIR. To that end, upstream MLIR offers a tool to compile IRDL definitions into C++ registrations. This generator should be expanded to support all IRDL features.
- Add support for the generation of attributes. (#158033)
Difficulty: Low Add support for the generation of regions. (#158034)
Difficulty: Low
Completed by @j2kun in #158540- Add support for the generation of variadics and optionals. (#158035)
Difficulty: Medium - Add generation of verifiers that use IRDL constructs only. (#158040)
Difficulty: Low - Add the ability to connect C+±defined attributes and types in verifiers. (#158042)
Difficulty: Medium
Embedded custom constraints
Not all constraints can be pre-baked in IRDL. We want to offer the ability to define arbitrary but portable constraints in a declarative way to add on top of the builtin constraints.
- Add a custom constraint operation with a region containing arbitrary MLIR checking for a constraint. (#158049)
Difficulty: High - Add the infrastructure to lower custom constraints and link them into the generated dialects. (#158052)
Difficulty: Medium
Operation custom format dialect
Dialects typically feature custom format for their operations, types and attributes. The goal of the custom format dialect(s) is to have the ability to define operation syntax in IR, from which printers and parsers can be generated. See #158054 for more details.
- Model custom printing as an IR. (#158054)
Difficulty: Medium - Generate C++ printers and parsers from format dialect(s) in IRDL. (#158064)
Difficulty: Low
Traits
Traits are currently not supported at all in IRDL. It should be possible to define them and attach them to operations from IRDL, including traits defined outside of IRDL.
- Add trait definition to IRDL. The traits should be simple MLIR traits, no concept akin to member functions. No parameters to traits for now. (#158066)
Difficulty: Low - Add the ability to generate glue code between an IRDL definition of a trait and an existing C++ implementation of a trait. (#158073)
Difficulty: Medium
Ranges
Ranges of items (values, types, attributes, etc.) should be a first class citizen of IRDL, to offer interesting constraints over packs of multiple items (typically variadics).
- Move variadic and optional to a type-system representation with operations. (#158077)
Difficulty: Low/Medium - Add constraints to operate on ranges directly. (#158079)
Difficulty: Low - Add the notion of scoped constraints for ranges so the same constraint variables can evaluate to different values for each range entry. (#158085)
Difficulty: Medium