LLVM 20.0.0git
|
When writing a profile with size limit, user may want to use a different strategy to reduce function count other than dropping functions with fewest samples first. More...
#include "llvm/ProfileData/SampleProfWriter.h"
Public Member Functions | |
FunctionPruningStrategy (SampleProfileMap &ProfileMap, size_t OutputSizeLimit) | |
ProfileMap A reference to the original profile map. | |
virtual | ~FunctionPruningStrategy ()=default |
virtual void | Erase (size_t CurrentOutputSize)=0 |
SampleProfileWriter::writeWithSizeLimit() calls this after every write iteration if the output size still exceeds the limit. | |
Protected Attributes | |
SampleProfileMap & | ProfileMap |
size_t | OutputSizeLimit |
When writing a profile with size limit, user may want to use a different strategy to reduce function count other than dropping functions with fewest samples first.
In this case a class implementing the same interfaces should be provided to SampleProfileWriter::writeWithSizeLimit().
Definition at line 42 of file SampleProfWriter.h.
|
inline |
ProfileMap
A reference to the original profile map.
It will be modified by Erase(). OutputSizeLimit
Size limit in bytes of the output profile. This is necessary to estimate how many functions to remove.
Definition at line 52 of file SampleProfWriter.h.
|
virtualdefault |
|
pure virtual |
SampleProfileWriter::writeWithSizeLimit() calls this after every write iteration if the output size still exceeds the limit.
This function should erase some functions from the profile map so that the writer tries to write the profile again with fewer functions. At least 1 entry from the profile map must be erased.
CurrentOutputSize
Number of bytes in the output if current profile map is written.
Implemented in llvm::sampleprof::DefaultFunctionPruningStrategy.
Referenced by llvm::sampleprof::SampleProfileWriter::writeWithSizeLimitInternal().
|
protected |
Definition at line 45 of file SampleProfWriter.h.
Referenced by llvm::sampleprof::DefaultFunctionPruningStrategy::Erase().
|
protected |
Definition at line 44 of file SampleProfWriter.h.
Referenced by llvm::sampleprof::DefaultFunctionPruningStrategy::DefaultFunctionPruningStrategy(), and llvm::sampleprof::DefaultFunctionPruningStrategy::Erase().