[PATCH] D14309: Use updated threshold for indirect call bonus

David Li via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 4 14:37:01 PST 2015


davidxl added a comment.

yes, this makes more sense to me.

Conceptually, CA.getThreshold() represents the cost if the call site remains *uninlined*, so that  Threshold - Cost really means the benefit/gain of doing the inlining.

However since the cost of keeping and indirect call site 'uninlined' can be slightly higher than the regular direct callsite (due to indirect branch), it might be better to introduce a small booster InlineConstants::IndirectCallCost:

Cost -= std::max(0, CA.getThreshold() + InlineConstants::IndirectCallCost - CA.getCost());

Also if InlineConstants::IndirectCallThreshold is not used anywhere, get rid of it.


Repository:
  rL LLVM

http://reviews.llvm.org/D14309





More information about the llvm-commits mailing list