[PATCH] D43729: [CallSiteSplitting] properly split musttail calls

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 28 13:24:31 PST 2018


fhahn added a comment.

In https://reviews.llvm.org/D43729#1022610, @indutny wrote:

> Hello, @fhahn !
>
> Thank you for taking a look at it. I'll be glad to make the changes. Just one question before I start: it seems that the suggestions of @junbuml and you are to some extent contradictory. At first I was suggested to leave the function as it is, and now the suggestion is to move things back to it. Given this, what do we actually desire it to look like? Let's decide on this before making any additional changes.


Ah I missed the full history, but had a look from the start now. I think the initial patch was slightly different to what I outlined. With my suggestion, the only changes to the main loop of `splitCallSite` would be cloning and moving the bitcast/ret instructions for musttail calls to the newly created predecessor blocks (this should be done in a separate function). And then we can just erase the TailBB, if it does not have any predecessors any longer (which should always the case ATM for musttail calls, as we split all predecessors for now).

If that works as I think, it should be just a couple of lines changed in splitCallSite and we handle musttail directly, rather than after the fact, which IMO makes it easier to see what's going on. I might be missing something though. Jun, what do you think?


https://reviews.llvm.org/D43729





More information about the llvm-commits mailing list