[llvm-commits] [llvm] r55673 - in /llvm/trunk: lib/Transforms/IPO/Inliner.cpp test/Transforms/Inline/2008-09-02-AlwaysInline.ll test/Transforms/Inline/2008-09-02-NoInline.ll

Dale Johannesen dalej at apple.com
Mon Sep 22 13:13:36 PDT 2008


On Sep 22, 2008, at 11:02 AMPDT, Devang Patel wrote:

>
> On Sep 21, 2008, at 8:36 PM, Chris Lattner wrote:
>
>>
>> On Sep 3, 2008, at 9:41 AM, Devang Patel wrote:
>>
>>>
>>> On Sep 2, 2008, at 11:59 PM, Duncan Sands wrote:
>>>
>>>> Hi Devang,
>>>>
>>>>> respect inline=never and inline=always notes.
>>>>
>>>> what happens if you set inline=always on a function
>>>> that calls itself?  Does the inliner go into an
>>>> infinite loop?
>>>
>>> That'd be a bug.
>>
>> Ok, so what happens now?  Is that a bug in the current code, or have
>> you fixed that?
>
> The inliner does not inline a call where caller and callee are same.
> inline=always does not override this behavior.

Hmm.  gcc does have internal support for recursive inlining and  
several documented parameters of the form --max-inline-recursive-xxx,  
but I haven't been able to get it to fire....if you want to  
experiment, remember to turn off tail recursion.

I've seen the sentiment expressed that always-inline on a recursive  
function ought to be reported as an error, but gcc doesn't do that  
now, seems to quietly ignore always-inline.  I don't have a strong  
opinion myself.

> The inliner may decide to not inline due to various reasons :
> - caller == callee
> - weak linkage
> - function takes variable number of args
> - GCs do not match
>
> inline=always does not override these checks.
> -
> Devang
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list