LLVM 20.0.0git
Public Member Functions | List of all members
llvm::sampleprofutil::SampleCoverageTracker Class Reference

#include "llvm/Transforms/Utils/SampleProfileLoaderBaseUtil.h"

Public Member Functions

bool markSamplesUsed (const FunctionSamples *FS, uint32_t LineOffset, uint32_t Discriminator, uint64_t Samples)
 Mark as used the sample record for the given function samples at (LineOffset, Discriminator).
 
unsigned computeCoverage (unsigned Used, unsigned Total) const
 Return the fraction of sample records used in this profile.
 
unsigned countUsedRecords (const FunctionSamples *FS, ProfileSummaryInfo *PSI) const
 Return the number of sample records that were applied from this profile.
 
unsigned countBodyRecords (const FunctionSamples *FS, ProfileSummaryInfo *PSI) const
 Return the number of sample records in the body of this profile.
 
uint64_t getTotalUsedSamples () const
 
uint64_t countBodySamples (const FunctionSamples *FS, ProfileSummaryInfo *PSI) const
 Return the number of samples collected in the body of this profile.
 
void clear ()
 
void setProfAccForSymsInList (bool V)
 

Detailed Description

Definition at line 35 of file SampleProfileLoaderBaseUtil.h.

Member Function Documentation

◆ clear()

void llvm::sampleprofutil::SampleCoverageTracker::clear ( )
inline

◆ computeCoverage()

unsigned llvm::sampleprofutil::SampleCoverageTracker::computeCoverage ( unsigned  Used,
unsigned  Total 
) const

Return the fraction of sample records used in this profile.

The returned value is an unsigned integer in the range 0-100 indicating the percentage of sample records that were used while applying this profile to the associated function.

Definition at line 163 of file SampleProfileLoaderBaseUtil.cpp.

References assert(), and llvm::Total.

◆ countBodyRecords()

unsigned llvm::sampleprofutil::SampleCoverageTracker::countBodyRecords ( const FunctionSamples FS,
ProfileSummaryInfo PSI 
) const

Return the number of sample records in the body of this profile.

This count does not include records from cold inlined callsites.

Definition at line 122 of file SampleProfileLoaderBaseUtil.cpp.

References llvm::sampleprofutil::callsiteIsHot(), countBodyRecords(), and I.

Referenced by countBodyRecords().

◆ countBodySamples()

uint64_t llvm::sampleprofutil::SampleCoverageTracker::countBodySamples ( const FunctionSamples FS,
ProfileSummaryInfo PSI 
) const

Return the number of samples collected in the body of this profile.

This count does not include samples from cold inlined callsites.

Definition at line 141 of file SampleProfileLoaderBaseUtil.cpp.

References llvm::sampleprofutil::callsiteIsHot(), countBodySamples(), I, and llvm::Total.

Referenced by countBodySamples().

◆ countUsedRecords()

unsigned llvm::sampleprofutil::SampleCoverageTracker::countUsedRecords ( const FunctionSamples FS,
ProfileSummaryInfo PSI 
) const

Return the number of sample records that were applied from this profile.

This count does not include records from cold inlined callsites.

Definition at line 97 of file SampleProfileLoaderBaseUtil.cpp.

References llvm::sampleprofutil::callsiteIsHot(), countUsedRecords(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), and I.

Referenced by countUsedRecords().

◆ getTotalUsedSamples()

uint64_t llvm::sampleprofutil::SampleCoverageTracker::getTotalUsedSamples ( ) const
inline

Definition at line 44 of file SampleProfileLoaderBaseUtil.h.

◆ markSamplesUsed()

bool llvm::sampleprofutil::SampleCoverageTracker::markSamplesUsed ( const FunctionSamples FS,
uint32_t  LineOffset,
uint32_t  Discriminator,
uint64_t  Samples 
)

Mark as used the sample record for the given function samples at (LineOffset, Discriminator).

Returns
true if this is the first time we mark the given record.

Definition at line 81 of file SampleProfileLoaderBaseUtil.cpp.

◆ setProfAccForSymsInList()

void llvm::sampleprofutil::SampleCoverageTracker::setProfAccForSymsInList ( bool  V)
inline

Definition at line 52 of file SampleProfileLoaderBaseUtil.h.


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