Lines Matching +full:count +full:- +full:threshold
1 //===-- IndirectCallPromotionAnalysis.cpp - Find promotion candidates ===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
10 // candidates for an instruction when the indirect-call value profile metadata
13 //===----------------------------------------------------------------------===//
24 #define DEBUG_TYPE "pgo-icall-prom-analysis"
26 // The percent threshold for the direct-call target (this call site vs the
27 // remaining call count) for it to be considered as the promotion target.
29 "icp-remaining-percent-threshold", cl::init(30), cl::Hidden,
30 cl::desc("The percentage threshold against remaining unpromoted indirect "
31 "call count for the promotion"));
33 // The percent threshold for the direct-call target (this call site vs the
34 // total call count) for it to be considered as the promotion target.
36 ICPTotalPercentThreshold("icp-total-percent-threshold", cl::init(5),
38 cl::desc("The percentage threshold against total "
39 "count for the promotion"));
41 // Set the maximum number of targets to promote for a single indirect-call
44 MaxNumPromotions("icp-max-prom", cl::init(3), cl::Hidden,
49 "icp-max-num-vtables", cl::init(6), cl::Hidden,
52 bool ICallPromotionAnalysis::isPromotionProfitable(uint64_t Count, in isPromotionProfitable() argument
55 return Count * 100 >= ICPRemainingPercentThreshold * RemainingCount && in isPromotionProfitable()
56 Count * 100 >= ICPTotalPercentThreshold * TotalCount; in isPromotionProfitable()
59 // Indirect-call promotion heuristic. The direct targets are sorted based on
60 // the count. Stop at the first target that is not promoted. Returns the
70 uint64_t Count = ValueDataArray[I].Count; in getProfitablePromotionCandidates() local
71 assert(Count <= RemainingCount); in getProfitablePromotionCandidates()
72 LLVM_DEBUG(dbgs() << " Candidate " << I << " Count=" << Count in getProfitablePromotionCandidates()
75 if (!isPromotionProfitable(Count, TotalCount, RemainingCount)) { in getProfitablePromotionCandidates()
79 RemainingCount -= Count; in getProfitablePromotionCandidates()