Is the bufferization of func.func able to be reused on other FunctionOpInterface (original) (raw)
October 24, 2025, 3:53am 1
Hi I am new to MLIR, currently I am working on creating a new dialect which have a funcOp, and tried to bufferize after outlining these funcOps. I notice that the BufferizableOpInterfaceImpl for func dialect is nested inside one-shot-bufferize pass, so is there anyway to reuse the bufferize of func.func on my funcOps, or there is a better alternative.
Thanks for you help!
There have been attempts to make the module bufferization work on FunctionOpInterface instead of func::FuncOp, but they have been reverted due to failing tests. I think these could be fixed, but I dropped the ball on this a year ago, unfortunately.
For reference:
- Revert "[MLIR] Make `OneShotModuleBufferize` use `OpInterface` (#110322)" by banach-space · Pull Request #113124 · llvm/llvm-project · GitHub
- https://github.com/llvm/llvm-project/pull/107295
- https://github.com/llvm/llvm-project/pull/110322
Thank you for your reply Matthias,
I tried an alternative, do bufferization on func.func first, then do another lowering which transforms func.func to my func. The result looks good enough for me.
Anyway, really appreciate your help!