class IndexedInstrProfReader
Declaration
class IndexedInstrProfReader : public InstrProfReader { /* full declaration omitted */ };
Description
Reader for the indexed binary instrprof format.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:426
Inherits from: InstrProfReader
Member Variables
Inherited from InstrProfReader:
Method Overview
- public IndexedInstrProfReader(std::unique_ptr<MemoryBuffer> DataBuffer, std::unique_ptr<MemoryBuffer> RemappingBuffer = nullptr)
- public IndexedInstrProfReader(const llvm::IndexedInstrProfReader &)
- public static Expected<std::unique_ptr<IndexedInstrProfReader>> create(const llvm::Twine & Path, const llvm::Twine & RemappingPath = "")
- public static Expected<std::unique_ptr<IndexedInstrProfReader>> create(std::unique_ptr<MemoryBuffer> Buffer, std::unique_ptr<MemoryBuffer> RemappingBuffer = nullptr)
- public llvm::Error getFunctionCounts(llvm::StringRef FuncName, uint64_t FuncHash, std::vector<uint64_t> & Counts)
- public Expected<llvm::InstrProfRecord> getInstrProfRecord(llvm::StringRef FuncName, uint64_t FuncHash)
- public uint64_t getMaximumFunctionCount(bool UseCS)
- public llvm::ProfileSummary & getSummary(bool UseCS)
- public llvm::InstrProfSymtab & getSymtab()
- public uint64_t getVersion() const
- public bool hasCSIRLevelProfile() const
- public static bool hasFormat(const llvm::MemoryBuffer & DataBuffer)
- public bool isIRLevelProfile() const
- public llvm::Error readHeader()
- public llvm::Error readNextRecord(llvm::NamedInstrProfRecord & Record)
- public void setValueProfDataEndianness(support::endianness Endianness)
Inherited from InstrProfReader:
- public accumulateCounts
- public begin
- public create
- public create
- public end
- protected error
- protected error
- public getError
- public getSymtab
- public hasCSIRLevelProfile
- public hasError
- public isEOF
- public isIRLevelProfile
- public readHeader
- public readNextRecord
- protected success
Methods
¶IndexedInstrProfReader(
std::unique_ptr<MemoryBuffer> DataBuffer,
std::unique_ptr<MemoryBuffer>
RemappingBuffer = nullptr)
IndexedInstrProfReader(
std::unique_ptr<MemoryBuffer> DataBuffer,
std::unique_ptr<MemoryBuffer>
RemappingBuffer = nullptr)
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:450
Parameters
- std::unique_ptr<MemoryBuffer> DataBuffer
- std::unique_ptr<MemoryBuffer> RemappingBuffer = nullptr
¶IndexedInstrProfReader(
const llvm::IndexedInstrProfReader&)
IndexedInstrProfReader(
const llvm::IndexedInstrProfReader&)
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:455
Parameters
- const llvm::IndexedInstrProfReader&
¶static Expected<
std::unique_ptr<IndexedInstrProfReader>>
create(const llvm::Twine& Path,
const llvm::Twine& RemappingPath = "")
static Expected<
std::unique_ptr<IndexedInstrProfReader>>
create(const llvm::Twine& Path,
const llvm::Twine& RemappingPath = "")
Description
Factory method to create an indexed reader.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:495
Parameters
- const llvm::Twine& Path
- const llvm::Twine& RemappingPath = ""
¶static Expected<
std::unique_ptr<IndexedInstrProfReader>>
create(std::unique_ptr<MemoryBuffer> Buffer,
std::unique_ptr<MemoryBuffer>
RemappingBuffer = nullptr)
static Expected<
std::unique_ptr<IndexedInstrProfReader>>
create(std::unique_ptr<MemoryBuffer> Buffer,
std::unique_ptr<MemoryBuffer>
RemappingBuffer = nullptr)
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:498
Parameters
- std::unique_ptr<MemoryBuffer> Buffer
- std::unique_ptr<MemoryBuffer> RemappingBuffer = nullptr
¶llvm::Error getFunctionCounts(
llvm::StringRef FuncName,
uint64_t FuncHash,
std::vector<uint64_t>& Counts)
llvm::Error getFunctionCounts(
llvm::StringRef FuncName,
uint64_t FuncHash,
std::vector<uint64_t>& Counts)
Description
Fill Counts with the profile data for the given function name.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:478
Parameters
- llvm::StringRef FuncName
- uint64_t FuncHash
- std::vector<uint64_t>& Counts
¶Expected<llvm::InstrProfRecord>
getInstrProfRecord(llvm::StringRef FuncName,
uint64_t FuncHash)
Expected<llvm::InstrProfRecord>
getInstrProfRecord(llvm::StringRef FuncName,
uint64_t FuncHash)
Description
Return the NamedInstrProfRecord associated with FuncName and FuncHash
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:474
Parameters
- llvm::StringRef FuncName
- uint64_t FuncHash
¶uint64_t getMaximumFunctionCount(bool UseCS)
uint64_t getMaximumFunctionCount(bool UseCS)
Description
Return the maximum of all known function counts.\c UseCS indicates whether to use the context-sensitive count.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:483
Parameters
- bool UseCS
¶llvm::ProfileSummary& getSummary(bool UseCS)
llvm::ProfileSummary& getSummary(bool UseCS)
Description
Return the profile summary.\c UseCS indicates whether to use the context-sensitive summary.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:513
Parameters
- bool UseCS
¶llvm::InstrProfSymtab& getSymtab()
llvm::InstrProfSymtab& getSymtab()
Description
Return the PGO symtab. There are three different readers: Raw, Text, and Indexed profile readers. The first two types of readers are used only by llvm-profdata tool, while the indexed profile reader is also used by llvm-cov tool and the compiler ( backend or frontend). Since creating PGO symtab can create significant runtime and memory overhead (as it touches data for the whole program), InstrProfSymtab for the indexed profile reader should be created on demand and it is recommended to be only used for dumping purpose with llvm-proftool, not with the compiler.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:509
¶uint64_t getVersion() const
uint64_t getVersion() const
Description
Return the profile version.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:459
¶bool hasCSIRLevelProfile() const
bool hasCSIRLevelProfile() const
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:461
¶static bool hasFormat(
const llvm::MemoryBuffer& DataBuffer)
static bool hasFormat(
const llvm::MemoryBuffer& DataBuffer)
Description
Return true if the given buffer is in an indexed instrprof format.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:466
Parameters
- const llvm::MemoryBuffer& DataBuffer
¶bool isIRLevelProfile() const
bool isIRLevelProfile() const
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:460
¶llvm::Error readHeader()
llvm::Error readHeader()
Description
Read the file header.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:469
¶llvm::Error readNextRecord(
llvm::NamedInstrProfRecord& Record)
llvm::Error readNextRecord(
llvm::NamedInstrProfRecord& Record)
Description
Read a single record.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:471
Parameters
- llvm::NamedInstrProfRecord& Record
¶void setValueProfDataEndianness(
support::endianness Endianness)
void setValueProfDataEndianness(
support::endianness Endianness)
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:502
Parameters
- support::endianness Endianness