32 #define DEBUG_TYPE "pgo-icall-prom-analysis" 38 cl::desc(
"The percentage threshold against remaining unpromoted indirect " 39 "call count for the promotion"));
46 cl::desc(
"The percentage threshold against total " 47 "count for the promotion"));
53 cl::desc(
"Max number of promotions for a single indirect " 60 bool ICallPromotionAnalysis::isPromotionProfitable(uint64_t Count,
62 uint64_t RemainingCount) {
70 uint32_t ICallPromotionAnalysis::getProfitablePromotionCandidates(
75 <<
" Num_targets: " << NumVals <<
"\n");
78 uint64_t RemainingCount = TotalCount;
80 uint64_t Count = ValueDataRef[
I].Count;
81 assert(Count <= RemainingCount);
83 <<
" Target_func: " << ValueDataRef[I].
Value <<
"\n");
85 if (!isPromotionProfitable(Count, TotalCount, RemainingCount)) {
89 RemainingCount -= Count;
100 ValueDataArray.get(), NumVals, TotalCount);
105 NumCandidates = getProfitablePromotionCandidates(I, NumVals, TotalCount);
This class represents lattice values for constants.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
initializer< Ty > init(const Ty &Val)
bool getValueProfDataFromInst(const Instruction &Inst, InstrProfValueKind ValueKind, uint32_t MaxNumValueData, InstrProfValueData ValueData[], uint32_t &ActualNumValueData, uint64_t &TotalC)
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.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.