aboutsummaryrefslogtreecommitdiff
path: root/mlir/python
diff options
context:
space:
mode:
authorOleksandr "Alex" Zinenko <zinenko@google.com>2024-04-17 15:01:59 +0200
committerGitHub <noreply@github.com>2024-04-17 15:01:59 +0200
commit73140daebbf522dbb14dc4b2f3c67dc0aa1a62dd (patch)
treec46758473c4ea2023f991d4176adcc8b90f0ca0c /mlir/python
parent971ec1f0eea324d4a1eec6709e2c97e1798a6002 (diff)
downloadllvm-73140daebbf522dbb14dc4b2f3c67dc0aa1a62dd.zip
llvm-73140daebbf522dbb14dc4b2f3c67dc0aa1a62dd.tar.gz
llvm-73140daebbf522dbb14dc4b2f3c67dc0aa1a62dd.tar.bz2
[mlir] expose transform dialect symbol merge to python (#87690)
This functionality is available in C++, make it available in Python directly to operate on transform modules.
Diffstat (limited to 'mlir/python')
-rw-r--r--mlir/python/mlir/dialects/transform/interpreter/__init__.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/mlir/python/mlir/dialects/transform/interpreter/__init__.py b/mlir/python/mlir/dialects/transform/interpreter/__init__.py
index 6145b99..34cdc43 100644
--- a/mlir/python/mlir/dialects/transform/interpreter/__init__.py
+++ b/mlir/python/mlir/dialects/transform/interpreter/__init__.py
@@ -5,7 +5,6 @@
from ....ir import Operation
from ...._mlir_libs import _mlirTransformInterpreter as _cextTransformInterpreter
-
TransformOptions = _cextTransformInterpreter.TransformOptions
@@ -31,3 +30,12 @@ def apply_named_sequence(
_cextTransformInterpreter.apply_named_sequence(*args)
else:
_cextTransformInterpreter(*args, transform_options)
+
+
+def copy_symbols_and_merge_into(target, other):
+ """Copies symbols from other into target, renaming private symbols to avoid
+ duplicates. Raises an error if copying would lead to duplicate public
+ symbols."""
+ _cextTransformInterpreter.copy_symbols_and_merge_into(
+ _unpack_operation(target), _unpack_operation(other)
+ )