Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.0.0git
Namespaces |Classes |Typedefs |Enumerations |Functions |Variables
llvm::memprof Namespace Reference

Namespaces

namespace  detail
 

Classes

struct  AllMemProfData
 
struct  AllocationInfo
 
struct  CallerCalleePairExtractor
 
class  CallStack
 Helper class to iterate through stack ids in both metadata (memprof MIB and callsite) and the corresponding ThinLTO summary data structures (CallsiteInfo andMIBInfo).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
 
struct  Frame
 
struct  FrameIdConverter
 
class  FrameLookupTrait
 
struct  FrameStat
 
class  FrameWriterTrait
 
struct  GUIDMemProfRecordPair
 
struct  IndexedAllocationInfo
 
struct  IndexedCallstackIdConveter
 
struct  IndexedMemProfData
 
struct  IndexedMemProfRecord
 
struct  LinearCallStackIdConverter
 
struct  LinearFrameIdConverter
 
struct  LineLocation
 
struct  LineLocationHash
 
class  MemProfReader
 
struct  MemProfRecord
 
struct  PortableMemInfoBlock
 
class  RawMemProfReader
 
class  RecordLookupTrait
 
class  RecordWriterTrait
 
class  YAMLMemProfReader
 

Typedefs

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 }
 
enum class  Meta : uint64_t {Start = 0,MIBEntryDef,Size }
 

Functions

AllocationType getAllocType (uint64_t TotalLifetimeAccessDensity,uint64_t AllocCount,uint64_t TotalLifetime)
 Return the allocation type for a given set of memory profile values.
 
MDNodebuildCallstackMetadata (ArrayRef<uint64_t >CallStack,LLVMContext &Ctx)
 Build callstack metadata from the provided list of call stack ids.
 
