-
Notifications
You must be signed in to change notification settings - Fork 14.1k
[MLIR][IRDL] Added IRDL to C++ Translation #141248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… hhkit/irdl-to-cpp
…-project into hhkit/irdl-to-cpp
but rather ugly c++ code because <3 lambdas
* first draft of irdl-to-cpp toolchain * basic mlir-irdl-to-cpp tool * it works!!
Co-authored-by: Fehr Mathieu <mathieu.fehr@gmail.com>
Co-authored-by: Fehr Mathieu <mathieu.fehr@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving per reviews in #133982
mlir/tools/mlir-opt/mlir-opt.cpp
Outdated
@@ -302,6 +304,7 @@ void registerTestPasses() { | |||
mlir::test::registerTestVectorReductionToSPIRVDotProd(); | |||
mlir::test::registerTestVulkanRunnerPipeline(); | |||
mlir::test::registerTestWrittenToPass(); | |||
mlir::test::registerTestIrdlTestDialectConversionPass(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add this in alphabetical order?
mlir/tools/mlir-opt/mlir-opt.cpp
Outdated
@@ -331,6 +334,7 @@ int main(int argc, char **argv) { | |||
::test::registerTestTransformsTransformDialectExtension(registry); | |||
::test::registerTestTilingInterfaceTransformDialectExtension(registry); | |||
::test::registerTestDynDialect(registry); | |||
::test::registerIrdlTestDialect(registry); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you're at it could you sort this alphabetically too if that doesn't break anything (just try it and if CI complain let's reverse)?
This PR introduces a new tool, mlir-irdl-to-cpp, that converts IRDL to C++ definitions. The C++ definitions allow use of the IRDL-defined dialect in MLIR C++ infrastructure, enabling the use of conversion patterns with IRDL dialects for example. This PR also adds CMake utilities to easily integrate the IRDL dialects into MLIR projects. Note that most IRDL features are not supported. In general, we are only able to define simple types and operations. - The only type constraint supported is irdl.any. - Variadic operands and results are not supported. - Verifiers for the IRDL constraints are not generated. - Attributes are not supported. --------- Co-authored-by: Théo Degioanni <theo.degioanni.llvm.deluge062@simplelogin.fr> Co-authored-by: Fehr Mathieu <mathieu.fehr@gmail.com>
A re-attempt at merging IRDL-to-CPP (#133982) after a sanitizer check failed in post-merge CI (resolving #138285).
This PR introduces a new tool, mlir-irdl-to-cpp, that converts IRDL to C++ definitions.
The C++ definitions allow use of the IRDL-defined dialect in MLIR C++ infrastructure, enabling the use of conversion patterns with IRDL dialects for example. This PR also adds CMake utilities to easily integrate the IRDL dialects into MLIR projects.
Note that most IRDL features are not supported. In general, we are only able to define simple types and operations.