|
LLVM
10.0.0
|
#include "llvm/ProfileData/InstrProfWriter.h"
Public Types | |
| enum | ProfKind { PF_Unknown = 0, PF_FE, PF_IRLevel, PF_IRLevelWithCS } |
| using | ProfilingData = SmallDenseMap< uint64_t, InstrProfRecord > |
Public Member Functions | |
| InstrProfWriter (bool Sparse=false) | |
| ~InstrProfWriter () | |
| void | addRecord (NamedInstrProfRecord &&I, uint64_t Weight, function_ref< void(Error)> Warn) |
| Add function counts for the given function. More... | |
| void | addRecord (NamedInstrProfRecord &&I, function_ref< void(Error)> Warn) |
| void | mergeRecordsFromWriter (InstrProfWriter &&IPW, function_ref< void(Error)> Warn) |
| Merge existing function counts from the given writer. More... | |
| void | write (raw_fd_ostream &OS) |
Write the profile to OS. More... | |
| Error | writeText (raw_fd_ostream &OS) |
Write the profile in text format to OS. More... | |
| std::unique_ptr< MemoryBuffer > | writeBuffer () |
| Write the profile, returning the raw data. For testing. More... | |
| Error | setIsIRLevelProfile (bool IsIRLevel, bool WithCS) |
| Set the ProfileKind. More... | |
| void | setValueProfDataEndianness (support::endianness Endianness) |
| void | setOutputSparse (bool Sparse) |
| void | overlapRecord (NamedInstrProfRecord &&Other, OverlapStats &Overlap, OverlapStats &FuncLevelOverlap, const OverlapFuncFilters &FuncFilter) |
Static Public Member Functions | |
| static void | writeRecordInText (StringRef Name, uint64_t Hash, const InstrProfRecord &Counters, InstrProfSymtab &Symtab, raw_fd_ostream &OS) |
Write Record in text format to OS. More... | |
Definition at line 33 of file InstrProfWriter.h.
| using llvm::InstrProfWriter::ProfilingData = SmallDenseMap<uint64_t, InstrProfRecord> |
Definition at line 35 of file InstrProfWriter.h.
| Enumerator | |
|---|---|
| PF_Unknown | |
| PF_FE | |
| PF_IRLevel | |
| PF_IRLevelWithCS | |
Definition at line 37 of file InstrProfWriter.h.
Definition at line 168 of file InstrProfWriter.cpp.
| InstrProfWriter::~InstrProfWriter | ( | ) |
Definition at line 171 of file InstrProfWriter.cpp.
| void InstrProfWriter::addRecord | ( | NamedInstrProfRecord && | I, |
| uint64_t | Weight, | ||
| function_ref< void(Error)> | Warn | ||
| ) |
Add function counts for the given function.
If there are already counts for this function and the hash and number of counts match, each counter is summed. Optionally scale counts by Weight.
Definition at line 183 of file InstrProfWriter.cpp.
Referenced by addRecord(), mergeRecordsFromWriter(), overlapRecord(), and setIsIRLevelProfile().
|
inline |
Definition at line 55 of file InstrProfWriter.h.
References addRecord(), I, mergeRecordsFromWriter(), Name, write(), writeBuffer(), writeRecordInText(), and writeText().
| void InstrProfWriter::mergeRecordsFromWriter | ( | InstrProfWriter && | IPW, |
| function_ref< void(Error)> | Warn | ||
| ) |
Merge existing function counts from the given writer.
Definition at line 252 of file InstrProfWriter.cpp.
References addRecord(), llvm::any_of(), llvm::InstrProfRecord::Counts, I, and llvm::X86II::PD.
Referenced by addRecord().
| void InstrProfWriter::overlapRecord | ( | NamedInstrProfRecord && | Other, |
| OverlapStats & | Overlap, | ||
| OverlapStats & | FuncLevelOverlap, | ||
| const OverlapFuncFilters & | FuncFilter | ||
| ) |
Definition at line 190 of file InstrProfWriter.cpp.
References llvm::OverlapStats::addOneMismatch(), llvm::OverlapStats::addOneUnique(), addRecord(), llvm::CountSumOrPercent::CountSum, E, I, llvm::InstrProfRecord::merge(), Name, llvm::OverlapFuncFilters::NameFilter, llvm::CountSumOrPercent::NumEntries, llvm::Other, llvm::OverlapStats::Overlap, llvm::InstrProfRecord::overlap(), llvm::InstrProfRecord::scale(), llvm::InstrProfRecord::sortValueData(), llvm::OverlapStats::Test, and llvm::OverlapFuncFilters::ValueCutoff.
Referenced by setIsIRLevelProfile().
Set the ProfileKind.
Report error if mixing FE and IR level profiles. WithCS indicates if this is for contenxt sensitive instrumentation.
Definition at line 79 of file InstrProfWriter.h.
References addRecord(), llvm::msgpack::Endianness, I, llvm::Other, overlapRecord(), llvm::X86II::PD, PF_FE, PF_IRLevel, PF_IRLevelWithCS, PF_Unknown, setOutputSparse(), setValueProfDataEndianness(), llvm::Error::success(), and llvm::unsupported_version.
| void InstrProfWriter::setOutputSparse | ( | bool | Sparse | ) |
Definition at line 179 of file InstrProfWriter.cpp.
Referenced by setIsIRLevelProfile().
| void InstrProfWriter::setValueProfDataEndianness | ( | support::endianness | Endianness | ) |
Definition at line 174 of file InstrProfWriter.cpp.
References llvm::msgpack::Endianness, and llvm::InstrProfRecordWriterTrait::ValueProfDataEndianness.
Referenced by setIsIRLevelProfile().
| void InstrProfWriter::write | ( | raw_fd_ostream & | OS | ) |
Write the profile to OS.
Definition at line 377 of file InstrProfWriter.cpp.
Referenced by addRecord().
| std::unique_ptr< MemoryBuffer > InstrProfWriter::writeBuffer | ( | ) |
Write the profile, returning the raw data. For testing.
Definition at line 383 of file InstrProfWriter.cpp.
References llvm::Data, and llvm::MemoryBuffer::getMemBufferCopy().
Referenced by addRecord().
|
static |
Write Record in text format to OS.
Definition at line 398 of file InstrProfWriter.cpp.
References llvm::InstrProfRecord::Counts, llvm::InstrProfSymtab::getFuncNameOrExternalSymbol(), llvm::InstrProfRecord::getNumValueDataForSite(), llvm::InstrProfRecord::getNumValueKinds(), llvm::InstrProfRecord::getNumValueSites(), llvm::InstrProfRecord::getValueForSite(), and I.
Referenced by addRecord(), and writeText().
| Error InstrProfWriter::writeText | ( | raw_fd_ostream & | OS | ) |
Write the profile in text format to OS.
Definition at line 439 of file InstrProfWriter.cpp.
References llvm::InstrProfSymtab::addFuncName(), B, E, I, PF_IRLevel, PF_IRLevelWithCS, llvm::SmallVectorTemplateBase< T >::push_back(), llvm::sort(), llvm::Error::success(), and writeRecordInText().
Referenced by addRecord().
1.8.13