LLVM 22.0.0git
llvm::PGOCtxProfContext Class Referencefinal

A node (context) in the loaded contextual profile, suitable for mutation during IPO passes. More...

#include "llvm/ProfileData/PGOCtxProfReader.h"

Inheritance diagram for llvm::PGOCtxProfContext:
[legend]

Public Types

using CallTargetMapTy = std::map<GlobalValue::GUID, PGOCtxProfContext>
using CallsiteMapTy = std::map<uint32_t, CallTargetMapTy>

Public Member Functions

 PGOCtxProfContext (const PGOCtxProfContext &)=delete
PGOCtxProfContextoperator= (const PGOCtxProfContext &)=delete
 PGOCtxProfContext (PGOCtxProfContext &&)=default
PGOCtxProfContextoperator= (PGOCtxProfContext &&)=delete
GlobalValue::GUID guid () const
const SmallVectorImpl< uint64_t > & counters () const
SmallVectorImpl< uint64_t > & counters ()
bool isRoot () const
uint64_t getTotalRootEntryCount () const
const CtxProfFlatProfilegetUnhandled () const
uint64_t getEntrycount () const
const CallsiteMapTycallsites () const
CallsiteMapTycallsites ()
void ingestContext (uint32_t CSId, PGOCtxProfContext &&Other)
void ingestAllContexts (uint32_t CSId, CallTargetMapTy &&Other)
void resizeCounters (uint32_t Size)
bool hasCallsite (uint32_t I) const
const CallTargetMapTycallsite (uint32_t I) const
CallTargetMapTycallsite (uint32_t I)
template<class TSetOfGUIDs>
void getContainedGuids (TSetOfGUIDs &Guids) const
 Insert this node's GUID as well as the GUIDs of the transitive closure of child nodes, into the provided set (technically, all that is required of TSetOfGUIDs is to have an insert(GUID) member)

Friends

class PGOCtxProfileReader
class PGOContextualProfile

Detailed Description

A node (context) in the loaded contextual profile, suitable for mutation during IPO passes.

We generally expect a fraction of counters and callsites to be populated. We continue to model counters as vectors, but callsites are modeled as a map of a map. The expectation is that, typically, there is a small number of indirect targets (usually, 1 for direct calls); but potentially a large number of callsites, and, as inlining progresses, the callsite count of a caller will grow.

Definition at line 91 of file PGOCtxProfReader.h.

Member Typedef Documentation

◆ CallsiteMapTy

◆ CallTargetMapTy

Constructor & Destructor Documentation

◆ PGOCtxProfContext() [1/2]

llvm::PGOCtxProfContext::PGOCtxProfContext ( const PGOCtxProfContext & )
delete

◆ PGOCtxProfContext() [2/2]

llvm::PGOCtxProfContext::PGOCtxProfContext ( PGOCtxProfContext && )
default

Member Function Documentation

◆ callsite() [1/2]

CallTargetMapTy & llvm::PGOCtxProfContext::callsite ( uint32_t I)
inline

Definition at line 170 of file PGOCtxProfReader.h.

References assert(), hasCallsite(), and I.

◆ callsite() [2/2]

const CallTargetMapTy & llvm::PGOCtxProfContext::callsite ( uint32_t I) const
inline

Definition at line 165 of file PGOCtxProfReader.h.

References assert(), hasCallsite(), and I.

◆ callsites() [1/2]

CallsiteMapTy & llvm::PGOCtxProfContext::callsites ( )
inline

Definition at line 146 of file PGOCtxProfReader.h.

◆ callsites() [2/2]

const CallsiteMapTy & llvm::PGOCtxProfContext::callsites ( ) const
inline

Definition at line 145 of file PGOCtxProfReader.h.

Referenced by ingestAllContexts(), and ingestContext().

◆ counters() [1/2]

SmallVectorImpl< uint64_t > & llvm::PGOCtxProfContext::counters ( )
inline

Definition at line 131 of file PGOCtxProfReader.h.

◆ counters() [2/2]

const SmallVectorImpl< uint64_t > & llvm::PGOCtxProfContext::counters ( ) const
inline

Definition at line 130 of file PGOCtxProfReader.h.

◆ getContainedGuids()

template<class TSetOfGUIDs>
void llvm::PGOCtxProfContext::getContainedGuids ( TSetOfGUIDs & Guids) const
inline

Insert this node's GUID as well as the GUIDs of the transitive closure of child nodes, into the provided set (technically, all that is required of TSetOfGUIDs is to have an insert(GUID) member)

Definition at line 179 of file PGOCtxProfReader.h.

References _.

◆ getEntrycount()

uint64_t llvm::PGOCtxProfContext::getEntrycount ( ) const
inline

Definition at line 138 of file PGOCtxProfReader.h.

References assert().

◆ getTotalRootEntryCount()

uint64_t llvm::PGOCtxProfContext::getTotalRootEntryCount ( ) const
inline

Definition at line 134 of file PGOCtxProfReader.h.

◆ getUnhandled()

const CtxProfFlatProfile & llvm::PGOCtxProfContext::getUnhandled ( ) const
inline

Definition at line 136 of file PGOCtxProfReader.h.

◆ guid()

GlobalValue::GUID llvm::PGOCtxProfContext::guid ( ) const
inline

Definition at line 129 of file PGOCtxProfReader.h.

◆ hasCallsite()

bool llvm::PGOCtxProfContext::hasCallsite ( uint32_t I) const
inline

Definition at line 161 of file PGOCtxProfReader.h.

References I.

Referenced by callsite(), and callsite().

◆ ingestAllContexts()

void llvm::PGOCtxProfContext::ingestAllContexts ( uint32_t CSId,
CallTargetMapTy && Other )
inline

Definition at line 152 of file PGOCtxProfReader.h.

References _, assert(), callsites(), and llvm::Other.

◆ ingestContext()

void llvm::PGOCtxProfContext::ingestContext ( uint32_t CSId,
PGOCtxProfContext && Other )
inline

Definition at line 148 of file PGOCtxProfReader.h.

References callsites(), and llvm::Other.

◆ isRoot()

bool llvm::PGOCtxProfContext::isRoot ( ) const
inline

Definition at line 133 of file PGOCtxProfReader.h.

◆ operator=() [1/2]

PGOCtxProfContext & llvm::PGOCtxProfContext::operator= ( const PGOCtxProfContext & )
delete

◆ operator=() [2/2]

PGOCtxProfContext & llvm::PGOCtxProfContext::operator= ( PGOCtxProfContext && )
delete

◆ resizeCounters()

void llvm::PGOCtxProfContext::resizeCounters ( uint32_t Size)
inline

Definition at line 159 of file PGOCtxProfReader.h.

References Size.

◆ PGOContextualProfile

friend class PGOContextualProfile
friend

Definition at line 98 of file PGOCtxProfReader.h.

References PGOContextualProfile.

Referenced by PGOContextualProfile.

◆ PGOCtxProfileReader

friend class PGOCtxProfileReader
friend

Definition at line 97 of file PGOCtxProfReader.h.

References PGOCtxProfileReader.

Referenced by PGOCtxProfileReader.


The documentation for this class was generated from the following files: