-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
[mlir][tools] Introduce tblgen-to-irdl tool #66865
Conversation
This patch adds a new tool, tblgen-to-irdl, which is an IRDL backend to MLIR ODS. Currently, the tool only covers operation and dialect definitions and generates verifiers constraints as "irdl::CPred", which is the constraint as a C++ string. The tool currently does not support traits/interfaces/regions/variadics as they are not added in IRDL yet, so the generated definitions would not be correct for operations using them. Support for these things will be added as they are implemented in IRDL. This tool acts as a bridge to convert TableGen-defined dialects into IRDL definitions, making operation definitions more easily introspectable. This introspectablility allows for tools like fuzzers, mutators, and reducers to work on ODS definitions as a MLIR dialect instead of trying to navigate through TableGen. Differential Revision: https://reviews.llvm.org/D156469
Is there some context to read on this somewhere? A discourse thread? |
Sorry, was just moving it from phab. I will add more context it a bit. |
Why a separate binary and not just another backend for mlir-tblgen? |
The reason I did not make this a backend for mlir-tblgen is that this would add a dependency of MLIRIR on mlir-tblgen. I’m not sure how this dependency affects things as I expect the MLIRIR definitions to be generated by mlir-tblgen and mlir-tblgen would start depending on those definitions. The same question was asked on the RFC as well :) (https://discourse.llvm.org/t/rfc-tblgen-to-irdl-tool/73578/8) |
This PR does not modify lib/IR/... ; can you clarify where is this dependency coming from? |
oops. I meant the other way around, mlir-tblgen would start depending on MLIRIR, since to generate IRDL, we use IR Builders. |
@joker-eph @Mogball gentle ping :) |
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.
nice
This reverts commit e6e9beb due to an ongoing buildbot breakage starting from https://lab.llvm.org/buildbot/#/builders/168/builds/16127 to present (https://lab.llvm.org/buildbot/#/builders/168/builds/16152)
RFC: https://discourse.llvm.org/t/rfc-tblgen-to-irdl-tool/73578