LLVM  4.0.0
Public Types | Public Member Functions | Public Attributes | List of all members
llvm::InstrProfRecord Struct Reference

Profiling information for a single function. More...

#include <InstrProf.h>

Collaboration diagram for llvm::InstrProfRecord:
[legend]

Public Types

typedef std::vector< std::pair
< uint64_t, uint64_t > > 
ValueMapType
 

Public Member Functions

 InstrProfRecord ()
 
 InstrProfRecord (StringRef Name, uint64_t Hash, std::vector< uint64_t > Counts)
 
uint32_t getNumValueKinds () const
 Return the number of value profile kinds with non-zero number of profile sites. More...
 
uint32_t getNumValueSites (uint32_t ValueKind) const
 Return the number of instrumented sites for ValueKind. More...
 
uint32_t getNumValueData (uint32_t ValueKind) const
 Return the total number of ValueData for ValueKind. More...
 
uint32_t getNumValueDataForSite (uint32_t ValueKind, uint32_t Site) const
 Return the number of value data collected for ValueKind at profiling site: Site. More...
 
std::unique_ptr
< InstrProfValueData[]> 
getValueForSite (uint32_t ValueKind, uint32_t Site, uint64_t *TotalC=0) const
 Return the array of profiled values at Site. More...
 
uint64_t getValueForSite (InstrProfValueData Dest[], uint32_t ValueKind, uint32_t Site) const
 Get the target value/counts of kind ValueKind collected at site Site and store the result in array Dest. More...
 
void reserveSites (uint32_t ValueKind, uint32_t NumValueSites)
 Reserve space for NumValueSites sites. More...
 
void addValueData (uint32_t ValueKind, uint32_t Site, InstrProfValueData *VData, uint32_t N, ValueMapType *ValueMap)
 Add ValueData for ValueKind at value Site. More...
 
void merge (InstrProfRecord &Other, uint64_t Weight=1)
 Merge the counts in Other into this one. More...
 
void scale (uint64_t Weight)
 Scale up profile counts (including value profile data) by Weight. More...
 
void sortValueData ()
 Sort value profile data (per site) by count. More...
 
void clearValueData ()
 Clear value data entries. More...
 
Error takeError ()
 Get the error contained within the record's soft error counter. More...
 

Public Attributes

StringRef Name
 
uint64_t Hash
 
std::vector< uint64_t > Counts
 
SoftInstrProfErrors SIPE
 

Detailed Description

Profiling information for a single function.

Definition at line 581 of file InstrProf.h.

Member Typedef Documentation

typedef std::vector<std::pair<uint64_t, uint64_t> > llvm::InstrProfRecord::ValueMapType

Definition at line 590 of file InstrProf.h.

Constructor & Destructor Documentation

llvm::InstrProfRecord::InstrProfRecord ( )
inline

Definition at line 582 of file InstrProf.h.

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

Definition at line 583 of file InstrProf.h.

Member Function Documentation

void llvm::InstrProfRecord::addValueData ( uint32_t  ValueKind,
uint32_t  Site,
InstrProfValueData *  VData,
uint32_t  N,
ValueMapType ValueMap 
)

Add ValueData for ValueKind at value Site.

Definition at line 458 of file InstrProf.cpp.

References I, and N.

void llvm::InstrProfRecord::clearValueData ( )
inline

Clear value data entries.

Definition at line 639 of file InstrProf.h.

References Kind.

uint32_t llvm::InstrProfRecord::getNumValueData ( uint32_t  ValueKind) const
inline

Return the total number of ValueData for ValueKind.

Definition at line 686 of file InstrProf.h.

References N.

uint32_t llvm::InstrProfRecord::getNumValueDataForSite ( uint32_t  ValueKind,
uint32_t  Site 
) const
inline

Return the number of value data collected for ValueKind at profiling site: Site.

Definition at line 700 of file InstrProf.h.

Referenced by llvm::annotateValueSite(), getValueForSite(), and llvm::InstrProfWriter::writeRecordInText().

uint32_t llvm::InstrProfRecord::getNumValueKinds ( ) const
inline

Return the number of value profile kinds with non-zero number of profile sites.

Definition at line 679 of file InstrProf.h.

References Kind.

Referenced by llvm::InstrProfWriter::writeRecordInText().

uint32_t llvm::InstrProfRecord::getNumValueSites ( uint32_t  ValueKind) const
inline

Return the number of instrumented sites for ValueKind.

Definition at line 696 of file InstrProf.h.

Referenced by llvm::InstrProfWriter::writeRecordInText().

std::unique_ptr< InstrProfValueData[]> llvm::InstrProfRecord::getValueForSite ( uint32_t  ValueKind,
uint32_t  Site,
uint64_t *  TotalC = 0 
) const
inline

Return the array of profiled values at Site.

If TotalC is not null, the total count of all target values at this site will be stored in *TotalC.

Definition at line 706 of file InstrProf.h.

References llvm::NVPTXISD::Dummy, getNumValueDataForSite(), and N.

Referenced by llvm::annotateValueSite(), and llvm::InstrProfWriter::writeRecordInText().

uint64_t llvm::InstrProfRecord::getValueForSite ( InstrProfValueData  Dest[],
uint32_t  ValueKind,
uint32_t  Site 
) const
inline

Get the target value/counts of kind ValueKind collected at site Site and store the result in array Dest.

Return the total counts of all target values at this site.

Definition at line 722 of file InstrProf.h.

References I, and llvm::SaturatingAdd().

void llvm::InstrProfRecord::merge ( InstrProfRecord Other,
uint64_t  Weight = 1 
)

Merge the counts in Other into this one.

Optionally scale merged counts by Weight.

Definition at line 394 of file InstrProf.cpp.

References llvm::SoftInstrProfErrors::addError(), llvm::count_mismatch, llvm::counter_overflow, Counts, E, I, Kind, llvm::SaturatingMultiplyAdd(), and SIPE.

Referenced by llvm::InstrProfWriter::addRecord().

void llvm::InstrProfRecord::reserveSites ( uint32_t  ValueKind,
uint32_t  NumValueSites 
)
inline

Reserve space for NumValueSites sites.

Definition at line 736 of file InstrProf.h.

void llvm::InstrProfRecord::scale ( uint64_t  Weight)

Scale up profile counts (including value profile data) by Weight.

Definition at line 422 of file InstrProf.cpp.

References llvm::SoftInstrProfErrors::addError(), llvm::counter_overflow, Counts, Kind, llvm::SaturatingMultiply(), and SIPE.

Referenced by llvm::InstrProfWriter::addRecord().

void llvm::InstrProfRecord::sortValueData ( )
inline

Sort value profile data (per site) by count.

Definition at line 630 of file InstrProf.h.

References Kind.

Referenced by llvm::InstrProfWriter::addRecord().

Error llvm::InstrProfRecord::takeError ( )
inline

Get the error contained within the record's soft error counter.

Definition at line 645 of file InstrProf.h.

References SIPE, and llvm::SoftInstrProfErrors::takeError().

Referenced by llvm::InstrProfWriter::addRecord().

Member Data Documentation

std::vector<uint64_t> llvm::InstrProfRecord::Counts
uint64_t llvm::InstrProfRecord::Hash
StringRef llvm::InstrProfRecord::Name
SoftInstrProfErrors llvm::InstrProfRecord::SIPE

Definition at line 588 of file InstrProf.h.

Referenced by merge(), scale(), and takeError().


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