LLVM 20.0.0git
Classes | Public Types | Public Member Functions | List of all members
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
 
 SampleContextTracker (SampleProfileMap &Profiles, const DenseMap< uint64_t, StringRef > *GUIDToFuncNameMap)
 
void populateFuncToCtxtMap ()
 
FunctionSamplesgetCalleeContextSamplesFor (const CallBase &Inst, StringRef CalleeName)
 
std::vector< const FunctionSamples * > getIndirectCalleeContextSamplesFor (const DILocation *DIL)
 
FunctionSamplesgetContextSamplesFor (const DILocation *DIL)
 
FunctionSamplesgetContextSamplesFor (const SampleContext &Context)
 
ContextSamplesTygetAllContextSamplesFor (const Function &Func)
 
ContextSamplesTygetAllContextSamplesFor (StringRef Name)
 
ContextTrieNodegetOrCreateContextPath (const SampleContext &Context, bool AllowCreate)
 
FunctionSamplesgetBaseSamplesFor (const Function &Func, bool MergeContext=true)
 
FunctionSamplesgetBaseSamplesFor (FunctionId Name, bool MergeContext=true)
 
ContextTrieNodegetContextFor (const SampleContext &Context)
 
StringRef getFuncNameFor (ContextTrieNode *Node) const
 
void markContextSamplesInlined (const FunctionSamples *InlinedSamples)
 
ContextTrieNodegetRootContext ()
 
void promoteMergeContextSamplesTree (const Instruction &Inst, FunctionId CalleeName)
 
void createContextLessProfileMap (SampleProfileMap &ContextLessProfiles)
 
ContextTrieNodegetContextNodeForProfile (const FunctionSamples *FSamples) const
 
HashKeyMap< std::unordered_map, FunctionId, ContextSamplesTy > & getFuncToCtxtProfiles ()
 
Iterator begin ()
 
Iterator end ()
 
std::string getContextString (const FunctionSamples &FSamples) const
 
std::string getContextString (ContextTrieNode *Node) const
 
void dump ()
 

Detailed Description

Definition at line 89 of file SampleContextTracker.h.

Member Typedef Documentation

◆ ContextSamplesTy

Definition at line 91 of file SampleContextTracker.h.

Constructor & Destructor Documentation

◆ SampleContextTracker() [1/2]

llvm::SampleContextTracker::SampleContextTracker ( )
default

◆ SampleContextTracker() [2/2]

llvm::SampleContextTracker::SampleContextTracker ( SampleProfileMap Profiles,
const DenseMap< uint64_t, StringRef > *  GUIDToFuncNameMap 
)

Member Function Documentation

◆ begin()

Iterator llvm::SampleContextTracker::begin ( )
inline

Definition at line 179 of file SampleContextTracker.h.

◆ createContextLessProfileMap()

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

◆ dump()

void llvm::SampleContextTracker::dump ( )

Definition at line 450 of file SampleContextTracker.cpp.

References llvm::ContextTrieNode::dumpTree().

◆ end()

Iterator llvm::SampleContextTracker::end ( )
inline

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

References llvm::sampleprof::getRepInFormat(), and Name.

◆ 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()

FunctionSamples * llvm::SampleContextTracker::getCalleeContextSamplesFor ( const CallBase Inst,
StringRef  CalleeName 
)

◆ getContextFor()

ContextTrieNode * llvm::SampleContextTracker::getContextFor ( const SampleContext Context)

◆ getContextNodeForProfile()

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

Definition at line 137 of file SampleContextTracker.h.

References I.

Referenced by getBaseSamplesFor(), and getContextString().

◆ getContextSamplesFor() [1/2]

FunctionSamples * llvm::SampleContextTracker::getContextSamplesFor ( const DILocation DIL)

◆ getContextSamplesFor() [2/2]

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

Definition at line 294 of file SampleContextTracker.cpp.

References getContextFor().

◆ getContextString() [1/2]

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

◆ getContextString() [2/2]

std::string llvm::SampleContextTracker::getContextString ( ContextTrieNode Node) const

◆ getFuncNameFor()

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

◆ getFuncToCtxtProfiles()

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

Definition at line 144 of file SampleContextTracker.h.

◆ getIndirectCalleeContextSamplesFor()

std::vector< const FunctionSamples * > llvm::SampleContextTracker::getIndirectCalleeContextSamplesFor ( const DILocation DIL)

◆ getOrCreateContextPath()

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

◆ getRootContext()

ContextTrieNode & llvm::SampleContextTracker::getRootContext ( )

◆ markContextSamplesInlined()

void llvm::SampleContextTracker::markContextSamplesInlined ( const FunctionSamples InlinedSamples)

◆ populateFuncToCtxtMap()

void llvm::SampleContextTracker::populateFuncToCtxtMap ( )

◆ promoteMergeContextSamplesTree()

void llvm::SampleContextTracker::promoteMergeContextSamplesTree ( const Instruction Inst,
FunctionId  CalleeName 
)

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