LLVM  15.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). More...
 
unsigned computeCoverage (unsigned Used, unsigned Total) const
 Return the fraction of sample records used in this profile. More...
 
unsigned countUsedRecords (const FunctionSamples *FS, ProfileSummaryInfo *PSI) const
 Return the number of sample records that were applied from this profile. More...
 
unsigned countBodyRecords (const FunctionSamples *FS, ProfileSummaryInfo *PSI) const
 Return the number of sample records in the body of this profile. More...
 
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. More...
 
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

Definition at line 48 of file SampleProfileLoaderBaseUtil.h.

◆ 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 167 of file SampleProfileLoaderBaseUtil.cpp.

References assert().

◆ 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 126 of file SampleProfileLoaderBaseUtil.cpp.

References llvm::sampleprofutil::callsiteIsHot(), llvm::X86AS::FS, and I.

◆ 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 145 of file SampleProfileLoaderBaseUtil.cpp.

References llvm::sampleprofutil::callsiteIsHot(), llvm::X86AS::FS, and I.

◆ 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 101 of file SampleProfileLoaderBaseUtil.cpp.

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

◆ 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 85 of file SampleProfileLoaderBaseUtil.cpp.

References llvm::X86AS::FS.

◆ 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: