[LLVMdev] Inlining in LLVM

Duncan Sands baldrick at free.fr
Mon Oct 25 00:36:43 PDT 2010


On 25/10/10 02:11, Dale Johannesen wrote:
> A static function with a single invocation gets a very high weight in the
> inlining heuristics. But a sufficiently large function still won't get inlined
> (not sure I've ever seen this in practice), and we don't know how to inline some
> functions, such as those that use varargs. There are also more complicated cases
> (I'm not sure we check for this one; it's come up at least twice in practice,
> but that was before llvm came along, and I think the source was hacked to work
> around the problem in both cases):
> a() { char x[10000000]; ....}
> b() { a(); .... b(); .... }
> It's probably a bad idea to inline a() even if the call shown is the only one;
> it won't take many recursive calls to b() to blow the stack.

And I guess there's also the case of functions marked "noinline" which
presumably aren't inlined even if static.

Ciao,

Duncan.



More information about the llvm-dev mailing list