[clang] [Clang] Remove unnecessary return block after musttail call (PR #191198)

Paweł Bylica via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 9 14:31:16 PDT 2026


chfast wrote:

> There are two points from [#134282 (review)](https://github.com/llvm/llvm-project/pull/134282#pullrequestreview-2740777882) which I'd like addressed:
> 
>     * For most functions, we actually emit the return block, then erase it if it's unused.  Why is musttail special here?

Current implementation of musttail is kind of special because it creates its own "return block". And then `EnsureInsertPoint()` creates an "empty" block.  This is what we are fighting with. My understanding based on previous commits was that we want rather generic way of avoiding `EnsureInsertPoint()` in case we will not need it.

>     * There's a comment saying "However, we still need a place to put the debug region.end for now."  Is that out of date?

To my understanding this path is still used (and now more often). 



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


More information about the cfe-commits mailing list