23#define DEBUG_TYPE "pgo-icall-prom-analysis"
29 cl::desc(
"The percentage threshold against remaining unpromoted indirect "
30 "call count for the promotion"));
37 cl::desc(
"The percentage threshold against total "
38 "count for the promotion"));
44 cl::desc(
"Max number of promotions for a single indirect "
49 cl::desc(
"Max number of vtables annotated for a vtable load instruction."));
51bool ICallPromotionAnalysis::isPromotionProfitable(
uint64_t Count,
61uint32_t ICallPromotionAnalysis::getProfitablePromotionCandidates(
64 <<
" Num_targets: " << ValueDataArray.
size() <<
"\n");
67 uint64_t RemainingCount = TotalCount;
70 assert(Count <= RemainingCount);
72 <<
" Target_func: " << ValueDataArray[
I].
Value <<
"\n");
74 if (!isPromotionProfitable(Count, TotalCount, RemainingCount)) {
78 RemainingCount -= Count;
88 if (ValueDataArray.
empty()) {
92 NumCandidates = getProfitablePromotionCandidates(
I, TotalCount);
93 return ValueDataArray;
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
LLVM Value Representation.
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
SmallVector< InstrProfValueData, 4 > getValueProfDataFromInst(const Instruction &Inst, InstrProfValueKind ValueKind, uint32_t MaxNumValueData, uint64_t &TotalC, bool GetNoICPValue=false)
Extract the value profile data from Inst and returns them if Inst is annotated with value profile dat...