LLVM
10.0.0svn
|
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... | |
void | accumulateCounts (CountSumOrPercent &Sum) const |
Compute the sums of all counts and store in Sum. More... | |
void | overlap (InstrProfRecord &Other, OverlapStats &Overlap, OverlapStats &FuncLevelOverlap, uint64_t ValueCutoff) |
Compute the overlap b/w this IntrprofRecord and Other. More... | |
void | overlapValueProfData (uint32_t ValueKind, InstrProfRecord &Src, OverlapStats &Overlap, OverlapStats &FuncLevelOverlap) |
Compute the overlap of value profile counts. More... | |
Public Attributes | |
std::vector< uint64_t > | Counts |
Profiling information for a single function.
Definition at line 685 of file InstrProf.h.
|
default |
|
inline |
Definition at line 689 of file InstrProf.h.
|
default |
|
inline |
Definition at line 691 of file InstrProf.h.
void llvm::InstrProfRecord::accumulateCounts | ( | CountSumOrPercent & | Sum | ) | const |
Compute the sums of all counts and store in Sum.
Definition at line 481 of file InstrProf.cpp.
References llvm::CountSumOrPercent::CountSum, E, F(), I, llvm::CountSumOrPercent::NumEntries, and llvm::CountSumOrPercent::ValueCounts.
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 707 of file InstrProf.cpp.
Referenced by llvm::TextInstrProfReader::readHeader().
|
inline |
Clear value data entries and edge counters.
Definition at line 762 of file InstrProf.h.
Referenced by llvm::TextInstrProfReader::readNextRecord().
|
inline |
Clear value data entries.
Definition at line 768 of file InstrProf.h.
References llvm_unreachable, llvm::makeMutableArrayRef(), and llvm::None.
Return the total number of ValueData for ValueKind.
Definition at line 869 of file InstrProf.h.
References N.
|
inline |
Return the number of value data collected for ValueKind at profiling site: Site.
Definition at line 880 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 862 of file InstrProf.h.
References llvm::empty().
Referenced by llvm::InstrProfWriter::writeRecordInText().
Return the number of instrumented sites for ValueKind.
Definition at line 876 of file InstrProf.h.
Referenced by overlap(), overlapValueProfData(), 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 886 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 902 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 655 of file InstrProf.cpp.
References llvm::count_mismatch, llvm::counter_overflow, Counts, E, I, and llvm::SaturatingMultiplyAdd().
Referenced by llvm::InstrProfWriter::overlapRecord().
|
default |
|
inline |
void llvm::InstrProfRecord::overlap | ( | InstrProfRecord & | Other, |
OverlapStats & | Overlap, | ||
OverlapStats & | FuncLevelOverlap, | ||
uint64_t | ValueCutoff | ||
) |
Compute the overlap b/w this IntrprofRecord and Other.
Definition at line 550 of file InstrProf.cpp.
References llvm::OverlapStats::addOneMismatch(), assert(), llvm::OverlapStats::Base, Counts, llvm::CountSumOrPercent::CountSum, E, getNumValueSites(), I, llvm::max(), llvm::CountSumOrPercent::NumEntries, llvm::OverlapStats::Overlap, llvm::OverlapStats::score(), llvm::OverlapStats::Test, and llvm::OverlapStats::Valid.
Referenced by llvm::InstrProfWriter::overlapRecord().
void llvm::InstrProfRecord::overlapValueProfData | ( | uint32_t | ValueKind, |
InstrProfRecord & | Src, | ||
OverlapStats & | Overlap, | ||
OverlapStats & | FuncLevelOverlap | ||
) |
Compute the overlap of value profile counts.
Definition at line 532 of file InstrProf.cpp.
References assert(), getNumValueSites(), and I.
Reserve space for NumValueSites sites.
Definition at line 916 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 683 of file InstrProf.cpp.
References llvm::counter_overflow, llvm::InstrProfSymtab::getFunctionHashFromAddress(), and llvm::SaturatingMultiply().
Referenced by llvm::InstrProfWriter::overlapRecord().
|
inline |
Sort value profile data (per site) by count.
Definition at line 755 of file InstrProf.h.
Referenced by llvm::InstrProfWriter::overlapRecord().
std::vector<uint64_t> llvm::InstrProfRecord::Counts |
Definition at line 686 of file InstrProf.h.
Referenced by llvm::InstrProfSummaryBuilder::addRecord(), llvm::InstrProfRecordWriterTrait::EmitData(), llvm::InstrProfRecordWriterTrait::EmitKeyDataLength(), merge(), llvm::InstrProfWriter::mergeRecordsFromWriter(), operator=(), overlap(), llvm::TextInstrProfReader::readNextRecord(), and llvm::InstrProfWriter::writeRecordInText().