[LLVMdev] function inlining threshold ?

Chris Lattner sabre at nondot.org
Tue Jul 5 10:03:10 PDT 2005


On Mon, 4 Jul 2005, Misha Brukman wrote:
> function.  Currently, the inliner implemented in LLVM is
> InlineSimple.cpp in the same directory, which adds cost to functions if
> they have recursive calls, allocas, and other features, but at the end,
> you'll notice that it weighs each instruction as 5 with each basic block
> as 20.
>
> I've omitted many details, see SimpleInliner::getInlineCost() in
> llvm/lib/Transforms/IPO/InlineSimple.cpp for complete calculation.

Another thing that may be useful: passing -debug-only=inline will cause 
the inliner to print out the perceived costs of inlining at each call site 
and the decisions it makes.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.cs.uiuc.edu/




More information about the llvm-dev mailing list