LLVM 22.0.0git
|
#include "llvm/Transforms/IPO/SampleContextTracker.h"
Classes | |
class | Iterator |
Public Types | |
using | ContextSamplesTy = std::vector< FunctionSamples * > |
Definition at line 92 of file SampleContextTracker.h.
using llvm::SampleContextTracker::ContextSamplesTy = std::vector<FunctionSamples *> |
Definition at line 94 of file SampleContextTracker.h.
|
default |
llvm::SampleContextTracker::SampleContextTracker | ( | SampleProfileMap & | Profiles, |
const DenseMap< uint64_t, StringRef > * | GUIDToFuncNameMap | ||
) |
Definition at line 198 of file SampleContextTracker.cpp.
References assert(), Context, llvm::dbgs(), llvm::ContextTrieNode::getFunctionSamples(), getOrCreateContextPath(), LLVM_DEBUG, populateFuncToCtxtMap(), and llvm::ContextTrieNode::setFunctionSamples().
|
inline |
Definition at line 185 of file SampleContextTracker.h.
void llvm::SampleContextTracker::createContextLessProfileMap | ( | SampleProfileMap & | ContextLessProfiles | ) |
Definition at line 622 of file SampleContextTracker.cpp.
References llvm::sampleprof::SampleProfileMap::create(), and llvm::sampleprof::FunctionSamples::merge().
void llvm::SampleContextTracker::dump | ( | ) |
Definition at line 451 of file SampleContextTracker.cpp.
References llvm::ContextTrieNode::dumpTree().
|
inline |
Definition at line 186 of file SampleContextTracker.h.
SampleContextTracker::ContextSamplesTy & llvm::SampleContextTracker::getAllContextSamplesFor | ( | const Function & | Func | ) |
Definition at line 304 of file SampleContextTracker.cpp.
References llvm::sampleprof::FunctionSamples::getCanonicalFnName(), and llvm::sampleprof::getRepInFormat().
SampleContextTracker::ContextSamplesTy & llvm::SampleContextTracker::getAllContextSamplesFor | ( | StringRef | Name | ) |
Definition at line 310 of file SampleContextTracker.cpp.
References llvm::sampleprof::getRepInFormat(), and Name.
FunctionSamples * llvm::SampleContextTracker::getBaseSamplesFor | ( | const Function & | Func, |
bool | MergeContext = true |
||
) |
Definition at line 314 of file SampleContextTracker.cpp.
References getBaseSamplesFor(), llvm::sampleprof::FunctionSamples::getCanonicalFnName(), and llvm::sampleprof::getRepInFormat().
Referenced by getBaseSamplesFor().
FunctionSamples * llvm::SampleContextTracker::getBaseSamplesFor | ( | FunctionId | Name, |
bool | MergeContext = true |
||
) |
Definition at line 320 of file SampleContextTracker.cpp.
References assert(), Context, llvm::dbgs(), getContextNodeForProfile(), llvm::sampleprof::InlinedContext, LLVM_DEBUG, llvm::sampleprof::MergedContext, Name, and promoteMergeContextSamplesTree().
FunctionSamples * llvm::SampleContextTracker::getCalleeContextSamplesFor | ( | const CallBase & | Inst, |
StringRef | CalleeName | ||
) |
Definition at line 227 of file SampleContextTracker.cpp.
References llvm::dbgs(), llvm::sampleprof::FunctionSamples::getCanonicalFnName(), getContextString(), llvm::Instruction::getDebugLoc(), llvm::ContextTrieNode::getFunctionSamples(), llvm::sampleprof::getRepInFormat(), and LLVM_DEBUG.
ContextTrieNode * llvm::SampleContextTracker::getContextFor | ( | const SampleContext & | Context | ) |
Definition at line 461 of file SampleContextTracker.cpp.
References Context, and getOrCreateContextPath().
Referenced by getContextSamplesFor(), getIndirectCalleeContextSamplesFor(), and promoteMergeContextSamplesTree().
|
inline |
Definition at line 143 of file SampleContextTracker.h.
References I.
Referenced by getBaseSamplesFor(), and getContextString().
FunctionSamples * llvm::SampleContextTracker::getContextSamplesFor | ( | const DILocation * | DIL | ) |
Definition at line 274 of file SampleContextTracker.cpp.
References assert(), llvm::sampleprof::FunctionSamples::getContext(), getContextFor(), llvm::ContextTrieNode::getFunctionSamples(), llvm::ContextTrieNode::getParentContext(), llvm::sampleprof::InlinedContext, and llvm::sampleprof::SampleContext::setState().
FunctionSamples * llvm::SampleContextTracker::getContextSamplesFor | ( | const SampleContext & | Context | ) |
Definition at line 295 of file SampleContextTracker.cpp.
References Context, and getContextFor().
std::string llvm::SampleContextTracker::getContextString | ( | const FunctionSamples & | FSamples | ) | const |
Definition at line 426 of file SampleContextTracker.cpp.
References getContextNodeForProfile(), and getContextString().
Referenced by getCalleeContextSamplesFor(), getContextString(), and markContextSamplesInlined().
std::string llvm::SampleContextTracker::getContextString | ( | ContextTrieNode * | Node | ) | const |
Definition at line 431 of file SampleContextTracker.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorImpl< T >::emplace_back(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::ContextTrieNode::getCallSiteLoc(), and llvm::sampleprof::SampleContext::getContextString().
StringRef llvm::SampleContextTracker::getFuncNameFor | ( | ContextTrieNode * | Node | ) | const |
Definition at line 453 of file SampleContextTracker.cpp.
References assert(), and llvm::sampleprof::FunctionSamples::UseMD5.
|
inline |
Definition at line 150 of file SampleContextTracker.h.
std::vector< const FunctionSamples * > llvm::SampleContextTracker::getIndirectCalleeContextSamplesFor | ( | const DILocation * | DIL | ) |
ContextTrieNode * llvm::SampleContextTracker::getOrCreateContextPath | ( | const SampleContext & | Context, |
bool | AllowCreate | ||
) |
Definition at line 519 of file SampleContextTracker.cpp.
References assert(), Context, llvm::ContextTrieNode::getChildContext(), and llvm::ContextTrieNode::getOrCreateChildContext().
Referenced by getContextFor(), and SampleContextTracker().
ContextTrieNode & llvm::SampleContextTracker::getRootContext | ( | ) |
Definition at line 367 of file SampleContextTracker.cpp.
Referenced by llvm::sampleprof::ProfiledCallGraph::ProfiledCallGraph().
void llvm::SampleContextTracker::markContextSamplesInlined | ( | const FunctionSamples * | InlinedSamples | ) |
Definition at line 359 of file SampleContextTracker.cpp.
References assert(), llvm::dbgs(), llvm::sampleprof::FunctionSamples::getContext(), getContextString(), llvm::sampleprof::InlinedContext, LLVM_DEBUG, and llvm::sampleprof::SampleContext::setState().
void llvm::SampleContextTracker::populateFuncToCtxtMap | ( | ) |
Definition at line 215 of file SampleContextTracker.cpp.
References llvm::sampleprof::FunctionSamples::getContext(), llvm::sampleprof::RawContext, and llvm::sampleprof::SampleContext::setState().
Referenced by SampleContextTracker().
void llvm::SampleContextTracker::promoteMergeContextSamplesTree | ( | const Instruction & | Inst, |
FunctionId | CalleeName | ||
) |
Definition at line 369 of file SampleContextTracker.cpp.
References llvm::dbgs(), llvm::sampleprof::FunctionId::empty(), llvm::ContextTrieNode::getAllChildContext(), llvm::sampleprof::FunctionSamples::getCallSiteIdentifier(), llvm::ContextTrieNode::getCallSiteLoc(), llvm::ContextTrieNode::getChildContext(), llvm::sampleprof::FunctionSamples::getContext(), getContextFor(), llvm::Instruction::getDebugLoc(), llvm::ContextTrieNode::getFunctionSamples(), llvm::sampleprof::SampleContext::hasState(), llvm::sampleprof::InlinedContext, LLVM_DEBUG, and promoteMergeContextSamplesTree().
Referenced by getBaseSamplesFor(), and promoteMergeContextSamplesTree().