[llvm-commits] [llvm] r53712 - /llvm/trunk/lib/Transforms/Utils/InlineCost.cpp

Chris Lattner clattner at apple.com
Wed Jul 16 23:31:46 PDT 2008


On Jul 16, 2008, at 7:17 PM, Gabor Greif wrote:

>> Hi Evan,
>>
>>> +        // Calls often compile into many machine instructions.
>> Bump up their
>>> +        // cost to reflect this.
>>> +        if (!isa<IntrinsicInst>(II))
>>> +          NumInsts += 5;
>>
>> I suppose you could also add in the number of operands in order
>> to vaguely reflect the cost of inlining a call with many parameters.
>
> Or even better, the number of operands that are actually *used*.

This is the cost of inlining a function that contains a call, so it  
should be proportional to the number of operands passed.   
4+NumOperands seems like a reasonable (if totally ad-hoc) cost to me.

-Chris



More information about the llvm-commits mailing list