[PATCH] D35962: Separate the ICP total threshold and remaining threshold.

Dehao Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 27 16:23:27 PDT 2017


danielcdh created this revision.
Herald added a subscriber: sanjoy.

In the current implementation, isPromotionProfitable only checks if the call count to a direct target is no less than a certain percentage threshold of the remaining call counts that have not been promoted. This causes code size problems when the target count is small but greater than a large portion of remaining counts. E.g. target1 takes 99.9%, while target2 takes 0.1%. Both targets will be promoted and inlined, makes the function size too large, which potentially prevents it from further inlining into its callers. This patch adds another percentage threshold against the total indirect call count. If the target count needs to be no less than both thresholds in order to be promoted speculatively.


https://reviews.llvm.org/D35962

Files:
  include/llvm/Analysis/IndirectCallPromotionAnalysis.h
  lib/Analysis/IndirectCallPromotionAnalysis.cpp
  test/Transforms/PGOProfile/indirect_call_promotion.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35962.108545.patch
Type: text/x-patch
Size: 6395 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170727/9470b58e/attachment.bin>


More information about the llvm-commits mailing list