[all-commits] [llvm/llvm-project] c76e28: [MLIR][IRDL] Added IRDL to C++ Translation (#141248)

Ivan Ho via All-commits all-commits at lists.llvm.org
Sun May 25 07:42:51 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c76e2800e3d78fa6e8618431a6893f66f2fd3496
      https://github.com/llvm/llvm-project/commit/c76e2800e3d78fa6e8618431a6893f66f2fd3496
  Author: Ivan Ho <ihkh2 at cam.ac.uk>
  Date:   2025-05-25 (Sun, 25 May 2025)

  Changed paths:
    M mlir/CMakeLists.txt
    M mlir/cmake/modules/CMakeLists.txt
    A mlir/cmake/modules/IRDLToCpp.cmake
    M mlir/cmake/modules/MLIRConfig.cmake.in
    M mlir/include/mlir/Dialect/IRDL/IR/IRDLOps.td
    M mlir/include/mlir/InitAllTranslations.h
    A mlir/include/mlir/Target/IRDLToCpp/IRDLToCpp.h
    A mlir/include/mlir/Target/IRDLToCpp/TranslationRegistration.h
    M mlir/lib/Dialect/IRDL/IR/IRDL.cpp
    M mlir/lib/Target/CMakeLists.txt
    A mlir/lib/Target/IRDLToCpp/CMakeLists.txt
    A mlir/lib/Target/IRDLToCpp/IRDLToCpp.cpp
    A mlir/lib/Target/IRDLToCpp/Templates/DialectDecl.txt
    A mlir/lib/Target/IRDLToCpp/Templates/DialectDef.txt
    A mlir/lib/Target/IRDLToCpp/Templates/Header.txt
    A mlir/lib/Target/IRDLToCpp/Templates/PerOperationDecl.txt
    A mlir/lib/Target/IRDLToCpp/Templates/PerOperationDef.txt
    A mlir/lib/Target/IRDLToCpp/Templates/TypeDecl.txt
    A mlir/lib/Target/IRDLToCpp/Templates/TypeDef.txt
    A mlir/lib/Target/IRDLToCpp/Templates/TypeHeaderDecl.txt
    A mlir/lib/Target/IRDLToCpp/Templates/TypeHeaderDef.txt
    A mlir/lib/Target/IRDLToCpp/TemplatingUtils.h
    A mlir/lib/Target/IRDLToCpp/TranslationRegistration.cpp
    M mlir/test/Dialect/IRDL/invalid.irdl.mlir
    A mlir/test/Dialect/IRDL/invalid_names.irdl.mlir
    M mlir/test/Dialect/IRDL/regions-ops.irdl.mlir
    M mlir/test/lib/Dialect/CMakeLists.txt
    A mlir/test/lib/Dialect/TestIRDLToCpp/CMakeLists.txt
    A mlir/test/lib/Dialect/TestIRDLToCpp/TestIRDLToCppDialect.cpp
    A mlir/test/lib/Dialect/TestIRDLToCpp/TestIRDLToCppDialect.h
    A mlir/test/lib/Dialect/TestIRDLToCpp/test.testd.mlir
    A mlir/test/lib/Dialect/TestIRDLToCpp/test_conversion.testd.mlir
    A mlir/test/lib/Dialect/TestIRDLToCpp/test_irdl_to_cpp.irdl.mlir
    A mlir/test/lib/Dialect/TestIRDLToCpp/test_irdl_to_cpp_invalid_unsupported_types.irdl.mlir
    M mlir/test/tblgen-to-irdl/TestDialect.td
    A mlir/tools/mlir-irdl-to-cpp/CMakeLists.txt
    A mlir/tools/mlir-irdl-to-cpp/mlir-irdl-to-cpp.cpp
    M mlir/tools/mlir-opt/CMakeLists.txt
    M mlir/tools/mlir-opt/mlir-opt.cpp

  Log Message:
  -----------
  [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 at simplelogin.fr>
Co-authored-by: Fehr Mathieu <mathieu.fehr at gmail.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list