LLVM 17.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
Collaboration diagram for llvm::ProfileSummaryBuilder:
Collaboration graph

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 40 of file ProfileCommon.h.

Constructor & Destructor Documentation

◆ ProfileSummaryBuilder()

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

Definition at line 56 of file ProfileCommon.h.

◆ ~ProfileSummaryBuilder()

llvm::ProfileSummaryBuilder::~ProfileSummaryBuilder ( )

Member Function Documentation

◆ addCount()

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

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

Definition at line 101 of file ProfileCommon.h.

References MaxCount, NumCounts, and TotalCount.

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

◆ computeDetailedSummary()

void ProfileSummaryBuilder::computeDetailedSummary ( )

◆ getColdCountThreshold()

uint64_t ProfileSummaryBuilder::getColdCountThreshold ( const SummaryEntryVector DS)

◆ getEntryForPercentile()

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

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)

Member Data Documentation

◆ DefaultCutoffs

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

A vector of useful cutoff values for detailed summary.

Definition at line 65 of file ProfileCommon.h.

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

◆ DetailedSummary

SummaryEntryVector llvm::ProfileSummaryBuilder::DetailedSummary

◆ MaxCount

uint64_t llvm::ProfileSummaryBuilder::MaxCount = 0

◆ MaxFunctionCount

uint64_t llvm::ProfileSummaryBuilder::MaxFunctionCount = 0

◆ NumCounts

uint32_t llvm::ProfileSummaryBuilder::NumCounts = 0

◆ NumFunctions

uint32_t llvm::ProfileSummaryBuilder::NumFunctions = 0

◆ TotalCount

uint64_t llvm::ProfileSummaryBuilder::TotalCount = 0

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