diff options
| author | Ivan Ho <ivan.ho@cl.cam.ac.uk> | 2025-05-02 13:19:06 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-02 14:19:06 +0200 |
| commit | 41035f4aa8139353a532509e5d4406dbb07446ac (patch) | |
| tree | 406c28747e5391be3818b373b6fe4133bb2a441a /mlir/CMakeLists.txt | |
| parent | 5060f08c3a98c2e4976d7ec380d9d8ea1888a68c (diff) | |
[MLIR][IRDL] Added IRDL to C++ Translation (#133982)
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>
Diffstat (limited to 'mlir/CMakeLists.txt')
| -rw-r--r-- | mlir/CMakeLists.txt | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt index 9e786154a2b4..56e756d4ae55 100644 --- a/mlir/CMakeLists.txt +++ b/mlir/CMakeLists.txt @@ -63,6 +63,7 @@ list(INSERT CMAKE_MODULE_PATH 0 ) include(AddMLIR) +include(IRDLToCpp) # -BSymbolic is incompatible with TypeID if("${CMAKE_SHARED_LINKER_FLAGS}" MATCHES "-Bsymbolic[^-]") @@ -206,6 +207,7 @@ include_directories(BEFORE # Adding tools/mlir-tblgen here as calling add_tablegen sets some variables like # MLIR_TABLEGEN_EXE in PARENT_SCOPE which gets lost if that folder is included # from another directory like tools +add_subdirectory(tools/mlir-irdl-to-cpp) add_subdirectory(tools/mlir-linalg-ods-gen) add_subdirectory(tools/mlir-pdll) add_subdirectory(tools/mlir-tblgen) |
