|
LLVM 24.0.0git
|
Sample-based profile reader. More...
#include "llvm/ProfileData/SampleProfReader.h"
Classes | |
| class | iterator |
Public Types | |
| using | const_iterator = iterator |
Public Member Functions | |
| SampleProfileNameTable ()=default | |
| SampleProfileNameTable (const SampleProfileNameTable &)=delete | |
| SampleProfileNameTable (SampleProfileNameTable &&)=delete | |
| SampleProfileNameTable & | operator= (const SampleProfileNameTable &)=delete |
| SampleProfileNameTable & | operator= (SampleProfileNameTable &&)=delete |
| virtual | ~SampleProfileNameTable ()=default |
| virtual size_t | size () const =0 |
| bool | empty () const |
| virtual FunctionId | operator[] (size_t Idx) const =0 |
| virtual bool | contains (StringRef Key) const |
| virtual bool | contains (uint64_t GUID) const |
| iterator | begin () const |
| iterator | end () const |
Static Protected Member Functions | |
| template<typename SetT, typename RangeT, typename ProjT = llvm::identity> | |
| static const SetT & | getOrCreateSet (std::optional< SetT > &Set, const RangeT &Range, ProjT Proj=ProjT()) |
Protected Attributes | |
| std::optional< DenseSet< uint64_t > > | GUIDSet |
Static Protected Attributes | |
| static constexpr auto | GetFunctionIdHash |
| static constexpr auto | GetFunctionIdString |
Sample-based profile reader.
Each profile contains sample counts for all the functions executed. Inside each function, statements are annotated with the collected samples on all the instructions associated with that statement.
For this to produce meaningful data, the program needs to be compiled with some debug information (at minimum, line numbers: -gline-tables-only). Otherwise, it will be impossible to match IR instructions to the line numbers collected by the profiler.
From the profile file, we are interested in collecting the following information:
The reader supports two file formats: text and binary. The text format is useful for debugging and testing, while the binary format is more compact and I/O efficient. They can both be used interchangeably. Manages the sample profile name table, supporting both an eagerly loaded std::vector of FunctionId objects and lazy-loaded MD5 hashes read directly from the memory-mapped buffer. It enforces the exclusivity of these two formats and provides a unified read-only container interface.
Definition at line 357 of file SampleProfReader.h.
Definition at line 388 of file SampleProfReader.h.
|
default |
|
delete |
References SampleProfileNameTable().
|
delete |
References SampleProfileNameTable().
|
virtualdefault |
|
inline |
Definition at line 407 of file SampleProfReader.h.
|
inlinevirtual |
Reimplemented in llvm::sampleprof::StringSampleProfileNameTable.
Definition at line 400 of file SampleProfReader.h.
References contains(), and llvm::InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key.
Referenced by contains().
|
inlinevirtual |
Reimplemented in llvm::sampleprof::EytzingerSampleProfileNameTable, and llvm::sampleprof::LazySampleProfileNameTable.
Definition at line 403 of file SampleProfReader.h.
References GetFunctionIdHash, getOrCreateSet(), and GUIDSet.
|
inline |
Definition at line 398 of file SampleProfReader.h.
References size().
|
inline |
Definition at line 408 of file SampleProfReader.h.
References size().
|
inlinestaticprotected |
Definition at line 421 of file SampleProfReader.h.
References Range.
Referenced by llvm::sampleprof::LazySampleProfileNameTable::contains(), contains(), and llvm::sampleprof::StringSampleProfileNameTable::contains().
|
delete |
References SampleProfileNameTable().
|
delete |
References SampleProfileNameTable().
|
pure virtual |
|
pure virtual |
Implemented in llvm::sampleprof::EytzingerSampleProfileNameTable, llvm::sampleprof::LazySampleProfileNameTable, llvm::sampleprof::MD5SampleProfileNameTable, and llvm::sampleprof::StringSampleProfileNameTable.
Referenced by empty(), end(), and llvm::sampleprof::SampleProfileNameTable::iterator::operator*().
|
staticconstexprprotected |
Definition at line 413 of file SampleProfReader.h.
Referenced by contains().
|
staticconstexprprotected |
Definition at line 416 of file SampleProfReader.h.
Referenced by llvm::sampleprof::StringSampleProfileNameTable::contains().
|
mutableprotected |
Definition at line 411 of file SampleProfReader.h.
Referenced by llvm::sampleprof::LazySampleProfileNameTable::contains(), and contains().