LLVM: llvm::memprof Namespace Reference (original) (raw)

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(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
Enumerations
enum class AnnotationKind : uint8_t { AnnotationOK, DeclForLinker, ExplicitSection, ReservedName }
enum IndexedVersion : uint64_t { Version2 = 2 , Version3 = 3 , Version4 = 4 }
enum class Meta : uint64_t { Start = 0 , MIBEntryDef }
Functions
LLVM_ABI bool metadataIncludesAllContextSizeInfo ()
Whether the alloc memeprof metadata will include context size info for all MIBs.
LLVM_ABI bool metadataMayIncludeContextSizeInfo ()
Whether the alloc memprof metadata may include context size info for some MIBs (but possibly not all).
LLVM_ABI bool recordContextSizeInfoForAnalysis ()
Whether we need to record the context size info in the alloc trie used to build metadata.
LLVM_ABI MDNode * buildCallstackMetadata (ArrayRef< uint64_t > CallStack, LLVMContext &Ctx)
Build callstack metadata from the provided list of call stack ids.
LLVM_ABI MDNode * 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_ABI MDNode * getMIBStackNode (const MDNode *MIB)
Returns the stack node from an MIB metadata node.
LLVM_ABI AllocationType getMIBAllocType (const MDNode *MIB)
Returns the allocation type from an MIB metadata node.
LLVM_ABI std::string getAllocTypeAttributeString (AllocationType Type)
Returns the string to use in attributes with the given type.
LLVM_ABI bool hasSingleAllocType (uint8_t AllocTypes)
True if the AllocTypes bitmask contains just a single type.
LLVM_ABI void removeAnyExistingAmbiguousAttribute (CallBase *CB)
Removes any existing "ambiguous" memprof attribute.
LLVM_ABI void addAmbiguousAttribute (CallBase *CB)
Adds an "ambiguous" memprof attribute to call with a matched allocation profile but that we haven't yet been able to disambiguate.
AnnotationKind getAnnotationKind (const GlobalVariable &GV)
Returns the annotation kind of the global variable GV.
bool IsAnnotationOK (const GlobalVariable &GV)
Returns true if the annotation kind of the global variable GV is AnnotationOK.
llvm::StringRef getMemprofOptionsSymbolDarwinLinkageName ()
llvm::StringRef getMemprofOptionsSymbolName ()
LLVM_ABI MemProfSchema getFullSchema ()
LLVM_ABI MemProfSchema getHotColdSchema ()
LLVM_ABI GlobalValue::GUID getGUID (const StringRef FunctionName)
LLVM_ABI Expected< MemProfSchema > readMemProfSchema (const unsigned char *&Buffer)
LLVM_ABI AllocationType getAllocType (uint64_t TotalLifetimeAccessDensity, uint64_t AllocCount, uint64_t TotalLifetime)
Return the allocation type for a given set of memory profile values.
LLVM_ABI uint64_t computeFullStackId (ArrayRef< Frame > CallStack)
Helper to generate a single hash id for a given callstack, used for emitting matching statistics and useful for uniquing such statistics across modules.
template
llvm::DenseMap< FrameIdTy, FrameStat > computeFrameHistogram (llvm::MapVector< CallStackId, llvm::SmallVector< FrameIdTy > > &MemProfCallStackData)
LLVM_ABI DenseMap< uint64_t, SmallVector< CallEdgeTy, 0 > > extractCallsFromIR (Module &M, const TargetLibraryInfo &TLI, function_ref< bool(uint64_t)> IsPresentInProfile=[](uint64_t) { return true;})
LLVM_ABI DenseMap< uint64_t, LocToLocMap > computeUndriftMap (Module &M, IndexedInstrProfReader *MemProfReader, const TargetLibraryInfo &TLI)
static bool hasExplicitSectionName (const GlobalVariable &GVar)
static std::pair< StringRef, uint64_t > saveStringToMap (DataAccessProfData::StringToIndexMap &Map, llvm::UniqueStringSaver &Saver, StringRef Str)
static Expected< StringRef > getCanonicalName (StringRef Name)
static size_t serializedSizeV2 (const IndexedAllocationInfo &IAI, const MemProfSchema &Schema)
static size_t serializedSizeV3 (const IndexedAllocationInfo &IAI, const MemProfSchema &Schema)
static size_t serializedSizeV2 (const IndexedMemProfRecord &Record, const MemProfSchema &Schema)
static size_t serializedSizeV3 (const IndexedMemProfRecord &Record, const MemProfSchema &Schema)
static size_t serializedSizeV4 (const IndexedMemProfRecord &Record, const MemProfSchema &Schema)
static void serializeV2 (const IndexedMemProfRecord &Record, const MemProfSchema &Schema, raw_ostream &OS)
static void serializeV3 (const IndexedMemProfRecord &Record, const MemProfSchema &Schema, raw_ostream &OS, llvm::DenseMap< CallStackId, LinearCallStackId > &MemProfCallStackIndexes)
static void serializeV4 (const IndexedMemProfRecord &Record, const MemProfSchema &Schema, raw_ostream &OS, llvm::DenseMap< CallStackId, LinearCallStackId > &MemProfCallStackIndexes)
static IndexedMemProfRecord deserializeV2 (const MemProfSchema &Schema, const unsigned char *Ptr)
static IndexedMemProfRecord deserializeV3 (const MemProfSchema &Schema, const unsigned char *Ptr)
static IndexedMemProfRecord deserializeV4 (const MemProfSchema &Schema, const unsigned char *Ptr)
template LLVM_ABI llvm::DenseMap< FrameId, FrameStat > computeFrameHistogram< FrameId > (llvm::MapVector< CallStackId, llvm::SmallVector< FrameId > > &MemProfCallStackData)
template LLVM_ABI llvm::DenseMap< LinearFrameId, FrameStat > computeFrameHistogram< LinearFrameId > (llvm::MapVector< CallStackId, llvm::SmallVector< LinearFrameId > > &MemProfCallStackData)

CallEdgeTy

CallStackId

CallStackMap

FrameId

LinearCallStackId

LinearFrameId

LocToLocMap

Initial value:

std::unordered_map<LineLocation, LineLocation, LineLocationHash>

Definition at line 65 of file MemProfUse.h.

MemProfSchema

SymbolHandle

SymbolHandleRef

AnnotationKind

IndexedVersion

Enumerator
Version2
Version3
Version4

Definition at line 42 of file MemProf.h.

Meta

Enumerator
Start
MIBEntryDef

Definition at line 68 of file MemProf.h.

addAmbiguousAttribute()

void llvm::memprof::addAmbiguousAttribute ( CallBase * CB )

buildCallstackMetadata()

buildContextSizeMetadata()

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

References LLVM_ABI.

computeFrameHistogram()

computeFrameHistogram< FrameId >()

computeFrameHistogram< LinearFrameId >()

computeFullStackId()

computeUndriftMap()

Definition at line 311 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(), llvm::longestCommonSequence(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::try_emplace().

Referenced by llvm::MemProfUsePass::run().

deserializeV2()

deserializeV3()

deserializeV4()

extractCallsFromIR()

getAllocType()

getAllocTypeAttributeString()

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

getAnnotationKind()

getCanonicalName()

getFullSchema()

MemProfSchema llvm::memprof::getFullSchema ( )

getGUID()

getHotColdSchema()

MemProfSchema llvm::memprof::getHotColdSchema ( )

getMemprofOptionsSymbolDarwinLinkageName()

llvm::StringRef llvm::memprof::getMemprofOptionsSymbolDarwinLinkageName ( ) inline

getMemprofOptionsSymbolName()

getMIBAllocType()

getMIBStackNode()

hasExplicitSectionName()

hasSingleAllocType()

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

IsAnnotationOK()

metadataIncludesAllContextSizeInfo()

bool llvm::memprof::metadataIncludesAllContextSizeInfo ( )

metadataMayIncludeContextSizeInfo()

bool llvm::memprof::metadataMayIncludeContextSizeInfo ( )

readMemProfSchema()

recordContextSizeInfoForAnalysis()

bool llvm::memprof::recordContextSizeInfoForAnalysis ( )

removeAnyExistingAmbiguousAttribute()

void llvm::memprof::removeAnyExistingAmbiguousAttribute ( CallBase * CB )

saveStringToMap()

serializedSizeV2() [1/2]

serializedSizeV2() [2/2]

serializedSizeV3() [1/2]

serializedSizeV3() [2/2]

serializedSizeV4()

serializeV2()

serializeV3()

serializeV4()

CallStackRadixTreeBuilder< FrameId >

CallStackRadixTreeBuilder< LinearFrameId >

MaximumSupportedVersion

uint64_t llvm::memprof::MaximumSupportedVersion = Version4 constexpr

MinimumSupportedVersion

uint64_t llvm::memprof::MinimumSupportedVersion = Version2 constexpr