[PATCH] D34471: [Inliner] Boost inlining of an indirect call to always_inline function.

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 22 20:50:23 PDT 2017


davidxl added a comment.

Chandler's example does not involve any indirect calls so it is not related to this patch.

I think Easwaran's patch is consistent with the current inline behavior -- it boots inlining to callee with indirect callsites that can be turned into direct calls and then further inlined. The amount of boost is the benefit of inlining the indirect callsites (i.e., the difference between inline cost and allowed threshold). In fact, if the CA.analyzeCall call in the existing code

  auto IndirectCallParams = Params;
  IndirectCallParams.DefaultThreshold = InlineConstants::IndirectCallThreshold;
  CallAnalyzer CA(TTI, GetAssumptionCache, GetBFI, PSI, *F, CS,
                  IndirectCallParams);
  if (CA.analyzeCall(CS)) {
      ...
   

is turned into getInlineCost(CS), it will achieve similar effect -- except that InlineCost associated with AlwaysInline is a little too extreme.

In many cases, AlwaysInline is very strong hint by the user to indicate performance benefit of inlining the function, it does not make sense to completely ignore it.


https://reviews.llvm.org/D34471





More information about the llvm-commits mailing list