LLVM  14.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. More...
void createFSDiscriminatorVariable (Module *M)
 Create a global variable to flag FSDiscriminators are used. More...

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

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

Referenced by addDiscriminators().