diff --git a/mlir/python/CMakeLists.txt b/mlir/python/CMakeLists.txt --- a/mlir/python/CMakeLists.txt +++ b/mlir/python/CMakeLists.txt @@ -164,6 +164,15 @@ DIALECT_NAME transform EXTENSION_NAME loop_transform) +declare_mlir_dialect_extension_python_bindings( + ADD_TO_PARENT MLIRPythonSources.Dialects + ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/mlir" + TD_FILE dialects/MemRefTransformOps.td + SOURCES + dialects/transform/memref.py + DIALECT_NAME transform + EXTENSION_NAME memref_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/MemRefTransformOps.td b/mlir/python/mlir/dialects/MemRefTransformOps.td new file mode 100644 --- /dev/null +++ b/mlir/python/mlir/dialects/MemRefTransformOps.td @@ -0,0 +1,14 @@ +//===-- MemRefTransformOps.td - Memref transform ops -------*- 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 +// +//===----------------------------------------------------------------------===// + +#ifndef PYTHON_BINDINGS_MEMREF_TRANSFORM_OPS +#define PYTHON_BINDINGS_MEMREF_TRANSFORM_OPS + +include "mlir/Dialect/MemRef/TransformOps/MemRefTransformOps.td" + +#endif diff --git a/mlir/python/mlir/dialects/transform/memref.py b/mlir/python/mlir/dialects/transform/memref.py new file mode 100644 --- /dev/null +++ b/mlir/python/mlir/dialects/transform/memref.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 .._memref_transform_ops_gen import * diff --git a/utils/bazel/llvm-project-overlay/mlir/python/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/python/BUILD.bazel --- a/utils/bazel/llvm-project-overlay/mlir/python/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/python/BUILD.bazel @@ -841,6 +841,25 @@ ], ) +gentbl_filegroup( + name = "MemRefTransformOpsPyGen", + tbl_outs = [ + ( + [ + "-gen-python-op-bindings", + "-bind-dialect=transform", + "-dialect-extension=memref_transform", + ], + "mlir/dialects/_memref_transform_ops_gen.py", + ), + ], + tblgen = "//mlir:mlir-tblgen", + td_file = "mlir/dialects/MemRefTransformOps.td", + deps = [ + "//mlir:MemRefTransformOpsTdFiles", + ], +) + gentbl_filegroup( name = "PDLTransformOpsPyGen", tbl_outs = [ @@ -876,6 +895,7 @@ ":BufferizationTransformOpsPyGen", ":GPUTransformOpsPyGen", ":LoopTransformOpsPyGen", + ":MemRefTransformOpsPyGen", ":PDLTransformOpsPyGen", ":StructuredTransformOpsPyGen", ":TransformOpsPyGen",