LLVM 20.0.0git
|
Namespaces | |
namespace | detail |
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 } |
Variables | |
constexpr uint64_t | MinimumSupportedVersion = Version2 |
constexpr uint64_t | MaximumSupportedVersion = Version3 |
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 104 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 78 of file MemProfiler.h.
using llvm::memprof::MemProfSchema = typedef llvm::SmallVector<Meta, static_cast<int>(Meta::Size)> |
|
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 70 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().
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 | ) |
template llvm::DenseMap< FrameId, FrameStat > llvm::memprof::computeFrameHistogram< FrameId > | ( | llvm::MapVector< CallStackId, llvm::SmallVector< FrameId > > & | MemProfCallStackData | ) |
template llvm::DenseMap< LinearFrameId, FrameStat > llvm::memprof::computeFrameHistogram< LinearFrameId > | ( | llvm::MapVector< CallStackId, llvm::SmallVector< LinearFrameId > > & | MemProfCallStackData | ) |
Referenced by writeMemoryProfileRadixTree().
DenseMap< uint64_t, LocToLocMap > llvm::memprof::computeUndriftMap | ( | Module & | M, |
IndexedInstrProfReader * | MemProfReader, | ||
const TargetLibraryInfo & | TLI | ||
) |
Definition at line 889 of file MemProfiler.cpp.
References A, assert(), B, 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 152 of file MemProf.cpp.
References I, Ptr, and llvm::memprof::PortableMemInfoBlock::serializedSize().
Referenced by llvm::memprof::IndexedMemProfRecord::deserialize().
|
static |
Definition at line 183 of file MemProf.cpp.
References I, Ptr, 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 | ||
) |
Definition at line 831 of file MemProfiler.cpp.
References assert(), llvm::StringRef::empty(), F, llvm::memprof::IndexedMemProfRecord::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 49 of file MemoryProfileInfo.cpp.
References MemProfAveLifetimeColdThreshold, MemProfLifetimeAccessDensityColdThreshold, and MemProfMinAveLifetimeAccessDensityHotThreshold.
Referenced by addCallStack().
std::string llvm::memprof::getAllocTypeAttributeString | ( | AllocationType | Type | ) |
Returns the string to use in attributes with the given type.
Definition at line 103 of file MemoryProfileInfo.cpp.
References assert(), and llvm_unreachable.
Referenced by addAllocTypeAttribute(), llvm::memprof::CallStackTrie::addSingleAllocTypeAttribute(), createMIBNode(), and llvm::MemProfUsePass::run().
MemProfSchema llvm::memprof::getFullSchema | ( | ) |
Definition at line 13 of file MemProf.cpp.
References llvm::List.
Referenced by llvm::memprof::IndexedAllocationInfo::IndexedAllocationInfo(), writeMemProfV2(), and writeMemProfV3().
MemProfSchema llvm::memprof::getHotColdSchema | ( | ) |
Definition at line 21 of file MemProf.cpp.
Referenced by writeMemProfV2(), and writeMemProfV3().
AllocationType llvm::memprof::getMIBAllocType | ( | const MDNode * | MIB | ) |
Returns the allocation type from an MIB metadata node.
Definition at line 88 of file MemoryProfileInfo.cpp.
References assert(), llvm::MDNode::getNumOperands(), and llvm::MDNode::getOperand().
Referenced by llvm::memprof::CallStackTrie::addCallStack(), and computeFunctionSummary().
Returns the stack node from an MIB metadata node.
Definition at line 82 of file MemoryProfileInfo.cpp.
References assert(), llvm::MDNode::getNumOperands(), and llvm::MDNode::getOperand().
Referenced by llvm::memprof::CallStackTrie::addCallStack(), computeFunctionSummary(), and propagateMemProfHelper().
True if the AllocTypes bitmask contains just a single type.
Definition at line 127 of file MemoryProfileInfo.cpp.
References assert(), and llvm::popcount().
Referenced by llvm::memprof::CallStackTrie::buildAndAttachMIBMetadata().
Expected< MemProfSchema > llvm::memprof::readMemProfSchema | ( | const unsigned char *& | Buffer | ) |
Definition at line 267 of file MemProf.cpp.
References I, llvm::malformed, Ptr, Size, and llvm::Tag.
|
static |
Definition at line 26 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 36 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 96 of file MemProf.cpp.
References llvm::little, N, and OS.
Referenced by llvm::memprof::IndexedMemProfRecord::serialize().
|
static |
Definition at line 114 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().
Definition at line 40 of file MemProf.h.
Referenced by llvm::IndexedMemProfReader::deserialize(), llvm::IndexedMemProfReader::getMemProfRecord(), and writeMemProf().
Definition at line 39 of file MemProf.h.
Referenced by llvm::IndexedMemProfReader::deserialize(), llvm::IndexedMemProfReader::getMemProfRecord(), and writeMemProf().