LLVM 20.0.0git
|
#include "llvm/Transforms/IPO/SampleContextTracker.h"
Classes | |
class | Iterator |
Public Types | |
using | ContextSamplesTy = std::vector< FunctionSamples * > |
Definition at line 89 of file SampleContextTracker.h.
using llvm::SampleContextTracker::ContextSamplesTy = std::vector<FunctionSamples *> |
Definition at line 91 of file SampleContextTracker.h.
|
default |
llvm::SampleContextTracker::SampleContextTracker | ( | SampleProfileMap & | Profiles, |
const DenseMap< uint64_t, StringRef > * | GUIDToFuncNameMap | ||
) |
Definition at line 197 of file SampleContextTracker.cpp.
References assert(), llvm::dbgs(), llvm::ContextTrieNode::getFunctionSamples(), getOrCreateContextPath(), LLVM_DEBUG, populateFuncToCtxtMap(), llvm::ContextTrieNode::setFunctionSamples(), and llvm::sampleprof::SampleContext::toString().
|
inline |
Definition at line 179 of file SampleContextTracker.h.
void llvm::SampleContextTracker::createContextLessProfileMap | ( | SampleProfileMap & | ContextLessProfiles | ) |
Definition at line 621 of file SampleContextTracker.cpp.
References llvm::sampleprof::SampleProfileMap::create(), and llvm::sampleprof::FunctionSamples::merge().
void llvm::SampleContextTracker::dump | ( | ) |
Definition at line 450 of file SampleContextTracker.cpp.
References llvm::ContextTrieNode::dumpTree().
|
inline |
Definition at line 180 of file SampleContextTracker.h.
SampleContextTracker::ContextSamplesTy & llvm::SampleContextTracker::getAllContextSamplesFor | ( | const Function & | Func | ) |
Definition at line 303 of file SampleContextTracker.cpp.
References llvm::sampleprof::FunctionSamples::getCanonicalFnName(), and llvm::sampleprof::getRepInFormat().
SampleContextTracker::ContextSamplesTy & llvm::SampleContextTracker::getAllContextSamplesFor | ( | StringRef | Name | ) |
Definition at line 309 of file SampleContextTracker.cpp.
References llvm::sampleprof::getRepInFormat(), and Name.
FunctionSamples * llvm::SampleContextTracker::getBaseSamplesFor | ( | const Function & | Func, |
bool | MergeContext = true |
||
) |
Definition at line 313 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 319 of file SampleContextTracker.cpp.
References assert(), llvm::dbgs(), getContextNodeForProfile(), llvm::sampleprof::SampleContext::hasState(), llvm::sampleprof::InlinedContext, LLVM_DEBUG, llvm::sampleprof::MergedContext, Name, and promoteMergeContextSamplesTree().
FunctionSamples * llvm::SampleContextTracker::getCalleeContextSamplesFor | ( | const CallBase & | Inst, |
StringRef | CalleeName | ||
) |
Definition at line 226 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 460 of file SampleContextTracker.cpp.
References getOrCreateContextPath().
Referenced by getContextSamplesFor(), getIndirectCalleeContextSamplesFor(), and promoteMergeContextSamplesTree().
|
inline |
Definition at line 137 of file SampleContextTracker.h.
References I.
Referenced by getBaseSamplesFor(), and getContextString().
FunctionSamples * llvm::SampleContextTracker::getContextSamplesFor | ( | const DILocation * | DIL | ) |
Definition at line 273 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 294 of file SampleContextTracker.cpp.
References getContextFor().
std::string llvm::SampleContextTracker::getContextString | ( | const FunctionSamples & | FSamples | ) | const |
Definition at line 425 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 430 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 452 of file SampleContextTracker.cpp.
References assert(), and llvm::sampleprof::FunctionSamples::UseMD5.
|
inline |
Definition at line 144 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 518 of file SampleContextTracker.cpp.
References assert(), llvm::ContextTrieNode::getChildContext(), llvm::sampleprof::SampleContext::getContextFrames(), and llvm::ContextTrieNode::getOrCreateChildContext().
Referenced by getContextFor(), and SampleContextTracker().
ContextTrieNode & llvm::SampleContextTracker::getRootContext | ( | ) |
Definition at line 366 of file SampleContextTracker.cpp.
Referenced by llvm::sampleprof::ProfiledCallGraph::ProfiledCallGraph().
void llvm::SampleContextTracker::markContextSamplesInlined | ( | const FunctionSamples * | InlinedSamples | ) |
Definition at line 358 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 214 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 368 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().