[Mlir-commits] [mlir] [mlir][python] Add `walk` method to PyOperationBase (PR #87962)

Hideto Ueno llvmlistbot at llvm.org
Mon Apr 8 01:08:35 PDT 2024


https://github.com/uenoku commented:

Thank you for the feedback!

> We have access to op nesting structure of regions/blocks, so it shouldn't be hard. 

Yes exactly! We (SiFive) have implemented walk method in that way 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 witin SIFive. Just replacing `walk` with this version reduced the entire execution time by 30~40% and there are a few configs that the tool takes several hours to finish so we want to use the native walk method. 

I agree that debugging will be harder so I'm fine if we cannot upstream this. In that case we'll probably implement it in CIRCT as a helper function. 

https://github.com/llvm/llvm-project/pull/87962


More information about the Mlir-commits mailing list