commit | 6ca2d9cc8fb12ccfcb3f0f89b1951507c1504d24 | [log] [tgz] |
---|---|---|
author | Hideto Ueno <uenoku.tokotoko@gmail.com> | Wed Apr 17 15:09:47 2024 +0900 |
committer | Copybara-Service <copybara-worker@google.com> | Tue Apr 16 23:12:01 2024 -0700 |
tree | 5e934218e45f7ff33111b1384c4112b3d59799ac | |
parent | 880966dff9a115a36e3a1c5011f98cf3050caac1 [diff] |
[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. GitOrigin-RevId: 47148832d4e3bf4901430732f1af6673147accb2
See https://mlir.llvm.org/ for more information.