Skip to content

[memprof] Use MinimumSupportedVersion in place of Verion0 (NFC) #114723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion llvm/include/llvm/ProfileData/InstrProfReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,8 @@ class InstrProfReaderRemapper {
class IndexedMemProfReader {
private:
/// The MemProf version.
memprof::IndexedVersion Version = memprof::Version0;
memprof::IndexedVersion Version =
static_cast<memprof::IndexedVersion>(memprof::MinimumSupportedVersion);
/// MemProf profile schema (if available).
memprof::MemProfSchema Schema;
/// MemProf record profile data on-disk indexed via llvm::md5(FunctionName).
Expand Down
16 changes: 10 additions & 6 deletions llvm/include/llvm/ProfileData/InstrProfWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,16 @@ class InstrProfWriter {
// MemprofGenerateRandomHotness is enabled. The random seed can be either
// provided by MemprofGenerateRandomHotnessSeed, or if that is 0, one will be
// generated in the writer using the current time.
InstrProfWriter(
bool Sparse = false, uint64_t TemporalProfTraceReservoirSize = 0,
uint64_t MaxTemporalProfTraceLength = 0, bool WritePrevVersion = false,
memprof::IndexedVersion MemProfVersionRequested = memprof::Version0,
bool MemProfFullSchema = false, bool MemprofGenerateRandomHotness = false,
unsigned MemprofGenerateRandomHotnessSeed = 0);
InstrProfWriter(bool Sparse = false,
uint64_t TemporalProfTraceReservoirSize = 0,
uint64_t MaxTemporalProfTraceLength = 0,
bool WritePrevVersion = false,
memprof::IndexedVersion MemProfVersionRequested =
static_cast<memprof::IndexedVersion>(
memprof::MinimumSupportedVersion),
bool MemProfFullSchema = false,
bool MemprofGenerateRandomHotness = false,
unsigned MemprofGenerateRandomHotnessSeed = 0);
~InstrProfWriter();

StringMap<ProfilingData> &getProfileData() { return FunctionData; }
Expand Down
Loading