[Mlir-commits] [mlir] [MLIR][LLVM] Fix inlining of a single block ending with unreachable (PR #122646)

Tobias Gysi llvmlistbot at llvm.org
Mon Jan 13 01:04:27 PST 2025


gysit wrote:

I believe I prefer this solution over the other PR (especially with regards to the generated code). 

Should we add a separate function to the inlining interface called `allowSingleBlockOptimization` or similar. The function could have a default implementation that returns true. Then only the LLVM inlining interface would have to overwrite this function. Adding boolean result to `processInlinedBlocks` works, but it feels a bit like the result flag would be unrelated to the actual purpose of the function.

Personally, my preferred solution would be to remove the inlining "fast path" entirely and rely on region simplify to cleanup the control flow. I am not sure how easy it is to find consensus for such a change though.

@ftynse do you have an opinion here?

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


More information about the Mlir-commits mailing list