MDNodebuildContextSizeMetadata (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.
 
MDNodegetMIBStackNode (constMDNode *MIB)
 Returns the stack node from an MIB metadata node.
 
AllocationType getMIBAllocType (constMDNode *MIB)
 Returns the allocation type from an MIB metadata node.
 
std::string getAllocTypeAttributeString (AllocationTypeType)
 Returns the string to use in attributes with the given type.
 
bool hasSingleAllocType (uint8_t AllocTypes)
 True if the AllocTypes bitmask contains just a single type.
 
MemProfSchema getFullSchema ()
 
MemProfSchema getHotColdSchema ()
 
Expected<MemProfSchemareadMemProfSchema (constunsignedchar *&Buffer)
 
template<typename FrameIdTy >
llvm::DenseMap< FrameIdTy,FrameStatcomputeFrameHistogram (llvm::MapVector<CallStackId,llvm::SmallVector< FrameIdTy > > &MemProfCallStackData)
 
DenseMap<uint64_t,SmallVector<CallEdgeTy, 0 > > extractCallsFromIR (Module &M,constTargetLibraryInfo &TLI,function_ref<bool(uint64_t)> IsPresentInProfile=[](uint64_t) { returntrue;})
 
DenseMap<uint64_t,LocToLocMapcomputeUndriftMap (Module &M,IndexedInstrProfReader *MemProfReader,constTargetLibraryInfo &TLI)
 
static size_t serializedSizeV2 (constIndexedAllocationInfo &IAI,constMemProfSchema &Schema)
 
static size_t serializedSizeV3 (constIndexedAllocationInfo &IAI,constMemProfSchema &Schema)
 
static size_t serializedSizeV2 (constIndexedMemProfRecord &Record,constMemProfSchema &Schema)
 
static size_t serializedSizeV3 (constIndexedMemProfRecord &Record,constMemProfSchema &Schema)
 
static void serializeV2 (constIndexedMemProfRecord &Record,constMemProfSchema &Schema,raw_ostream &OS)
 
static void serializeV3 (constIndexedMemProfRecord &Record,constMemProfSchema &Schema,raw_ostream &OS,llvm::DenseMap<CallStackId,LinearCallStackId > &MemProfCallStackIndexes)
 
staticIndexedMemProfRecord deserializeV2 (constMemProfSchema &Schema,constunsignedchar *Ptr)
 
staticIndexedMemProfRecord deserializeV3 (constMemProfSchema &Schema,constunsignedchar *Ptr)
 
templatellvm::DenseMap<FrameId,FrameStatcomputeFrameHistogram< FrameId > (llvm::MapVector<CallStackId,llvm::SmallVector<FrameId > > &MemProfCallStackData)
 
templatellvm::DenseMap<LinearFrameId,FrameStatcomputeFrameHistogram< LinearFrameId > (llvm::MapVector<CallStackId,llvm::SmallVector<LinearFrameId > > &MemProfCallStackData)
 

Variables

constexpruint64_t MinimumSupportedVersion =Version2
 
constexpruint64_t MaximumSupportedVersion =Version3
 

Typedef Documentation

◆ CallEdgeTy

usingllvm::memprof::CallEdgeTy = typedef std::pair<LineLocation,uint64_t>

Definition at line913 of fileMemProf.h.

◆ CallStackId

usingllvm::memprof::CallStackId = typedefuint64_t

Definition at line329 of fileMemProf.h.

◆ CallStackMap

usingllvm::memprof::CallStackMap = typedefllvm::DenseMap<uint64_t,llvm::SmallVector<uint64_t> >

Definition at line104 of fileMemProfReader.h.

◆ FrameId

usingllvm::memprof::FrameId = typedefuint64_t

Definition at line213 of fileMemProf.h.

◆ LinearCallStackId

usingllvm::memprof::LinearCallStackId = typedefuint32_t

Definition at line332 of fileMemProf.h.

◆ LinearFrameId

usingllvm::memprof::LinearFrameId = typedefuint32_t

Definition at line215 of fileMemProf.h.

◆ LocToLocMap

usingllvm::memprof::LocToLocMap = typedef std::unordered_map<LineLocation,LineLocation,LineLocationHash>

Definition at line81 of fileMemProfiler.h.

◆ MemProfSchema

usingllvm::memprof::MemProfSchema = typedefllvm::SmallVector<Meta, static_cast<int>(Meta::Size)>

Definition at line53 of fileMemProf.h.

Enumeration Type Documentation

◆ IndexedVersion

enumllvm::memprof::IndexedVersion :uint64_t
Enumerator
Version2 
Version3 

Definition at line31 of fileMemProf.h.

◆ Meta

enum classllvm::memprof::Meta :uint64_t
strong
Enumerator
Start 
MIBEntryDef 
Size 

Definition at line45 of fileMemProf.h.

Function Documentation

◆ buildCallstackMetadata()

MDNode * llvm::memprof::buildCallstackMetadata(ArrayRef<uint64_tCallStack,
LLVMContextCtx 
)

Build callstack metadata from the provided list of call stack ids.

Returns the resulting metadata node.

Definition at line76 of fileMemoryProfileInfo.cpp.

Referencesllvm::MDNode::get(),llvm::ValueAsMetadata::get(),llvm::Type::getInt64Ty(),llvm::SmallVectorTemplateBase< T, bool >::push_back(), andllvm::SmallVectorImpl< T >::reserve().

Referenced byaddCallsiteMetadata(), andcreateMIBNode().

◆ buildContextSizeMetadata()

MDNode * llvm::memprof::buildContextSizeMetadata(ArrayRef<ContextTotalSizeContextSizeInfo,
LLVMContextCtx 
)

Build metadata from the provided list of full stack id and profiled size, to use when reporting of hinted sizes is enabled.

◆ computeFrameHistogram()

template<typename FrameIdTy >
llvm::DenseMap< FrameIdTy,FrameStat > llvm::memprof::computeFrameHistogram(llvm::MapVector<CallStackId,llvm::SmallVector< FrameIdTy > > & MemProfCallStackData)

Definition at line515 of fileMemProf.cpp.

ReferencesE, andI.

Referenced bywriteMemProfV3().

◆ computeFrameHistogram< FrameId >()

templatellvm::DenseMap<FrameId,FrameStat >llvm::memprof::computeFrameHistogram<FrameId >(llvm::MapVector<CallStackId,llvm::SmallVector<FrameId > > & MemProfCallStackData)

◆ computeFrameHistogram< LinearFrameId >()

templatellvm::DenseMap<LinearFrameId,FrameStat >llvm::memprof::computeFrameHistogram<LinearFrameId >(llvm::MapVector<CallStackId,llvm::SmallVector<LinearFrameId > > & MemProfCallStackData)

Referenced bywriteMemoryProfileRadixTree().

◆ computeUndriftMap()

DenseMap<uint64_t,LocToLocMap > llvm::memprof::computeUndriftMap(ModuleM,
IndexedInstrProfReaderMemProfReader,
constTargetLibraryInfoTLI 
)

Definition at line910 of fileMemProfiler.cpp.

ReferencesA,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(), andllvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::try_emplace().

Referenced byllvm::MemProfUsePass::run().

◆ deserializeV2()

staticIndexedMemProfRecord llvm::memprof::deserializeV2(constMemProfSchemaSchema,
constunsignedcharPtr 
)
static

Definition at line152 of fileMemProf.cpp.

ReferencesI,Ptr, andllvm::memprof::PortableMemInfoBlock::serializedSize().

Referenced byllvm::memprof::IndexedMemProfRecord::deserialize().

◆ deserializeV3()

staticIndexedMemProfRecord llvm::memprof::deserializeV3(constMemProfSchemaSchema,
constunsignedcharPtr 
)
static

Definition at line183 of fileMemProf.cpp.

ReferencesI,Ptr, andllvm::memprof::PortableMemInfoBlock::serializedSize().

Referenced byllvm::memprof::IndexedMemProfRecord::deserialize().

◆ extractCallsFromIR()

DenseMap<uint64_t,SmallVector<CallEdgeTy, 0 > > llvm::memprof::extractCallsFromIR(ModuleM,
constTargetLibraryInfoTLI,
function_ref<bool(uint64_t)> IsPresentInProfile =[](uint64_t) { return true; } 
)

Definition at line835 of fileMemProfiler.cpp.

Referencesassert(),llvm::StringRef::empty(),F,llvm::memprof::IndexedMemProfRecord::getGUID(),I,isAllocationWithHotColdVariant(),llvm::sort(), andllvm::unique().

Referenced bycomputeUndriftMap().

◆ getAllocType()

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 line54 of fileMemoryProfileInfo.cpp.

ReferencesMemProfAveLifetimeColdThreshold,MemProfLifetimeAccessDensityColdThreshold,MemProfMinAveLifetimeAccessDensityHotThreshold, andMemProfUseHotHints.

Referenced byaddCallStack().

◆ getAllocTypeAttributeString()

std::string llvm::memprof::getAllocTypeAttributeString(AllocationType Type)

Returns the string to use in attributes with the given type.

Definition at line109 of fileMemoryProfileInfo.cpp.

Referencesassert(), andllvm_unreachable.

Referenced byaddAllocTypeAttribute(),llvm::memprof::CallStackTrie::addSingleAllocTypeAttribute(),createMIBNode(), andllvm::MemProfUsePass::run().

◆ getFullSchema()

MemProfSchema llvm::memprof::getFullSchema()

Definition at line13 of fileMemProf.cpp.

Referencesllvm::List.

Referenced byllvm::memprof::IndexedAllocationInfo::IndexedAllocationInfo(),writeMemProfV2(), andwriteMemProfV3().

◆ getHotColdSchema()

MemProfSchema llvm::memprof::getHotColdSchema()

Definition at line21 of fileMemProf.cpp.

Referenced bywriteMemProfV2(), andwriteMemProfV3().

◆ getMIBAllocType()

AllocationType llvm::memprof::getMIBAllocType(constMDNodeMIB)

Returns the allocation type from an MIB metadata node.

Definition at line94 of fileMemoryProfileInfo.cpp.

Referencesassert(),llvm::MDNode::getNumOperands(), andllvm::MDNode::getOperand().

Referenced byllvm::memprof::CallStackTrie::addCallStack(), andcomputeFunctionSummary().

◆ getMIBStackNode()

MDNode * llvm::memprof::getMIBStackNode(constMDNodeMIB)

Returns the stack node from an MIB metadata node.

Definition at line88 of fileMemoryProfileInfo.cpp.

Referencesassert(),llvm::MDNode::getNumOperands(), andllvm::MDNode::getOperand().

Referenced byllvm::memprof::CallStackTrie::addCallStack(),computeFunctionSummary(), andpropagateMemProfHelper().

◆ hasSingleAllocType()

bool llvm::memprof::hasSingleAllocType(uint8_t AllocTypes)

True if the AllocTypes bitmask contains just a single type.

Definition at line133 of fileMemoryProfileInfo.cpp.

Referencesassert(), andllvm::popcount().

Referenced byllvm::memprof::CallStackTrie::buildAndAttachMIBMetadata().

◆ readMemProfSchema()

Expected<MemProfSchema > llvm::memprof::readMemProfSchema(constunsignedchar *& Buffer)

Definition at line267 of fileMemProf.cpp.

ReferencesI,llvm::malformed,Ptr,Size, andllvm::Tag.

◆ serializedSizeV2()[1/2]

static size_t llvm::memprof::serializedSizeV2(constIndexedAllocationInfoIAI,
constMemProfSchemaSchema 
)
static

Definition at line26 of fileMemProf.cpp.

Referencesllvm::memprof::PortableMemInfoBlock::serializedSize(), andSize.

Referenced byllvm::memprof::IndexedAllocationInfo::serializedSize(), andllvm::memprof::IndexedMemProfRecord::serializedSize().

◆ serializedSizeV2()[2/2]

static size_t llvm::memprof::serializedSizeV2(constIndexedMemProfRecordRecord,
constMemProfSchemaSchema 
)
static

Definition at line57 of fileMemProf.cpp.

ReferencesN, andVersion2.

◆ serializedSizeV3()[1/2]

static size_t llvm::memprof::serializedSizeV3(constIndexedAllocationInfoIAI,
constMemProfSchemaSchema 
)
static

Definition at line36 of fileMemProf.cpp.

Referencesllvm::memprof::PortableMemInfoBlock::serializedSize(), andSize.

Referenced byllvm::memprof::IndexedAllocationInfo::serializedSize(), andllvm::memprof::IndexedMemProfRecord::serializedSize().

◆ serializedSizeV3()[2/2]

static size_t llvm::memprof::serializedSizeV3(constIndexedMemProfRecordRecord,
constMemProfSchemaSchema 
)
static

Definition at line71 of fileMemProf.cpp.

ReferencesN, andVersion3.

◆ serializeV2()

static void llvm::memprof::serializeV2(constIndexedMemProfRecordRecord,
constMemProfSchemaSchema,
raw_ostreamOS 
)
static

Definition at line96 of fileMemProf.cpp.

Referencesllvm::little,N, andOS.

Referenced byllvm::memprof::IndexedMemProfRecord::serialize().

◆ serializeV3()

static void llvm::memprof::serializeV3(constIndexedMemProfRecordRecord,
constMemProfSchemaSchema,
raw_ostreamOS,
llvm::DenseMap<CallStackId,LinearCallStackId > & MemProfCallStackIndexes 
)
static

Definition at line114 of fileMemProf.cpp.

Referencesassert(),llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::contains(),llvm::little,N, andOS.

Referenced byllvm::memprof::IndexedMemProfRecord::serialize().

Variable Documentation

◆ MaximumSupportedVersion

constexpruint64_t llvm::memprof::MaximumSupportedVersion =Version3
constexpr

Definition at line40 of fileMemProf.h.

Referenced byllvm::IndexedMemProfReader::deserialize(),llvm::IndexedMemProfReader::getMemProfRecord(), andwriteMemProf().

◆ MinimumSupportedVersion

constexpruint64_t llvm::memprof::MinimumSupportedVersion =Version2
constexpr

Definition at line39 of fileMemProf.h.

Referenced byllvm::IndexedMemProfReader::deserialize(),llvm::IndexedMemProfReader::getMemProfRecord(), andwriteMemProf().


Generated on Sun Jul 20 2025 22:15:20 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp