LLVM
8.0.1
|
Profiling information for a single function. More...
#include "llvm/ProfileData/InstrProf.h"
Public Member Functions | |
InstrProfRecord ()=default | |
InstrProfRecord (std::vector< uint64_t > Counts) | |
InstrProfRecord (InstrProfRecord &&)=default | |
InstrProfRecord (const InstrProfRecord &RHS) | |
InstrProfRecord & | operator= (InstrProfRecord &&)=default |
InstrProfRecord & | operator= (const InstrProfRecord &RHS) |
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=nullptr) 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, InstrProfSymtab *SymTab) |
Add ValueData for ValueKind at value Site. More... | |
void | merge (InstrProfRecord &Other, uint64_t Weight, function_ref< void(instrprof_error)> Warn) |
Merge the counts in Other into this one. More... | |
void | scale (uint64_t Weight, function_ref< void(instrprof_error)> Warn) |
Scale up profile counts (including value profile data) by Weight . More... | |
void | sortValueData () |
Sort value profile data (per site) by count. More... | |
void | Clear () |
Clear value data entries and edge counters. More... | |
void | clearValueData () |
Clear value data entries. More... | |
Public Attributes | |
std::vector< uint64_t > | Counts |
Profiling information for a single function.
Definition at line 622 of file InstrProf.h.
|
default |
|
inline |
Definition at line 626 of file InstrProf.h.
|
default |
|
inline |
Definition at line 628 of file InstrProf.h.
void llvm::InstrProfRecord::addValueData | ( | uint32_t | ValueKind, |
uint32_t | Site, | ||
InstrProfValueData * | VData, | ||
uint32_t | N, | ||
InstrProfSymtab * | SymTab | ||
) |
Add ValueData for ValueKind at value Site.
Definition at line 589 of file InstrProf.cpp.
Referenced by llvm::TextInstrProfReader::readHeader().
|
inline |
Clear value data entries and edge counters.
Definition at line 699 of file InstrProf.h.
Referenced by llvm::TextInstrProfReader::readNextRecord().
|
inline |
Clear value data entries.
Definition at line 705 of file InstrProf.h.
References llvm_unreachable, llvm::makeMutableArrayRef(), and llvm::None.
Return the total number of ValueData for ValueKind.
Definition at line 784 of file InstrProf.h.
References N.
|
inline |
Return the number of value data collected for ValueKind at profiling site: Site.
Definition at line 795 of file InstrProf.h.
Referenced by llvm::annotateValueSite(), and llvm::InstrProfWriter::writeRecordInText().
|
inline |
Return the number of value profile kinds with non-zero number of profile sites.
Definition at line 777 of file InstrProf.h.
References llvm::empty(), and Kind.
Referenced by llvm::InstrProfWriter::writeRecordInText().
Return the number of instrumented sites for ValueKind.
Definition at line 791 of file InstrProf.h.
Referenced by llvm::InstrProfValueSiteRecord::scale(), and llvm::InstrProfWriter::writeRecordInText().
|
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 801 of file InstrProf.h.
References llvm::NVPTXISD::Dummy, and N.
Referenced by llvm::annotateValueSite(), and llvm::InstrProfWriter::writeRecordInText().
|
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 817 of file InstrProf.h.
References I, and llvm::SaturatingAdd().
void llvm::InstrProfRecord::merge | ( | InstrProfRecord & | Other, |
uint64_t | Weight, | ||
function_ref< void(instrprof_error)> | Warn | ||
) |
Merge the counts in Other
into this one.
Optionally scale merged counts by Weight
.
Definition at line 537 of file InstrProf.cpp.
References llvm::count_mismatch, llvm::counter_overflow, Counts, E, I, Kind, and llvm::SaturatingMultiplyAdd().
Referenced by llvm::InstrProfWriter::addRecord().
|
default |
|
inline |
Reserve space for NumValueSites sites.
Definition at line 831 of file InstrProf.h.
Referenced by llvm::TextInstrProfReader::readHeader().
void llvm::InstrProfRecord::scale | ( | uint64_t | Weight, |
function_ref< void(instrprof_error)> | Warn | ||
) |
Scale up profile counts (including value profile data) by Weight
.
Definition at line 565 of file InstrProf.cpp.
References llvm::counter_overflow, llvm::InstrProfSymtab::getFunctionHashFromAddress(), Kind, and llvm::SaturatingMultiply().
Referenced by llvm::InstrProfWriter::addRecord().
|
inline |
Sort value profile data (per site) by count.
Definition at line 692 of file InstrProf.h.
References Kind.
Referenced by llvm::InstrProfWriter::addRecord().
std::vector<uint64_t> llvm::InstrProfRecord::Counts |
Definition at line 623 of file InstrProf.h.
Referenced by llvm::InstrProfSummaryBuilder::addRecord(), llvm::InstrProfRecordWriterTrait::EmitData(), llvm::InstrProfRecordWriterTrait::EmitKeyDataLength(), merge(), llvm::InstrProfWriter::mergeRecordsFromWriter(), operator=(), llvm::TextInstrProfReader::readNextRecord(), and llvm::InstrProfWriter::writeRecordInText().