LLVM 22.0.0git
|
Namespaces | |
namespace | detail |
namespace | internal |
Classes | |
struct | AllMemProfData |
struct | AllocationInfo |
struct | CallerCalleePairExtractor |
struct | CallSiteInfo |
class | CallStack |
Helper class to iterate through stack ids in both metadata (memprof MIB and callsite) and the corresponding ThinLTO summary data structures (CallsiteInfo and MIBInfo). More... | |
struct | CallStackIdConverter |
class | CallStackLookupTrait |
class | CallStackRadixTreeBuilder |
class | CallStackTrie |
Class to build a trie of call stack contexts for a particular profiled allocation call, along with their associated allocation types. More... | |
class | CallStackWriterTrait |
class | DataAccessProfData |
Encapsulates the data access profile data and the methods to operate on it. More... | |
struct | DataAccessProfRecord |
The data access profiles for a symbol. More... | |
struct | Frame |
struct | FrameIdConverter |
class | FrameLookupTrait |
struct | FrameStat |
class | FrameWriterTrait |
struct | GUIDMemProfRecordPair |
struct | IndexedAllocationInfo |
struct | IndexedCallSiteInfo |
struct | IndexedCallstackIdConverter |
struct | IndexedMemProfData |
struct | IndexedMemProfRecord |
struct | LinearCallStackIdConverter |
struct | LinearFrameIdConverter |
struct | LineLocation |
struct | LineLocationHash |
class | MemProfReader |
struct | MemProfRecord |
class | MemProfSummary |
class | MemProfSummaryBuilder |
struct | PortableMemInfoBlock |
class | RawMemProfReader |
class | RecordLookupTrait |
class | RecordWriterTrait |
struct | SourceLocation |
The location of data in the source code. Used by profile lookup API. More... | |
struct | YamlDataAccessProfData |
class | YAMLMemProfReader |
Typedefs | |
using | SymbolHandleRef = std::variant< StringRef, uint64_t > |
using | SymbolHandle = std::variant< std::string, uint64_t > |
using | MemProfSchema = llvm::SmallVector< Meta, static_cast< int >(Meta::Size)> |
using | FrameId = uint64_t |
using | LinearFrameId = uint32_t |
using | CallStackId = uint64_t |
using | LinearCallStackId = uint32_t |
using | CallEdgeTy = std::pair< LineLocation, uint64_t > |
using | CallStackMap = llvm::DenseMap< uint64_t, llvm::SmallVector< uint64_t > > |
using | LocToLocMap = std::unordered_map< LineLocation, LineLocation, LineLocationHash > |
Enumerations | |
enum | IndexedVersion : uint64_t { Version2 = 2 , Version3 = 3 , Version4 = 4 } |
enum class | Meta : uint64_t { Start = 0 , MIBEntryDef , Size } |
Variables | |
constexpr uint64_t | MinimumSupportedVersion = Version2 |
constexpr uint64_t | MaximumSupportedVersion = Version4 |
template class LLVM_TEMPLATE_ABI | CallStackRadixTreeBuilder< FrameId > |
template class LLVM_TEMPLATE_ABI | CallStackRadixTreeBuilder< LinearFrameId > |
using llvm::memprof::CallEdgeTy = typedef std::pair<LineLocation, uint64_t> |
using llvm::memprof::CallStackId = typedef uint64_t |
using llvm::memprof::CallStackMap = typedef llvm::DenseMap<uint64_t, llvm::SmallVector<uint64_t> > |
Definition at line 105 of file MemProfReader.h.
using llvm::memprof::FrameId = typedef uint64_t |
using llvm::memprof::LinearCallStackId = typedef uint32_t |
using llvm::memprof::LinearFrameId = typedef uint32_t |
using llvm::memprof::LocToLocMap = typedef std::unordered_map<LineLocation, LineLocation, LineLocationHash> |
Definition at line 65 of file MemProfUse.h.
using llvm::memprof::MemProfSchema = typedef llvm::SmallVector<Meta, static_cast<int>(Meta::Size)> |
using llvm::memprof::SymbolHandle = typedef std::variant<std::string, uint64_t> |
Definition at line 102 of file DataAccessProf.h.
using llvm::memprof::SymbolHandleRef = typedef std::variant<StringRef, uint64_t> |
Definition at line 99 of file DataAccessProf.h.
|
strong |
MDNode * llvm::memprof::buildCallstackMetadata | ( | ArrayRef< uint64_t > | CallStack, |
LLVMContext & | Ctx | ||
) |
Build callstack metadata from the provided list of call stack ids.
Returns the resulting metadata node.
Definition at line 68 of file MemoryProfileInfo.cpp.
References llvm::MDNode::get(), llvm::ValueAsMetadata::get(), llvm::Type::getInt64Ty(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::SmallVectorImpl< T >::reserve().
Referenced by addCallsiteMetadata(), and createMIBNode().
LLVM_ABI MDNode * llvm::memprof::buildContextSizeMetadata | ( | ArrayRef< ContextTotalSize > | ContextSizeInfo, |
LLVMContext & | Ctx | ||
) |
Build metadata from the provided list of full stack id and profiled size, to use when reporting of hinted sizes is enabled.
llvm::DenseMap< FrameIdTy, FrameStat > llvm::memprof::computeFrameHistogram | ( | llvm::MapVector< CallStackId, llvm::SmallVector< FrameIdTy > > & | MemProfCallStackData | ) |
Definition at line 228 of file MemProfRadixTree.cpp.
Referenced by llvm::writeMemProfRadixTreeBased().
template LLVM_ABI llvm::DenseMap< FrameId, FrameStat > llvm::memprof::computeFrameHistogram< FrameId > | ( | llvm::MapVector< CallStackId, llvm::SmallVector< FrameId > > & | MemProfCallStackData | ) |
template LLVM_ABI llvm::DenseMap< LinearFrameId, FrameStat > llvm::memprof::computeFrameHistogram< LinearFrameId > | ( | llvm::MapVector< CallStackId, llvm::SmallVector< LinearFrameId > > & | MemProfCallStackData | ) |
Referenced by writeMemoryProfileRadixTree().
Helper to generate a single hash id for a given callstack, used for emitting matching statistics and useful for uniquing such statistics across modules.
Also used to dedup contexts when computing the summary.
Definition at line 73 of file MemProfCommon.cpp.
References llvm::HashBuilder< HasherT, Endianness >::add(), F, llvm::HashBuilderBase< HasherT >::final(), and llvm::little.
Referenced by llvm::memprof::MemProfSummaryBuilder::addRecord(), handleAllocSite(), and CallSiteEntryHash::operator()().
DenseMap< uint64_t, LocToLocMap > llvm::memprof::computeUndriftMap | ( | Module & | M, |
IndexedInstrProfReader * | MemProfReader, | ||
const TargetLibraryInfo & | TLI | ||
) |
Definition at line 278 of file MemProfUse.cpp.
References A, assert(), B, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::contains(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), extractCallsFromIR(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::try_emplace().
Referenced by llvm::MemProfUsePass::run().
|
static |
Definition at line 199 of file MemProf.cpp.
References I, Ptr, and llvm::memprof::PortableMemInfoBlock::serializedSize().
Referenced by llvm::memprof::IndexedMemProfRecord::deserialize().
|
static |
Definition at line 230 of file MemProf.cpp.
References I, Ptr, and llvm::memprof::PortableMemInfoBlock::serializedSize().
Referenced by llvm::memprof::IndexedMemProfRecord::deserialize().
|
static |
Definition at line 267 of file MemProf.cpp.
References I, Ptr, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorImpl< T >::reserve(), and llvm::memprof::PortableMemInfoBlock::serializedSize().
Referenced by llvm::memprof::IndexedMemProfRecord::deserialize().
DenseMap< uint64_t, SmallVector< CallEdgeTy, 0 > > llvm::memprof::extractCallsFromIR | ( | Module & | M, |
const TargetLibraryInfo & | TLI, | ||
function_ref< bool(uint64_t)> | IsPresentInProfile = [](uint64_t) { return true; } |
||
) |
Definition at line 203 of file MemProfUse.cpp.
References assert(), llvm::StringRef::empty(), F, getGUID(), I, isAllocationWithHotColdVariant(), llvm::sort(), and llvm::unique().
Referenced by computeUndriftMap().
AllocationType llvm::memprof::getAllocType | ( | uint64_t | TotalLifetimeAccessDensity, |
uint64_t | AllocCount, | ||
uint64_t | TotalLifetime | ||
) |
Return the allocation type for a given set of memory profile values.
Definition at line 51 of file MemProfCommon.cpp.
References MemProfAveLifetimeColdThreshold(), MemProfLifetimeAccessDensityColdThreshold(), MemProfMinAveLifetimeAccessDensityHotThreshold(), and MemProfUseHotHints().
Referenced by addCallStack().
std::string llvm::memprof::getAllocTypeAttributeString | ( | AllocationType | Type | ) |
Returns the string to use in attributes with the given type.
Definition at line 101 of file MemoryProfileInfo.cpp.
References assert(), and llvm_unreachable.
Referenced by llvm::memprof::CallStackTrie::addSingleAllocTypeAttribute(), createMIBNode(), and llvm::MemProfUsePass::run().
Definition at line 25 of file DataAccessProf.cpp.
References llvm::InstrProfSymtab::getCanonicalName(), llvm::invalid_argument, and Name.
Referenced by llvm::memprof::DataAccessProfData::addKnownSymbolWithoutSamples(), llvm::memprof::DataAccessProfData::getProfileRecord(), and llvm::memprof::DataAccessProfData::setDataAccessProfile().
MemProfSchema llvm::memprof::getFullSchema | ( | ) |
Definition at line 11 of file MemProf.cpp.
References llvm::List.
Referenced by llvm::memprof::IndexedAllocationInfo::IndexedAllocationInfo(), llvm::writeMemProfRadixTreeBased(), and llvm::writeMemProfV2().
GlobalValue::GUID llvm::memprof::getGUID | ( | const StringRef | FunctionName | ) |
Definition at line 344 of file MemProf.cpp.
References llvm::sampleprof::FunctionSamples::getCanonicalFnName(), and llvm::GlobalValue::getGUIDAssumingExternalLinkage().
Referenced by extractCallsFromIR().
MemProfSchema llvm::memprof::getHotColdSchema | ( | ) |
Definition at line 19 of file MemProf.cpp.
Referenced by llvm::writeMemProfRadixTreeBased(), and llvm::writeMemProfV2().
|
inline |
Definition at line 58 of file MemProf.h.
Referenced by getMemprofOptionsSymbolName().
|
inline |
Definition at line 62 of file MemProf.h.
References llvm::StringRef::drop_front(), and getMemprofOptionsSymbolDarwinLinkageName().
Referenced by createMemprofDefaultOptionsVar().
AllocationType llvm::memprof::getMIBAllocType | ( | const MDNode * | MIB | ) |
Returns the allocation type from an MIB metadata node.
Definition at line 86 of file MemoryProfileInfo.cpp.
References assert(), llvm::MDNode::getNumOperands(), and llvm::MDNode::getOperand().
Referenced by llvm::memprof::CallStackTrie::addCallStack(), computeFunctionSummary(), and saveFilteredNewMIBNodes().
Returns the stack node from an MIB metadata node.
Definition at line 80 of file MemoryProfileInfo.cpp.
References assert(), llvm::MDNode::getNumOperands(), and llvm::MDNode::getOperand().
Referenced by llvm::memprof::CallStackTrie::addCallStack(), checkAllocContextIds(), computeFunctionSummary(), propagateMemProfHelper(), and saveFilteredNewMIBNodes().
True if the AllocTypes bitmask contains just a single type.
Definition at line 118 of file MemoryProfileInfo.cpp.
References assert(), and llvm::popcount().
Referenced by llvm::memprof::CallStackTrie::buildAndAttachMIBMetadata().
bool llvm::memprof::metadataIncludesAllContextSizeInfo | ( | ) |
Whether the alloc memeprof metadata will include context size info for all MIBs.
Definition at line 55 of file MemoryProfileInfo.cpp.
References MemProfReportHintedSizes, and MinClonedColdBytePercent.
Referenced by computeFunctionSummary(), createMIBNode(), and metadataMayIncludeContextSizeInfo().
bool llvm::memprof::metadataMayIncludeContextSizeInfo | ( | ) |
Whether the alloc memprof metadata may include context size info for some MIBs (but possibly not all).
Definition at line 59 of file MemoryProfileInfo.cpp.
References metadataIncludesAllContextSizeInfo(), and MinPercentMaxColdSize.
Referenced by recordContextSizeInfoForAnalysis().
Expected< MemProfSchema > llvm::memprof::readMemProfSchema | ( | const unsigned char *& | Buffer | ) |
Definition at line 360 of file MemProf.cpp.
References I, llvm::malformed, Ptr, Size, and llvm::Tag.
bool llvm::memprof::recordContextSizeInfoForAnalysis | ( | ) |
Whether we need to record the context size info in the alloc trie used to build metadata.
Definition at line 63 of file MemoryProfileInfo.cpp.
References metadataMayIncludeContextSizeInfo(), and MinCallsiteColdBytePercent.
Referenced by addCallStack(), and handleAllocSite().
|
static |
Definition at line 18 of file DataAccessProf.cpp.
References llvm::UniqueStringSaver::save().
Referenced by llvm::memprof::DataAccessProfData::addKnownSymbolWithoutSamples(), and llvm::memprof::DataAccessProfData::setDataAccessProfile().
|
static |
Definition at line 24 of file MemProf.cpp.
References llvm::memprof::PortableMemInfoBlock::serializedSize(), and Size.
Referenced by llvm::memprof::IndexedAllocationInfo::serializedSize(), and llvm::memprof::IndexedMemProfRecord::serializedSize().
|
static |
Definition at line 57 of file MemProf.cpp.
|
static |
Definition at line 34 of file MemProf.cpp.
References llvm::memprof::PortableMemInfoBlock::serializedSize(), and Size.
Referenced by llvm::memprof::IndexedAllocationInfo::serializedSize(), and llvm::memprof::IndexedMemProfRecord::serializedSize().
|
static |
Definition at line 71 of file MemProf.cpp.
|
static |
Definition at line 86 of file MemProf.cpp.
Referenced by llvm::memprof::IndexedMemProfRecord::serializedSize().
|
static |
Definition at line 114 of file MemProf.cpp.
References llvm::little, N, and OS.
Referenced by llvm::memprof::IndexedMemProfRecord::serialize().
|
static |
Definition at line 132 of file MemProf.cpp.
References assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::contains(), llvm::little, N, and OS.
Referenced by llvm::memprof::IndexedMemProfRecord::serialize().
|
static |
Definition at line 155 of file MemProf.cpp.
References assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::contains(), llvm::Guid, llvm::little, N, and OS.
Referenced by llvm::memprof::IndexedMemProfRecord::serialize().
template class LLVM_EXPORT_TEMPLATE llvm::memprof::CallStackRadixTreeBuilder< FrameId > |
Definition at line 223 of file MemProfRadixTree.cpp.
template class LLVM_EXPORT_TEMPLATE llvm::memprof::CallStackRadixTreeBuilder< LinearFrameId > |
Definition at line 224 of file MemProfRadixTree.cpp.
Definition at line 53 of file MemProf.h.
Referenced by llvm::IndexedMemProfReader::deserialize(), llvm::IndexedMemProfReader::getMemProfRecord(), and llvm::writeMemProf().
Definition at line 52 of file MemProf.h.
Referenced by llvm::IndexedMemProfReader::deserialize(), llvm::IndexedMemProfReader::getMemProfRecord(), and llvm::writeMemProf().