[LLVMdev] Inlining into a big function

Jakob Stoklund Olesen stoklund at 2pi.dk
Mon Mar 8 19:17:22 PST 2010


Hi,

The InlineCostAnalyzer has contained this since it was created:

+  // Don't inline into something too big, which would make it bigger.  Here, we
+  // count each basic block as a single unit.
+  //
+  InlineCost += Caller->size()/20;

It discourages inlining into very big functions. (100 basic blocks in the caller = 1 instruction in the callee.) Does anybody remember the rationale behind that heuristic?

I am currently looking at a very big function with enough basic blocks that the heuristic effectively disables inlining at -Os. Even for trivial functions that would shrink the size of the function!

/jakob





More information about the llvm-dev mailing list