[Mlir-commits] [mlir] [MLIR][Transform][Python] Sync derived classes and their wrappers (PR #166871)
Rolf Morel
llvmlistbot at llvm.org
Fri Nov 7 04:50:31 PST 2025
rolfmorel wrote:
Discussed it with @makslevental yesterday. In the case of these transform ops, the derived classes and wrappers really only serve two purposes: add type hints and add `_ods_common.get_op_result_or_value` around operand arguments. Both of these could _in principle_ be derived from tablegen and be part of the auto-generated classes and wrappers.
>From my perspective, the main issue is the mapping from tablegen types, i.e. C++ types, to the type hints. I figure it would be something like https://github.com/llvm/llvm-project/blob/3719c438dc4a6d5035fc8da4bfe2a04acdaecfea/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp#L492-L556
When I find some time, I can try implement something like that. If someone has a better idea of how to encode the mapping from MLIR/C++ types to Python type hints, please let me know!
https://github.com/llvm/llvm-project/pull/166871
More information about the Mlir-commits
mailing list