LLVM 17.0.0git
|
#include "llvm/Transforms/IPO/SampleContextTracker.h"
Classes | |
class | Iterator |
Public Types | |
using | ContextSamplesTy = std::vector< FunctionSamples * > |
Definition at line 90 of file SampleContextTracker.h.
using llvm::SampleContextTracker::ContextSamplesTy = std::vector<FunctionSamples *> |
Definition at line 92 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 178 of file SampleContextTracker.h.
void llvm::SampleContextTracker::createContextLessProfileMap | ( | SampleProfileMap & | ContextLessProfiles | ) |
Definition at line 635 of file SampleContextTracker.cpp.
void llvm::SampleContextTracker::dump | ( | ) |
Definition at line 457 of file SampleContextTracker.cpp.
References llvm::ContextTrieNode::dumpTree().
|
inline |
Definition at line 179 of file SampleContextTracker.h.
SampleContextTracker::ContextSamplesTy & llvm::SampleContextTracker::getAllContextSamplesFor | ( | const Function & | Func | ) |
Definition at line 306 of file SampleContextTracker.cpp.
References llvm::sampleprof::FunctionSamples::getCanonicalFnName().
SampleContextTracker::ContextSamplesTy & llvm::SampleContextTracker::getAllContextSamplesFor | ( | StringRef | Name | ) |
Definition at line 312 of file SampleContextTracker.cpp.
References Name.
FunctionSamples * llvm::SampleContextTracker::getBaseSamplesFor | ( | const Function & | Func, |
bool | MergeContext = true |
||
) |
Definition at line 316 of file SampleContextTracker.cpp.
References getBaseSamplesFor(), and llvm::sampleprof::FunctionSamples::getCanonicalFnName().
Referenced by getBaseSamplesFor().
FunctionSamples * llvm::SampleContextTracker::getBaseSamplesFor | ( | StringRef | Name, |
bool | MergeContext = true |
||
) |
Definition at line 322 of file SampleContextTracker.cpp.
References assert(), Context, llvm::dbgs(), getContextNodeForProfile(), llvm::sampleprof::getRepInFormat(), llvm::sampleprof::InlinedContext, LLVM_DEBUG, llvm::sampleprof::MergedContext, Name, promoteMergeContextSamplesTree(), and llvm::sampleprof::FunctionSamples::UseMD5.
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(), LLVM_DEBUG, and llvm::sampleprof::FunctionSamples::UseMD5.
ContextTrieNode * llvm::SampleContextTracker::getContextFor | ( | const SampleContext & | Context | ) |
Definition at line 467 of file SampleContextTracker.cpp.
References Context, and 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 276 of file SampleContextTracker.cpp.
References assert(), llvm::sampleprof::FunctionSamples::getContext(), getContextFor(), llvm::sampleprof::InlinedContext, and llvm::sampleprof::SampleContext::setState().
FunctionSamples * llvm::SampleContextTracker::getContextSamplesFor | ( | const SampleContext & | Context | ) |
Definition at line 297 of file SampleContextTracker.cpp.
References Context, and getContextFor().
std::string llvm::SampleContextTracker::getContextString | ( | const FunctionSamples & | FSamples | ) | const |
Definition at line 432 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 437 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 459 of file SampleContextTracker.cpp.
References assert(), and llvm::sampleprof::FunctionSamples::UseMD5.
Referenced by llvm::sampleprof::ProfiledCallGraph::ProfiledCallGraph().
|
inline |
Definition at line 143 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 534 of file SampleContextTracker.cpp.
References assert(), and Context.
Referenced by getContextFor(), and SampleContextTracker().
ContextTrieNode & llvm::SampleContextTracker::getRootContext | ( | ) |
Definition at line 373 of file SampleContextTracker.cpp.
Referenced by llvm::sampleprof::ProfiledCallGraph::ProfiledCallGraph().
void llvm::SampleContextTracker::markContextSamplesInlined | ( | const FunctionSamples * | InlinedSamples | ) |
Definition at line 365 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, |
StringRef | CalleeName | ||
) |
Definition at line 375 of file SampleContextTracker.cpp.
References llvm::dbgs(), llvm::StringRef::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().