LLVM 22.0.0git
llvm::SampleContextTracker Class Reference

#include "llvm/Transforms/IPO/SampleContextTracker.h"

Classes

class  Iterator

Public Types

using ContextSamplesTy = std::vector<FunctionSamples *>

Public Member Functions

 SampleContextTracker ()=default
LLVM_ABI SampleContextTracker (SampleProfileMap &Profiles, const DenseMap< uint64_t, StringRef > *GUIDToFuncNameMap)
LLVM_ABI void populateFuncToCtxtMap ()
LLVM_ABI FunctionSamplesgetCalleeContextSamplesFor (const CallBase &Inst, StringRef CalleeName)
LLVM_ABI std::vector< const FunctionSamples * > getIndirectCalleeContextSamplesFor (const DILocation *DIL)
LLVM_ABI FunctionSamplesgetContextSamplesFor (const DILocation *DIL)
LLVM_ABI FunctionSamplesgetContextSamplesFor (const SampleContext &Context)
LLVM_ABI ContextSamplesTygetAllContextSamplesFor (const Function &Func)
LLVM_ABI ContextSamplesTygetAllContextSamplesFor (StringRef Name)
LLVM_ABI ContextTrieNodegetOrCreateContextPath (const SampleContext &Context, bool AllowCreate)
LLVM_ABI FunctionSamplesgetBaseSamplesFor (const Function &Func, bool MergeContext=true)
LLVM_ABI FunctionSamplesgetBaseSamplesFor (FunctionId Name, bool MergeContext=true)
LLVM_ABI ContextTrieNodegetContextFor (const SampleContext &Context)
LLVM_ABI StringRef getFuncNameFor (ContextTrieNode *Node) const
LLVM_ABI void markContextSamplesInlined (const FunctionSamples *InlinedSamples)
LLVM_ABI ContextTrieNodegetRootContext ()
LLVM_ABI void promoteMergeContextSamplesTree (const Instruction &Inst, FunctionId CalleeName)
LLVM_ABI void createContextLessProfileMap (SampleProfileMap &ContextLessProfiles)
ContextTrieNodegetContextNodeForProfile (const FunctionSamples *FSamples) const
HashKeyMap< std::unordered_map, FunctionId, ContextSamplesTy > & getFuncToCtxtProfiles ()
Iterator begin ()
Iterator end ()
LLVM_ABI std::string getContextString (const FunctionSamples &FSamples) const
LLVM_ABI std::string getContextString (ContextTrieNode *Node) const
LLVM_ABI void dump ()

Detailed Description

Definition at line 92 of file SampleContextTracker.h.

Member Typedef Documentation

◆ ContextSamplesTy

Definition at line 94 of file SampleContextTracker.h.

Constructor & Destructor Documentation

◆ SampleContextTracker() [1/2]

llvm::SampleContextTracker::SampleContextTracker ( )
default

References LLVM_ABI.

◆ SampleContextTracker() [2/2]

Member Function Documentation

◆ begin()

Iterator llvm::SampleContextTracker::begin ( )
inline

Definition at line 185 of file SampleContextTracker.h.

◆ createContextLessProfileMap()

void llvm::SampleContextTracker::createContextLessProfileMap ( SampleProfileMap & ContextLessProfiles)

◆ dump()

void llvm::SampleContextTracker::dump ( )

Definition at line 451 of file SampleContextTracker.cpp.

◆ end()

Iterator llvm::SampleContextTracker::end ( )
inline

Definition at line 186 of file SampleContextTracker.h.

◆ getAllContextSamplesFor() [1/2]

SampleContextTracker::ContextSamplesTy & llvm::SampleContextTracker::getAllContextSamplesFor ( const Function & Func)

◆ getAllContextSamplesFor() [2/2]

SampleContextTracker::ContextSamplesTy & llvm::SampleContextTracker::getAllContextSamplesFor ( StringRef Name)

Definition at line 310 of file SampleContextTracker.cpp.

References llvm::sampleprof::getRepInFormat().

◆ getBaseSamplesFor() [1/2]

FunctionSamples * llvm::SampleContextTracker::getBaseSamplesFor ( const Function & Func,
bool MergeContext = true )

◆ getBaseSamplesFor() [2/2]

FunctionSamples * llvm::SampleContextTracker::getBaseSamplesFor ( FunctionId Name,
bool MergeContext = true )

◆ getCalleeContextSamplesFor()

◆ getContextFor()

◆ getContextNodeForProfile()

ContextTrieNode * llvm::SampleContextTracker::getContextNodeForProfile ( const FunctionSamples * FSamples) const
inline

Definition at line 143 of file SampleContextTracker.h.

References I.

Referenced by getBaseSamplesFor(), and getContextString().

◆ getContextSamplesFor() [1/2]

◆ getContextSamplesFor() [2/2]

FunctionSamples * llvm::SampleContextTracker::getContextSamplesFor ( const SampleContext & Context)

Definition at line 295 of file SampleContextTracker.cpp.

References getContextFor().

◆ getContextString() [1/2]

std::string llvm::SampleContextTracker::getContextString ( const FunctionSamples & FSamples) const

◆ getContextString() [2/2]

◆ getFuncNameFor()

StringRef llvm::SampleContextTracker::getFuncNameFor ( ContextTrieNode * Node) const

◆ getFuncToCtxtProfiles()

HashKeyMap< std::unordered_map, FunctionId, ContextSamplesTy > & llvm::SampleContextTracker::getFuncToCtxtProfiles ( )
inline

Definition at line 150 of file SampleContextTracker.h.

◆ getIndirectCalleeContextSamplesFor()

◆ getOrCreateContextPath()

ContextTrieNode * llvm::SampleContextTracker::getOrCreateContextPath ( const SampleContext & Context,
bool AllowCreate )

◆ getRootContext()

ContextTrieNode & llvm::SampleContextTracker::getRootContext ( )

◆ markContextSamplesInlined()

◆ populateFuncToCtxtMap()

void llvm::SampleContextTracker::populateFuncToCtxtMap ( )

◆ promoteMergeContextSamplesTree()


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