[mlir] make transform.loop.outline also return the call handle

Outlining is particularly interesting when the outlined function is
replaced with something else, e.g., a microkernel. It is good to have a
handle to the call in this case.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D149849
This commit is contained in:
Alex Zinenko
2023-05-04 14:13:06 +00:00
parent 3b6bc87520
commit d906426944
6 changed files with 36 additions and 24 deletions

View File

@@ -39,7 +39,8 @@ class LoopOutlineOp:
def __init__(
self,
result_type: Type,
function_type: Type,
call_type: Type,
target: Union[Operation, Value],
*,
func_name: Union[str, StringAttr],
@@ -47,7 +48,8 @@ class LoopOutlineOp:
loc=None,
):
super().__init__(
result_type,
function_type,
call_type,
_get_op_result_or_value(target),
func_name=(func_name if isinstance(func_name, StringAttr) else
StringAttr.get(func_name)),