[llvm-dev] CallSiteSplitting and musttail calls
Fedor Indutny via llvm-dev
llvm-dev at lists.llvm.org
Sat Feb 24 12:58:35 PST 2018
I was able to make progress on it today ( See
https://reviews.llvm.org/D43729 ). Apparently my problems were:
* Iterating through the instruction/block list after erasing
* Trying to split block after removing one predecessor
Regarding the latter, it appears that semantics of
`DuplicateInstructionsInSplitBetween` change significantly in such case,
and it starts to loop indefinitely. The `SplitEdge` function that it calls
places all of the instructions into the split block, so that the original
block becomes empty.
Is it expected behavior, or am I doing something wrong?
On Sat, Feb 24, 2018 at 2:16 AM, Fedor Indutny <fedor at indutny.com> wrote:
> I've discovered that `CallSiteSplitting` optimization doesn't support
> musttail calls. The easiest fix as it stands is disabling it for such call
> sites: https://reviews.llvm.org/D43729 . However, I'm not happy with such
> My more sophisticated attempt has failed due to my poor understanding of
> llvm internals. Here is the attempted patch: https://gist.github.
> I'd greatly appreciate any help with it.
> Just in case, there're few questions that I'm trying to find answers for:
> * Why replacing `removeFromParent()` with `eraseFromParent` breaks the
> * How to properly remove predecessors from the resulting Tail block?
> * How to remove the Tail block itself when we're done?
> Thank you,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev