24#define DEBUG_TYPE "pgo-icall-prom-analysis"
30 cl::desc(
"The percentage threshold against remaining unpromoted indirect "
31 "call count for the promotion"));
38 cl::desc(
"The percentage threshold against total "
39 "count for the promotion"));
45 cl::desc(
"Max number of promotions for a single indirect "
50 cl::desc(
"Max number of vtables annotated for a vtable load instruction."));
56bool ICallPromotionAnalysis::isPromotionProfitable(
uint64_t Count,
66uint32_t ICallPromotionAnalysis::getProfitablePromotionCandidates(
71 <<
" Num_targets: " << NumVals <<
"\n");
74 uint64_t RemainingCount = TotalCount;
77 assert(Count <= RemainingCount);
79 <<
" Target_func: " << ValueDataRef[
I].
Value <<
"\n");
81 if (!isPromotionProfitable(Count, TotalCount, RemainingCount)) {
85 RemainingCount -= Count;
96 ValueDataArray.get(), NumVals, TotalCount);
101 NumCandidates = getProfitablePromotionCandidates(
I, NumVals, TotalCount);
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
LLVM Value Representation.
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
bool getValueProfDataFromInst(const Instruction &Inst, InstrProfValueKind ValueKind, uint32_t MaxNumValueData, InstrProfValueData ValueData[], uint32_t &ActualNumValueData, uint64_t &TotalC, bool GetNoICPValue=false)
Extract the value profile data from Inst which is annotated with value profile meta data.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.