LLVM 19.0.0git
Classes | Functions
llvm::sampleprofutil Namespace Reference


class  SampleCoverageTracker


bool callsiteIsHot (const FunctionSamples *CallsiteFS, ProfileSummaryInfo *PSI, bool ProfAccForSymsInList)
 Return true if the given callsite is hot wrt to hot cutoff threshold.
void createFSDiscriminatorVariable (Module *M)
 Create a global variable to flag FSDiscriminators are used.

Function Documentation

◆ callsiteIsHot()

bool llvm::sampleprofutil::callsiteIsHot ( const FunctionSamples CallsiteFS,
ProfileSummaryInfo PSI,
bool  ProfAccForSymsInList 

Return true if the given callsite is hot wrt to hot cutoff threshold.

Functions that were inlined in the original binary will be represented in the inline stack in the sample profile. If the profile shows that the original inline decision was "good" (i.e., the callsite is executed frequently), then we will recreate the inline decision and apply the profile from the inlined callsite.

To decide whether an inlined callsite is hot, we compare the callsite sample count with the hot cutoff computed by ProfileSummaryInfo, it is regarded as hot if the count is above the cutoff value.

When ProfileAccurateForSymsInList is enabled and profile symbol list is present, functions in the profile symbol list but without profile will be regarded as cold and much less inlining will happen in CGSCC inlining pass, so we tend to lower the hot criteria here to allow more early inlining to happen for warm callsites and it is helpful for performance.

Definition at line 64 of file SampleProfileLoaderBaseUtil.cpp.

References assert(), llvm::sampleprof::FunctionSamples::getTotalSamples(), llvm::ProfileSummaryInfo::isColdCount(), and llvm::ProfileSummaryInfo::isHotCount().

Referenced by llvm::sampleprofutil::SampleCoverageTracker::countBodyRecords(), llvm::sampleprofutil::SampleCoverageTracker::countBodySamples(), and llvm::sampleprofutil::SampleCoverageTracker::countUsedRecords().

◆ createFSDiscriminatorVariable()

void llvm::sampleprofutil::createFSDiscriminatorVariable ( Module M)

Create a global variable to flag FSDiscriminators are used.

Definition at line 171 of file SampleProfileLoaderBaseUtil.cpp.

References llvm::appendToUsed(), llvm::Type::getInt1Ty(), llvm::ConstantInt::getTrue(), and llvm::GlobalValue::WeakODRLinkage.

Referenced by addDiscriminators().