https://github.com/ftynse requested changes to this pull request. Thank you for the patch! Please address the comments and consider making this transformation operate on `FunctionOpInterface`. https://github.com/llvm/llvm-project/pull/143381