[all-commits] [llvm/llvm-project] 1f8618: [mlir] python enum bindings generator

ftynse via All-commits all-commits at lists.llvm.org
Mon Jul 31 08:43:17 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1f8618f88c58509d0ef8fae813f708a9dc2a86d8
      https://github.com/llvm/llvm-project/commit/1f8618f88c58509d0ef8fae813f708a9dc2a86d8
  Author: Alex Zinenko <zinenko at google.com>
  Date:   2023-07-31 (Mon, 31 Jul 2023)

  Changed paths:
    M mlir/python/CMakeLists.txt
    M mlir/python/mlir/dialects/_transform_ops_ext.py
    M mlir/python/mlir/dialects/transform/__init__.py
    A mlir/test/mlir-tblgen/enums-python-bindings.td
    M mlir/tools/mlir-tblgen/CMakeLists.txt
    A mlir/tools/mlir-tblgen/EnumPythonBindingGen.cpp
    M utils/bazel/llvm-project-overlay/mlir/python/BUILD.bazel

  Log Message:
  -----------
  [mlir] python enum bindings generator

Add an ODS (tablegen) backend to generate Python enum classes and
attribute builders for enum attributes defined in ODS. This will allow
us to keep the enum attribute definitions in sync between C++ and
Python, as opposed to handwritten enum classes in Python that may end up
using mismatching values. This also makes autogenerated bindings more
convenient even in absence of mixins.

Use this backend for the transform dialect failure propagation mode enum
attribute as demonstration.

Reviewed By: ingomueller-net

Differential Revision: https://reviews.llvm.org/D156553


  Commit: d517117303ce298abf65e20c6502014f48df481d
      https://github.com/llvm/llvm-project/commit/d517117303ce298abf65e20c6502014f48df481d
  Author: Alex Zinenko <zinenko at google.com>
  Date:   2023-07-31 (Mon, 31 Jul 2023)

  Changed paths:
    M mlir/include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.td
    M mlir/python/CMakeLists.txt
    A mlir/python/mlir/dialects/VectorTransformOps.td
    A mlir/python/mlir/dialects/transform/vector.py
    A mlir/test/python/dialects/transform_vector_ext.py
    M utils/bazel/llvm-project-overlay/mlir/python/BUILD.bazel

  Log Message:
  -----------
  [mlir] python bindings for vector transform ops

Provide Python bindings for transform ops defined in the vector dialect.
All of these ops are sufficiently simple that no mixins are necessary
for them to be nicely usable.

Reviewed By: ingomueller-net

Differential Revision: https://reviews.llvm.org/D156554


Compare: https://github.com/llvm/llvm-project/compare/235390d930be...d517117303ce


More information about the All-commits mailing list