[all-commits] [llvm/llvm-project] 471488: [mlir][python] Add `walk` method to PyOperationBas...
Hideto Ueno via All-commits
all-commits at lists.llvm.org
Tue Apr 16 23:10:09 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 47148832d4e3bf4901430732f1af6673147accb2
https://github.com/llvm/llvm-project/commit/47148832d4e3bf4901430732f1af6673147accb2
Author: Hideto Ueno <uenoku.tokotoko at gmail.com>
Date: 2024-04-17 (Wed, 17 Apr 2024)
Changed paths:
M mlir/include/mlir-c/IR.h
M mlir/include/mlir/Bindings/Python/PybindAdaptors.h
M mlir/lib/Bindings/Python/IRCore.cpp
M mlir/lib/Bindings/Python/IRModule.h
M mlir/lib/CAPI/IR/IR.cpp
M mlir/test/CAPI/ir.c
M mlir/test/python/ir/operation.py
Log Message:
-----------
[mlir][python] Add `walk` method to PyOperationBase (#87962)
This commit adds `walk` method to PyOperationBase that uses a python
object as a callback, e.g. `op.walk(callback)`. Currently callback must
return a walk result explicitly.
We(SiFive) have implemented walk method with python in our internal
python tool for a while. However the overhead of python is expensive and
it didn't scale well for large MLIR files. Just replacing walk with this
version reduced the entire execution time of the tool by 30~40% and
there are a few configs that the tool takes several hours to finish so
this commit significantly improves tool performance.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list