From ef240e942a0c6144bddb61567c7c4eed0c9d4722 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ingo=20M=C3=BCller?= Date: Tue, 18 Jul 2023 08:15:53 +0000 Subject: [PATCH] [mlir][transform][bufferization][python] Add .td file for bindings. Reviewed By: springerm, ftynse Differential Revision: https://reviews.llvm.org/D155564 --- mlir/python/CMakeLists.txt | 9 +++++++++ .../mlir/dialects/BufferizationTransformOps.td | 21 +++++++++++++++++++++ .../python/mlir/dialects/transform/bufferization.py | 5 +++++ 3 files changed, 35 insertions(+) create mode 100644 mlir/python/mlir/dialects/BufferizationTransformOps.td create mode 100644 mlir/python/mlir/dialects/transform/bufferization.py diff --git a/mlir/python/CMakeLists.txt b/mlir/python/CMakeLists.txt index 39dd7b0..29152b5 100644 --- a/mlir/python/CMakeLists.txt +++ b/mlir/python/CMakeLists.txt @@ -137,6 +137,15 @@ declare_mlir_dialect_python_bindings( 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" TD_FILE dialects/SCFLoopTransformOps.td SOURCES dialects/_loop_transform_ops_ext.py diff --git a/mlir/python/mlir/dialects/BufferizationTransformOps.td b/mlir/python/mlir/dialects/BufferizationTransformOps.td new file mode 100644 index 0000000..cf2ed66 --- /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 0000000..eb77b74 --- /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 * -- 2.7.4