[llvm-dev] llvm optimizer turning musttail into tail
Reid Kleckner via llvm-dev
llvm-dev at lists.llvm.org
Mon Nov 28 09:21:05 PST 2016
On Sun, Nov 27, 2016 at 7:40 AM, Carlo Kok via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> Inst combine yes. However it shouldn't drop this bit cast in the first
> place, since the last parameter isn't available. (It only works because of
> this must tail)
Aside from instcombine, the inliner will also transform musttail to tail.
The supported use cases for musttail are essentially:
- Avoiding unbounded stack growth for programming languages that require
- Perfect forwarding of parameters which cannot be copied (think C++
objects constructed in argument slots, aka inalloca)
- Perfect forwarding for thunks which are called with varying signatures
(these effectively forward the ellipsis of the caller)
The last case sounds the most like yours, in which case David's suggestion
is the right one.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev