[llvm-commits] [llvm] r147037 - /llvm/trunk/lib/Analysis/InlineCost.cpp
Nick Lewycky
nicholas at mxc.ca
Wed Dec 21 12:54:13 PST 2011
On 12/21/2011 11:20 AM, Devang Patel wrote:
>
> On Dec 20, 2011, at 10:06 PM, Nick Lewycky wrote:
>
>> Author: nicholas
>> Date: Wed Dec 21 00:06:30 2011
>> New Revision: 147037
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=147037&view=rev
>> Log:
>> A call to a function marked 'noinline' is not an inline candidate.
>
>
>> The sole call site of an intrinsic is also not an inline candidate.
>
> Really ?
Yes because an intrinsic has no body to inline?
I didn't find any description of "inline candidate" but it appears from
the places it's used (not the inliner, only the loop unroller) to refer
to call-sites that might be inlined, as it wants to avoid duplicating those.
If you know otherwise, please fill me in!
Nick
> -
> Devang
>
>> While here, make it
>> more obvious that this code ignores all intrinsics. Noticed by inspection!
>>
>> Modified:
>> llvm/trunk/lib/Analysis/InlineCost.cpp
>>
>> Modified: llvm/trunk/lib/Analysis/InlineCost.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InlineCost.cpp?rev=147037&r1=147036&r2=147037&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Analysis/InlineCost.cpp (original)
>> +++ llvm/trunk/lib/Analysis/InlineCost.cpp Wed Dec 21 00:06:30 2011
>> @@ -63,8 +63,8 @@
>>
>> // Special handling for calls.
>> if (isa<CallInst>(II) || isa<InvokeInst>(II)) {
>> - if (isa<DbgInfoIntrinsic>(II))
>> - continue; // Debug intrinsics don't count as size.
>> + if (isa<IntrinsicInst>(II))
>> + continue; // Intrinsics have no argument setup and can't be inlined.
>>
>> ImmutableCallSite CS(cast<Instruction>(II));
>>
>> @@ -72,7 +72,7 @@
>> // If a function is both internal and has a single use, then it is
>> // extremely likely to get inlined in the future (it was probably
>> // exposed by an interleaved devirtualization pass).
>> - if (F->hasInternalLinkage()&& F->hasOneUse())
>> + if (!CS.isNoInline()&& F->hasInternalLinkage()&& F->hasOneUse())
>> ++NumInlineCandidates;
>>
>> // If this call is to function itself, then the function is recursive.
>> @@ -83,7 +83,7 @@
>> isRecursive = true;
>> }
>>
>> - if (!isa<IntrinsicInst>(II)&& !callIsSmall(CS.getCalledFunction())) {
>> + if (!callIsSmall(CS.getCalledFunction())) {
>> // Each argument to a call takes on average one instruction to set up.
>> NumInsts += CS.arg_size();
>>
>>
>>
>> _______________________________________________
>> 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