<div dir="ltr">Hello!<div><br></div><div>I've discovered that `CallSiteSplitting` optimization doesn't support musttail calls. The easiest fix as it stands is disabling it for such call sites: <a href="https://reviews.llvm.org/D43729">https://reviews.llvm.org/D43729</a> . However, I'm not happy with such contribution.</div><div><br></div><div>My more sophisticated attempt has failed due to my poor understanding of llvm internals. Here is the attempted patch: <a href="https://gist.github.com/indutny/240c33522563ebd633613a903479d5e6">https://gist.github.com/indutny/240c33522563ebd633613a903479d5e6</a></div><div><br></div><div>I'd greatly appreciate any help with it.</div><div><br></div><div>Just in case, there're few questions that I'm trying to find answers for:</div><div><br></div><div>* Why replacing `removeFromParent()` with `eraseFromParent` breaks the code?</div><div>* How to properly remove predecessors from the resulting Tail block?</div><div>* How to remove the Tail block itself when we're done?</div><div><br></div><div>Thank you,</div><div>Fedor.</div></div>