mirror of
https://github.com/intel/llvm.git
synced 2026-01-31 16:29:50 +08:00
[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.
This commit is contained in:
committed by
GitHub
parent
971ec1f0ee
commit
73140daebb
@@ -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)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user