diff options
| author | Ivan Ho <ihkh2@cam.ac.uk> | 2025-05-25 15:42:30 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-25 16:42:30 +0200 |
| commit | c76e2800e3d78fa6e8618431a6893f66f2fd3496 (patch) | |
| tree | cff744bc4d83de96eafe29059c1a7aababcbac37 /mlir/CMakeLists.txt | |
| parent | 63eb00483fe97bbf6b7f26d1827b777518544e8f (diff) | |
[MLIR][IRDL] Added IRDL to C++ Translation (#141248)
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 daedc2be2258..44493b75b8a8 100644 --- a/mlir/CMakeLists.txt +++ b/mlir/CMakeLists.txt @@ -68,6 +68,7 @@ list(INSERT CMAKE_MODULE_PATH 0 ) include(AddMLIR) +include(IRDLToCpp) # -BSymbolic is incompatible with TypeID if("${CMAKE_SHARED_LINKER_FLAGS}" MATCHES "-Bsymbolic[^-]") @@ -211,6 +212,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) |
