LLVM  16.0.0git
Classes | Typedefs | Enumerations | Functions
llvm::memprof Namespace Reference

Classes

struct  AllocationInfo
 
class  CallStackTrie
 Class to build a trie of call stack contexts for a particular profiled allocation call, along with their associated allocation types. More...
 
struct  Frame
 
class  FrameLookupTrait
 
class  FrameWriterTrait
 
struct  IndexedAllocationInfo
 
struct  IndexedMemProfRecord
 
struct  MemProfRecord
 
struct  PortableMemInfoBlock
 
class  RawMemProfReader
 
class  RecordLookupTrait
 
class  RecordWriterTrait
 

Typedefs

using MemProfSchema = llvm::SmallVector< Meta, static_cast< int >(Meta::Size)>
 
using FrameId = uint64_t
 
using CallStackMap = llvm::DenseMap< uint64_t, llvm::SmallVector< uint64_t > >
 

Enumerations

enum  AllocationType : uint8_t { AllocationType::None = 0, AllocationType::NotCold = 1, AllocationType::Cold = 2 }
 
enum  Meta : uint64_t { Meta::Start = 0, Meta::MIBEntryDef, Meta::Size }
 

Functions

AllocationType getAllocType (uint64_t MaxAccessCount, uint64_t MinSize, uint64_t MinLifetime)
 Return the allocation type for a given set of memory profile values. More...
 
MDNodebuildCallstackMetadata (ArrayRef< uint64_t > CallStack, LLVMContext &Ctx)
 Build callstack metadata from the provided list of call stack ids. More...
 
MDNodegetMIBStackNode (const MDNode *MIB)
 Returns the stack node from an MIB metadata node. More...
 
AllocationType getMIBAllocType (const MDNode *MIB)
 Returns the allocation type from an MIB metadata node. More...
 
Expected< MemProfSchemareadMemProfSchema (const unsigned char *&Buffer)
 

Typedef Documentation

◆ CallStackMap

Definition at line 36 of file RawMemProfReader.h.

◆ FrameId

Definition at line 137 of file MemProf.h.

◆ MemProfSchema

Definition at line 26 of file MemProf.h.

Enumeration Type Documentation

◆ AllocationType

enum llvm::memprof::AllocationType : uint8_t
strong
Enumerator
None 
NotCold 
Cold 

Definition at line 30 of file MemoryProfileInfo.h.

◆ Meta

Enumerator
Start 
MIBEntryDef 
Size 

Definition at line 18 of file MemProf.h.

Function Documentation

◆ buildCallstackMetadata()

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 44 of file MemoryProfileInfo.cpp.

References llvm::ConstantInt::get(), llvm::ValueAsMetadata::get(), llvm::MDNode::get(), and llvm::Type::getInt64Ty().

Referenced by addCallsiteMetadata(), and createMIBNode().

◆ getAllocType()

AllocationType llvm::memprof::getAllocType ( uint64_t  MaxAccessCount,
uint64_t  MinSize,
uint64_t  MinLifetime 
)

Return the allocation type for a given set of memory profile values.

Definition at line 34 of file MemoryProfileInfo.cpp.

References Cold, MemProfAccessesPerByteColdThreshold, MemProfMinLifetimeColdThreshold, and NotCold.

Referenced by addCallStack().

◆ getMIBAllocType()

AllocationType llvm::memprof::getMIBAllocType ( const MDNode MIB)

Returns the allocation type from an MIB metadata node.

Definition at line 61 of file MemoryProfileInfo.cpp.

References assert(), Cold, llvm::MDNode::getNumOperands(), llvm::MDNode::getOperand(), and NotCold.

Referenced by llvm::memprof::CallStackTrie::addCallStack().

◆ getMIBStackNode()

MDNode * llvm::memprof::getMIBStackNode ( const MDNode MIB)

Returns the stack node from an MIB metadata node.

Definition at line 55 of file MemoryProfileInfo.cpp.

References assert(), llvm::MDNode::getNumOperands(), and llvm::MDNode::getOperand().

Referenced by llvm::memprof::CallStackTrie::addCallStack().

◆ readMemProfSchema()

Expected< MemProfSchema > llvm::memprof::readMemProfSchema ( const unsigned char *&  Buffer)

Definition at line 84 of file MemProf.cpp.

References I, llvm::malformed, Ptr, Size, and support().

Referenced by llvm::IndexedInstrProfReader::readHeader().