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."));
52bool ICallPromotionAnalysis::isPromotionProfitable(
uint64_t Count,
62uint32_t ICallPromotionAnalysis::getProfitablePromotionCandidates(
65 <<
" Num_targets: " << ValueDataArray.
size() <<
"\n");
68 uint64_t RemainingCount = TotalCount;
71 assert(Count <= RemainingCount);
73 <<
" Target_func: " << ValueDataArray[
I].
Value <<
"\n");
75 if (!isPromotionProfitable(Count, TotalCount, RemainingCount)) {
79 RemainingCount -= Count;
89 if (ValueDataArray.
empty()) {
93 NumCandidates = getProfitablePromotionCandidates(
I, TotalCount);
94 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...