[PATCH] D39869: [Inliner] Inline through indirect call sites having !callees metadata

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 10:24:59 PST 2018


davidxl added a comment.

I actually mean the former.

Regarding your comment "Although a useful indicator, I think if we use inline cost outside the inliner, or at least outside a CallGraphSCCPass, it may end up being wrong in some cases. Suppose, for example, we use inline cost in a module pass that promotes an indirect call site to directly call function F. Later, the inliner may decide to inline a lot of code into F, making F a bad candidate for inlining into its caller. So the benefit we thought we were getting by promotion (the code simplification, measured by inline cost, due to inlining F into its caller) turns out to be nothing. This kind of situation is avoided by letting the inliner direct the promotion",

I understand what you are saying -- due to the bottom up order (limitation) of the current inliner, doing inlining cost analysis at indirect call promootion may not reflect what is actually happening -- the indirect callsite that deem to be beneficial to be inlined at indirect call promotion pass may not be inlinable anymore because it may get too  large.

I need to think about this  a little.


Repository:
  rL LLVM

https://reviews.llvm.org/D39869





More information about the llvm-commits mailing list