LLVM 23.0.0git
llvm::NamedInstrProfRecord Struct Reference

#include "llvm/ProfileData/InstrProf.h"

Inheritance diagram for llvm::NamedInstrProfRecord:
[legend]

Public Member Functions

 NamedInstrProfRecord ()=default
 NamedInstrProfRecord (StringRef Name, uint64_t Hash, std::vector< uint64_t > Counts)
 NamedInstrProfRecord (StringRef Name, uint64_t Hash, std::vector< uint64_t > Counts, std::vector< uint8_t > BitmapBytes)
 NamedInstrProfRecord (StringRef Name, uint64_t Hash, std::vector< uint64_t > Counts, std::vector< uint8_t > BitmapBytes, std::vector< uint8_t > UniformityBits)
Public Member Functions inherited from llvm::InstrProfRecord
 InstrProfRecord ()=default
 InstrProfRecord (std::vector< uint64_t > Counts)
 InstrProfRecord (std::vector< uint64_t > Counts, std::vector< uint8_t > BitmapBytes)
 InstrProfRecord (InstrProfRecord &&)=default
 InstrProfRecord (const InstrProfRecord &RHS)
InstrProfRecordoperator= (InstrProfRecord &&)=default
InstrProfRecordoperator= (const InstrProfRecord &RHS)
bool isBlockUniform (unsigned BlockIdx) const
 Check if a basic block is entered via a wave-uniform branch.
LLVM_ABI void computeBlockUniformity ()
 Recompute uniformity metadata from raw uniform counters, when present.
uint32_t getNumValueKinds () const
 Return the number of value profile kinds with non-zero number of profile sites.
uint32_t getNumValueSites (uint32_t ValueKind) const
 Return the number of instrumented sites for ValueKind.
uint32_t getNumValueData (uint32_t ValueKind) const
 Return the total number of ValueData for ValueKind.
ArrayRef< InstrProfValueData > getValueArrayForSite (uint32_t ValueKind, uint32_t Site) const
 Return the array of profiled values at Site.
void reserveSites (uint32_t ValueKind, uint32_t NumValueSites)
 Reserve space for NumValueSites sites.
LLVM_ABI void addValueData (uint32_t ValueKind, uint32_t Site, ArrayRef< InstrProfValueData > VData, InstrProfSymtab *SymTab)
 Add ValueData for ValueKind at value Site.
LLVM_ABI void merge (InstrProfRecord &Other, uint64_t Weight, function_ref< void(instrprof_error)> Warn)
 Merge the counts in Other into this one.
LLVM_ABI void scale (uint64_t N, uint64_t D, function_ref< void(instrprof_error)> Warn)
 Scale up profile counts (including value profile data) by a factor of (N / D).
void sortValueData ()
 Sort value profile data (per site) by count.
void Clear ()
 Clear value data entries, edge counters, and uniformity data.
void clearValueData ()
 Clear value data entries.
LLVM_ABI void accumulateCounts (CountSumOrPercent &Sum) const
 Compute the sums of all counts and store in Sum.
LLVM_ABI void overlap (InstrProfRecord &Other, OverlapStats &Overlap, OverlapStats &FuncLevelOverlap, uint64_t ValueCutoff)
 Compute the overlap b/w this IntrprofRecord and Other.
LLVM_ABI void overlapValueProfData (uint32_t ValueKind, InstrProfRecord &Src, OverlapStats &Overlap, OverlapStats &FuncLevelOverlap)
 Compute the overlap of value profile counts.
CountPseudoKind getCountPseudoKind () const
void setPseudoCount (CountPseudoKind Kind)

Static Public Member Functions

static bool hasCSFlagInHash (uint64_t FuncHash)
static void setCSFlagInHash (uint64_t &FuncHash)

Public Attributes

StringRef Name
uint64_t Hash
Public Attributes inherited from llvm::InstrProfRecord
std::vector< uint64_tCounts
std::vector< uint8_tBitmapBytes
std::vector< uint64_tUniformCounts
 For AMDGPU offload profiling: raw or merged uniform counters.
std::vector< uint8_tUniformityBits
 For AMDGPU offload profiling: 1 bit per basic block indicating whether the block is usually entered with all lanes active.
uint16_t OffloadDeviceWaveSize = 0

Static Public Attributes

static constexpr uint64_t FUNC_HASH_MASK = 0x0FFF'FFFF'FFFF'FFFF
static constexpr unsigned CS_FLAG_IN_FUNC_HASH = 60

Additional Inherited Members

Public Types inherited from llvm::InstrProfRecord
enum  CountPseudoKind { NotPseudo = 0 , PseudoHot , PseudoWarm }
enum  PseudoCountVal { HotFunctionVal = -1 , WarmFunctionVal = -2 }

Detailed Description

Definition at line 1098 of file InstrProf.h.

Constructor & Destructor Documentation

◆ NamedInstrProfRecord() [1/4]

llvm::NamedInstrProfRecord::NamedInstrProfRecord ( )
default

◆ NamedInstrProfRecord() [2/4]

llvm::NamedInstrProfRecord::NamedInstrProfRecord ( StringRef Name,
uint64_t Hash,
std::vector< uint64_t > Counts )
inline

◆ NamedInstrProfRecord() [3/4]

llvm::NamedInstrProfRecord::NamedInstrProfRecord ( StringRef Name,
uint64_t Hash,
std::vector< uint64_t > Counts,
std::vector< uint8_t > BitmapBytes )
inline

◆ NamedInstrProfRecord() [4/4]

llvm::NamedInstrProfRecord::NamedInstrProfRecord ( StringRef Name,
uint64_t Hash,
std::vector< uint64_t > Counts,
std::vector< uint8_t > BitmapBytes,
std::vector< uint8_t > UniformityBits )
inline

Member Function Documentation

◆ hasCSFlagInHash()

bool llvm::NamedInstrProfRecord::hasCSFlagInHash ( uint64_t FuncHash)
inlinestatic

◆ setCSFlagInHash()

void llvm::NamedInstrProfRecord::setCSFlagInHash ( uint64_t & FuncHash)
inlinestatic

Definition at line 1128 of file InstrProf.h.

References CS_FLAG_IN_FUNC_HASH, and llvm::FuncHash.

Member Data Documentation

◆ CS_FLAG_IN_FUNC_HASH

unsigned llvm::NamedInstrProfRecord::CS_FLAG_IN_FUNC_HASH = 60
staticconstexpr

Definition at line 1105 of file InstrProf.h.

Referenced by hasCSFlagInHash(), and setCSFlagInHash().

◆ FUNC_HASH_MASK

uint64_t llvm::NamedInstrProfRecord::FUNC_HASH_MASK = 0x0FFF'FFFF'FFFF'FFFF
staticconstexpr

Definition at line 1103 of file InstrProf.h.

◆ Hash

uint64_t llvm::NamedInstrProfRecord::Hash

Definition at line 1100 of file InstrProf.h.

Referenced by NamedInstrProfRecord(), NamedInstrProfRecord(), and NamedInstrProfRecord().

◆ Name

StringRef llvm::NamedInstrProfRecord::Name

Definition at line 1099 of file InstrProf.h.

Referenced by NamedInstrProfRecord(), NamedInstrProfRecord(), and NamedInstrProfRecord().


The documentation for this struct was generated from the following file: