[PATCH] D115497: [Inline] Disable deferred inlining

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 10 08:23:11 PST 2021


mtrofin added a comment.

I believe part of the problem is that cost estimation doesn't take much of the caller into account. If it did, in the A->B->C case, A->B being too large could make A->C unprofitable.

One other thing to consider about deferral, though: say A->B, C->B, B->D. Say not deferring B->D leads to B not being inlinable in either A nor C. If we deferred, then suppose B gets inlined into A, and in this context, so does D; but suppose B does not inlined into C and then nor does D in this second context (we don't revisit callsites if inlining does not occur).

I think presence of profiles may make supporting this worthwhile, as call site hotness plays a role in the cost calculation.

The heuristic is old - I think the original change is ~12 years ago (3059924bddca79e0fea5f1473d9a66985e1fda4a) and it saw very little churn since. Notably, though, this makes some performance remarks <https://github.com/llvm/llvm-project/commit/30b8416d2c7154b86f3d0c01c18a05ab3838e6f5>.

For prudence, should we perhaps as a first step allow disabling it (and maybe the Rust frontend can then disable it by default?), but leave it on by default? We can then see if disabling it hurts performance of any real-world, PGO-ed binaries.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115497/new/

https://reviews.llvm.org/D115497



More information about the llvm-commits mailing list