LLVM 22.0.0git
llvm::PGOContextualProfile Class Reference

The instrumented contextual profile, produced by the CtxProfAnalysis. More...

#include "llvm/Analysis/CtxProfAnalysis.h"

Public Types

using ConstVisitor = function_ref<void(const PGOCtxProfContext &)>
using Visitor = function_ref<void(PGOCtxProfContext &)>

Public Member Functions

 PGOContextualProfile (const PGOContextualProfile &)=delete
 PGOContextualProfile (PGOContextualProfile &&)=default
const CtxProfContextualProfilescontexts () const
const PGOCtxProfileprofiles () const
LLVM_ABI bool isInSpecializedModule () const
bool isFunctionKnown (const Function &F) const
StringRef getFunctionName (GlobalValue::GUID GUID) const
uint32_t getNumCounters (const Function &F) const
uint32_t getNumCallsites (const Function &F) const
uint32_t allocateNextCounterIndex (const Function &F)
uint32_t allocateNextCallsiteIndex (const Function &F)
LLVM_ABI void update (Visitor, const Function &F)
LLVM_ABI void visit (ConstVisitor, const Function *F=nullptr) const
LLVM_ABI const CtxProfFlatProfile flatten () const
LLVM_ABI const CtxProfFlatIndirectCallProfile flattenVirtCalls () const
bool invalidate (Module &, const PreservedAnalyses &PA, ModuleAnalysisManager::Invalidator &)

Friends

class CtxProfAnalysis
class CtxProfAnalysisPrinterPass

Detailed Description

The instrumented contextual profile, produced by the CtxProfAnalysis.

Definition at line 30 of file CtxProfAnalysis.h.

Member Typedef Documentation

◆ ConstVisitor

◆ Visitor

Constructor & Destructor Documentation

◆ PGOContextualProfile() [1/2]

llvm::PGOContextualProfile::PGOContextualProfile ( const PGOContextualProfile & )
delete

◆ PGOContextualProfile() [2/2]

llvm::PGOContextualProfile::PGOContextualProfile ( PGOContextualProfile && )
default

Member Function Documentation

◆ allocateNextCallsiteIndex()

uint32_t llvm::PGOContextualProfile::allocateNextCallsiteIndex ( const Function & F)
inline

Definition at line 97 of file CtxProfAnalysis.h.

References assert(), F, and isFunctionKnown().

Referenced by llvm::promoteCallWithIfThenElse(), and remapIndices().

◆ allocateNextCounterIndex()

uint32_t llvm::PGOContextualProfile::allocateNextCounterIndex ( const Function & F)
inline

Definition at line 92 of file CtxProfAnalysis.h.

References assert(), F, and isFunctionKnown().

Referenced by llvm::promoteCallWithIfThenElse(), and remapIndices().

◆ contexts()

const CtxProfContextualProfiles & llvm::PGOContextualProfile::contexts ( ) const
inline

Definition at line 63 of file CtxProfAnalysis.h.

◆ flatten()

◆ flattenVirtCalls()

const CtxProfFlatIndirectCallProfile PGOContextualProfile::flattenVirtCalls ( ) const

Definition at line 720 of file CtxProfAnalysis.cpp.

References _, preorderVisitOneRoot(), and llvm::TotalRootEntryCount.

◆ getFunctionName()

StringRef llvm::PGOContextualProfile::getFunctionName ( GlobalValue::GUID GUID) const
inline

Definition at line 75 of file CtxProfAnalysis.h.

References llvm::StringRef::find().

◆ getNumCallsites()

uint32_t llvm::PGOContextualProfile::getNumCallsites ( const Function & F) const
inline

Definition at line 87 of file CtxProfAnalysis.h.

References assert(), F, and isFunctionKnown().

Referenced by llvm::InlineFunction().

◆ getNumCounters()

uint32_t llvm::PGOContextualProfile::getNumCounters ( const Function & F) const
inline

Definition at line 82 of file CtxProfAnalysis.h.

References assert(), F, and isFunctionKnown().

Referenced by llvm::InlineFunction().

◆ invalidate()

bool llvm::PGOContextualProfile::invalidate ( Module & ,
const PreservedAnalyses & PA,
ModuleAnalysisManager::Invalidator &  )
inline

Definition at line 111 of file CtxProfAnalysis.h.

References CtxProfAnalysis, and llvm::PreservedAnalyses::getChecker().

◆ isFunctionKnown()

bool llvm::PGOContextualProfile::isFunctionKnown ( const Function & F) const
inline

◆ isInSpecializedModule()

bool PGOContextualProfile::isInSpecializedModule ( ) const

Definition at line 664 of file CtxProfAnalysis.cpp.

References ForceIsInSpecializedModule.

Referenced by llvm::InlineFunction().

◆ profiles()

const PGOCtxProfile & llvm::PGOContextualProfile::profiles ( ) const
inline

Definition at line 67 of file CtxProfAnalysis.h.

◆ update()

void PGOContextualProfile::update ( Visitor V,
const Function & F )

Definition at line 670 of file CtxProfAnalysis.cpp.

References assert(), F, G, and isFunctionKnown().

Referenced by llvm::InlineFunction(), and llvm::promoteCallWithIfThenElse().

◆ visit()

void PGOContextualProfile::visit ( ConstVisitor V,
const Function * F = nullptr ) const

Definition at line 678 of file CtxProfAnalysis.cpp.

References assert(), F, G, isFunctionKnown(), and preorderVisit().

◆ CtxProfAnalysis

friend class CtxProfAnalysis
friend

Definition at line 31 of file CtxProfAnalysis.h.

References CtxProfAnalysis.

Referenced by CtxProfAnalysis, and invalidate().

◆ CtxProfAnalysisPrinterPass

friend class CtxProfAnalysisPrinterPass
friend

Definition at line 32 of file CtxProfAnalysis.h.

References CtxProfAnalysisPrinterPass.

Referenced by CtxProfAnalysisPrinterPass.


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