LLVM  16.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 (StringRef Name, bool MergeContext=true)
 
ContextTrieNodegetContextFor (const SampleContext &Context)
 
StringRef getFuncNameFor (ContextTrieNode *Node) const
 
void markContextSamplesInlined (const FunctionSamples *InlinedSamples)
 
ContextTrieNodegetRootContext ()
 
void promoteMergeContextSamplesTree (const Instruction &Inst, StringRef CalleeName)
 
void createContextLessProfileMap (SampleProfileMap &ContextLessProfiles)
 
ContextTrieNodegetContextNodeForProfile (const FunctionSamples *FSamples) const
 
StringMap< 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 90 of file SampleContextTracker.h.

Member Typedef Documentation

◆ ContextSamplesTy

Definition at line 92 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 178 of file SampleContextTracker.h.

◆ createContextLessProfileMap()

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

Definition at line 633 of file SampleContextTracker.cpp.

◆ dump()

void llvm::SampleContextTracker::dump ( )

Definition at line 455 of file SampleContextTracker.cpp.

References llvm::ContextTrieNode::dumpTree().

◆ end()

Iterator llvm::SampleContextTracker::end ( )
inline

Definition at line 179 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.

◆ getBaseSamplesFor() [1/2]

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

◆ getBaseSamplesFor() [2/2]

FunctionSamples * llvm::SampleContextTracker::getBaseSamplesFor ( StringRef  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 getContextString().

◆ getContextSamplesFor() [1/2]

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

◆ getContextSamplesFor() [2/2]

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

Definition at line 295 of file SampleContextTracker.cpp.

◆ getContextString() [1/2]

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

◆ getContextString() [2/2]

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

Definition at line 435 of file SampleContextTracker.cpp.

◆ getFuncNameFor()

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

◆ getFuncToCtxtProfiles()

StringMap<ContextSamplesTy>& llvm::SampleContextTracker::getFuncToCtxtProfiles ( )
inline

Definition at line 143 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 ( )

Definition at line 213 of file SampleContextTracker.cpp.

Referenced by SampleContextTracker().

◆ promoteMergeContextSamplesTree()

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

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