LLVM 20.0.0git
Public Types | Public Member Functions | Friends | List of all members
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:
Inheritance graph
[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 ()
 
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 84 of file PGOCtxProfReader.h.

Member Typedef Documentation

◆ CallsiteMapTy

Definition at line 87 of file PGOCtxProfReader.h.

◆ CallTargetMapTy

Definition at line 86 of file PGOCtxProfReader.h.

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 150 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 145 of file PGOCtxProfReader.h.

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

◆ callsites() [1/2]

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

Definition at line 126 of file PGOCtxProfReader.h.

◆ callsites() [2/2]

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

◆ counters() [1/2]

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

Definition at line 116 of file PGOCtxProfReader.h.

References llvm::Counters.

◆ counters() [2/2]

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

Definition at line 115 of file PGOCtxProfReader.h.

References llvm::Counters.

Referenced by llvm::PGOContextualProfile::flatten().

◆ 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 159 of file PGOCtxProfReader.h.

References _.

◆ getEntrycount()

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

Definition at line 118 of file PGOCtxProfReader.h.

References assert(), and llvm::Counters.

◆ guid()

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

Definition at line 114 of file PGOCtxProfReader.h.

Referenced by llvm::PGOContextualProfile::flatten().

◆ hasCallsite()

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

Definition at line 141 of file PGOCtxProfReader.h.

References I.

Referenced by callsite().

◆ ingestAllContexts()

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

Definition at line 132 of file PGOCtxProfReader.h.

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

◆ ingestContext()

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

Definition at line 128 of file PGOCtxProfReader.h.

References callsites(), and llvm::Other.

◆ 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 139 of file PGOCtxProfReader.h.

References llvm::Counters, and Size.

Friends And Related Function Documentation

◆ PGOContextualProfile

friend class PGOContextualProfile
friend

Definition at line 91 of file PGOCtxProfReader.h.

◆ PGOCtxProfileReader

friend class PGOCtxProfileReader
friend

Definition at line 90 of file PGOCtxProfReader.h.


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