LLVM 20.0.0git
Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
llvm::ProfileSummaryBuilder Class Reference

#include "llvm/ProfileData/ProfileCommon.h"

Inheritance diagram for llvm::ProfileSummaryBuilder:
Inheritance graph
[legend]

Static Public Member Functions

static const ProfileSummaryEntrygetEntryForPercentile (const SummaryEntryVector &DS, uint64_t Percentile)
 Find the summary entry for a desired percentile of counts.
 
static uint64_t getHotCountThreshold (const SummaryEntryVector &DS)
 
static uint64_t getColdCountThreshold (const SummaryEntryVector &DS)
 

Static Public Attributes

static const ArrayRef< uint32_tDefaultCutoffs
 A vector of useful cutoff values for detailed summary.
 

Protected Member Functions

 ProfileSummaryBuilder (std::vector< uint32_t > Cutoffs)
 
 ~ProfileSummaryBuilder ()=default
 
void addCount (uint64_t Count)
 This is called when a count is seen in the profile.
 
void computeDetailedSummary ()
 

Protected Attributes

SummaryEntryVector DetailedSummary
 
uint64_t TotalCount = 0
 
uint64_t MaxCount = 0
 
uint64_t MaxFunctionCount = 0
 
uint32_t NumCounts = 0
 
uint32_t NumFunctions = 0
 

Detailed Description

Definition at line 45 of file ProfileCommon.h.

Constructor & Destructor Documentation

◆ ProfileSummaryBuilder()

llvm::ProfileSummaryBuilder::ProfileSummaryBuilder ( std::vector< uint32_t Cutoffs)
inlineprotected

Definition at line 61 of file ProfileCommon.h.

◆ ~ProfileSummaryBuilder()

llvm::ProfileSummaryBuilder::~ProfileSummaryBuilder ( )
protecteddefault

Member Function Documentation

◆ addCount()

void llvm::ProfileSummaryBuilder::addCount ( uint64_t  Count)
inlineprotected

This is called when a count is seen in the profile.

Definition at line 106 of file ProfileCommon.h.

References MaxCount, NumCounts, and TotalCount.

Referenced by llvm::SampleProfileSummaryBuilder::addRecord().

◆ computeDetailedSummary()

void ProfileSummaryBuilder::computeDetailedSummary ( )
protected

◆ getColdCountThreshold()

uint64_t ProfileSummaryBuilder::getColdCountThreshold ( const SummaryEntryVector DS)
static

◆ getEntryForPercentile()

const ProfileSummaryEntry & ProfileSummaryBuilder::getEntryForPercentile ( const SummaryEntryVector DS,
uint64_t  Percentile 
)
static

Find the summary entry for a desired percentile of counts.

Definition at line 81 of file ProfileSummaryBuilder.cpp.

References llvm::partition_point(), and llvm::report_fatal_error().

Referenced by getColdCountThreshold(), and getHotCountThreshold().

◆ getHotCountThreshold()

uint64_t ProfileSummaryBuilder::getHotCountThreshold ( const SummaryEntryVector DS)
static

Member Data Documentation

◆ DefaultCutoffs

const ArrayRef< uint32_t > ProfileSummaryBuilder::DefaultCutoffs
static
Initial value:
=
static const uint32_t DefaultCutoffsData[]

A vector of useful cutoff values for detailed summary.

Definition at line 70 of file ProfileCommon.h.

Referenced by llvm::sampleprof::SampleProfileReader::computeSummary(), and llvm::sampleprof::SampleProfileWriter::computeSummary().

◆ DetailedSummary

SummaryEntryVector llvm::ProfileSummaryBuilder::DetailedSummary
protected

◆ MaxCount

uint64_t llvm::ProfileSummaryBuilder::MaxCount = 0
protected

◆ MaxFunctionCount

uint64_t llvm::ProfileSummaryBuilder::MaxFunctionCount = 0
protected

◆ NumCounts

uint32_t llvm::ProfileSummaryBuilder::NumCounts = 0
protected

◆ NumFunctions

uint32_t llvm::ProfileSummaryBuilder::NumFunctions = 0
protected

◆ TotalCount

uint64_t llvm::ProfileSummaryBuilder::TotalCount = 0
protected

The documentation for this class was generated from the following files: