diff options
author | Oleksandr "Alex" Zinenko <zinenko@google.com> | 2024-04-17 15:01:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-17 15:01:59 +0200 |
commit | 73140daebbf522dbb14dc4b2f3c67dc0aa1a62dd (patch) | |
tree | c46758473c4ea2023f991d4176adcc8b90f0ca0c /mlir/python | |
parent | 971ec1f0eea324d4a1eec6709e2c97e1798a6002 (diff) | |
download | llvm-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__.py | 10 |
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) + ) |