[Mlir-commits] [mlir] ef240e9 - [mlir][transform][bufferization][python] Add .td file for bindings.

Ingo Müller llvmlistbot at llvm.org
Tue Jul 18 07:16:43 PDT 2023


Author: Ingo Müller
Date: 2023-07-18T14:16:37Z
New Revision: ef240e942a0c6144bddb61567c7c4eed0c9d4722

URL: https://github.com/llvm/llvm-project/commit/ef240e942a0c6144bddb61567c7c4eed0c9d4722
DIFF: https://github.com/llvm/llvm-project/commit/ef240e942a0c6144bddb61567c7c4eed0c9d4722.diff

LOG: [mlir][transform][bufferization][python] Add .td file for bindings.

Reviewed By: springerm, ftynse

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

Added: 
    mlir/python/mlir/dialects/BufferizationTransformOps.td
    mlir/python/mlir/dialects/transform/bufferization.py

Modified: 
    mlir/python/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/mlir/python/CMakeLists.txt b/mlir/python/CMakeLists.txt
index 39dd7b006c89a1..29152b5c5c7d65 100644
--- a/mlir/python/CMakeLists.txt
+++ b/mlir/python/CMakeLists.txt
@@ -134,6 +134,15 @@ declare_mlir_dialect_python_bindings(
     _mlir_libs/_mlir/dialects/transform/__init__.pyi
   DIALECT_NAME transform)
 
+declare_mlir_dialect_extension_python_bindings(
+  ADD_TO_PARENT MLIRPythonSources.Dialects
+  ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/mlir"
+  TD_FILE dialects/BufferizationTransformOps.td
+  SOURCES
+    dialects/transform/bufferization.py
+  DIALECT_NAME transform
+  EXTENSION_NAME bufferization_transform)
+
 declare_mlir_dialect_extension_python_bindings(
   ADD_TO_PARENT MLIRPythonSources.Dialects
   ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/mlir"

diff  --git a/mlir/python/mlir/dialects/BufferizationTransformOps.td b/mlir/python/mlir/dialects/BufferizationTransformOps.td
new file mode 100644
index 00000000000000..cf2ed661fe0b00
--- /dev/null
+++ b/mlir/python/mlir/dialects/BufferizationTransformOps.td
@@ -0,0 +1,21 @@
+//===-- BufferizationTransformOps.td -----------------------*- tablegen -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// Entry point of the Python bindings generator for the transform ops provided
+// by the bufferization dialect.
+//
+//===----------------------------------------------------------------------===//
+
+
+#ifndef PYTHON_BINDINGS_BUFFERIZATION_TRANSFORM_OPS
+#define PYTHON_BINDINGS_BUFFERIZATION_TRANSFORM_OPS
+
+include "mlir/Bindings/Python/Attributes.td"
+include "mlir/Dialect/Bufferization/TransformOps/BufferizationTransformOps.td"
+
+#endif // PYTHON_BINDINGS_BUFFERIZATION_TRANSFORM_OPS

diff  --git a/mlir/python/mlir/dialects/transform/bufferization.py b/mlir/python/mlir/dialects/transform/bufferization.py
new file mode 100644
index 00000000000000..eb77b746cf864f
--- /dev/null
+++ b/mlir/python/mlir/dialects/transform/bufferization.py
@@ -0,0 +1,5 @@
+#  Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+#  See https://llvm.org/LICENSE.txt for license information.
+#  SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+from .._bufferization_transform_ops_gen import *


        


More information about the Mlir-commits mailing list