[llvm] r208017 - Improve 'tail' call marking in TRE. A bootstrap of clang goes from 375k calls marked tail in the IR to 470k, however this improvement does not carry into an improvement of the call/jmp ratio on x86. The most common pattern is a tail call + br to a block with nothing but a 'ret'.

Nick Lewycky nlewycky at google.com
Thu May 8 16:12:42 PDT 2014


On 7 May 2014 09:24, Diego Novillo <dnovillo at google.com> wrote:

>
>
>
> On Mon, May 5, 2014 at 7:59 PM, Nick Lewycky <nicholas at mxc.ca> wrote:
>
>>
>> +        if (SafeToTail) {
>> +          F.getContext().emitOptimizationRemark(
>> +              "tailcallelim", F, CI->getDebugLoc(),
>> +              "found readnone tail call candidate");
>>
>
> You can use DEBUG_TYPE here, can you not?
>

I could but I'd rather not? It's the pass name and that's spelled out in
other places it's used in this file. If emitOptimizationRemark is compiled
away when DEBUG is disabled, then it'd be clear that I'm supposed to use
it. Otherwise it seems like I'm using what ought to be our interface to the
DEBUG mechanism for something else.

This seems to be a transformation remark, but the text implies that it's an
> analysis remark. I'm adding support for -Rpass-analysis shortly, so I want
> to make sure whether this will fall under the category of 'applied
> optimization' or 'analysis result' (which will have a different call,
> something like emitOptimizationAnalysisRemark().
>

It's a transform remark. Text improved in r208370.

 +  for (CallInst *CI : DeferredTails) {
>> +    if (Visited[CI->getParent()] != ESCAPED) {
>> +      // If the escape point was part way through the block, calls after
>> the
>> +      // escape point wouldn't have been put into DeferredTails.
>> +      F.getContext().emitOptimizationRemark(
>> +          "tailcallelim", F, CI->getDebugLoc(), "found tail call
>> candidate");
>> +      CI->setTailCall();
>> +      Modified = true;
>>
>
> Same question here.
>

Same answer here.

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140508/240ea39c/attachment.html>


More information about the llvm-commits mailing list