LLVM 20.0.0git
Classes | Public Types | Public Member Functions | Friends | List of all members
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
 
 operator bool () const
 
const PGOCtxProfContext::CallTargetMapTyprofiles () 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)
 
void update (Visitor, const Function &F)
 
void visit (ConstVisitor, const Function *F=nullptr) const
 
const CtxProfFlatProfile flatten () 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 31 of file CtxProfAnalysis.h.

Member Typedef Documentation

◆ ConstVisitor

Definition at line 96 of file CtxProfAnalysis.h.

◆ Visitor

Definition at line 97 of file CtxProfAnalysis.h.

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 91 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 86 of file CtxProfAnalysis.h.

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

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

◆ flatten()

const CtxProfFlatProfile PGOContextualProfile::flatten ( ) const

◆ getFunctionName()

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

Definition at line 69 of file CtxProfAnalysis.h.

References llvm::StringRef::find().

◆ getNumCallsites()

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

Definition at line 81 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 76 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 104 of file CtxProfAnalysis.h.

References llvm::PreservedAnalyses::getChecker().

◆ isFunctionKnown()

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

◆ operator bool()

llvm::PGOContextualProfile::operator bool ( ) const
inline

Definition at line 59 of file CtxProfAnalysis.h.

◆ profiles()

const PGOCtxProfContext::CallTargetMapTy & llvm::PGOContextualProfile::profiles ( ) const
inline

Definition at line 61 of file CtxProfAnalysis.h.

◆ update()

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

Definition at line 301 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 309 of file CtxProfAnalysis.cpp.

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

Friends And Related Function Documentation

◆ CtxProfAnalysis

friend class CtxProfAnalysis
friend

Definition at line 32 of file CtxProfAnalysis.h.

◆ CtxProfAnalysisPrinterPass

friend class CtxProfAnalysisPrinterPass
friend

Definition at line 33 of file CtxProfAnalysis.h.


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