[PATCH] Add 'musttail' marker to call instructions

Reid Kleckner rnk at google.com
Wed Apr 9 14:35:24 PDT 2014


On Wed, Apr 9, 2014 at 2:24 PM, Philip Reames <listmail at philipreames.com>wrote:

>  For the LangRef, I suggest we remove the text related to when a "tail"
> call is guaranteed.  With the addition of "musttail" these semantics are
> redundant.  Instead, "tail" should be advisory only.  This would involve
> breaking backwards compatibility.
>
> With the new option, should GauranteedTailCallOpt exist?  I suggest not.
>

I agree, this feature obsoletes GTCO.  I don't think it's exposed via the C
API, so we can probably just get rid of it.


> In code, it would be useful to refer to the old "tail" attribute as "may
> tail".  This clarifies the semantics in code even if we don't change the IR
> name.  In particular, I'm referring to CallSite/Instruction here.
>
> In the verifier you need to handle chains of bitcasts.  These will reduce
> to a single bitcast, but InstCombine may not have run yet.  We don't want
> each opto pass to need to do this simplification.
>

I don't think this is worth supporting.  The frontend should be able to
handle this by avoiding such chains.  They already have to be careful about
the other rules for musttail, so this isn't much burden.


> Otherwise, LGTM and I support the addition.
>

Thanks for the feedback!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140409/0498d198/attachment.html>


More information about the llvm-commits mailing list