class InstrProfSymtab
Declaration
class InstrProfSymtab { /* full declaration omitted */ };
Description
A symbol table used for function PGO name look-up with keys (such as pointers, md5hash values) to the function. A function's PGO name or name's md5hash are used in retrieving the profile data of the function. See \c getPGOFuncName() method for details on how PGO name is formed.
Declared at: llvm/include/llvm/ProfileData/InstrProf.h:406
Method Overview
- public InstrProfSymtab()
- public llvm::Error addFuncName(llvm::StringRef FuncName)
- public llvm::Error create(object::SectionRef & Section)
- public inline llvm::Error create(llvm::StringRef D, uint64_t BaseAddr)
- public inline llvm::Error create(llvm::StringRef NameStrings)
- public llvm::Error create(llvm::Module & M, bool InLTO = false)
- public template <typename NameIterRange>llvm::Error create(const NameIterRange & IterRange)
- public llvm::StringRef getFuncName(uint64_t FuncNameAddress, size_t NameSize)
- public inline llvm::StringRef getFuncName(uint64_t FuncMD5Hash)
- public inline llvm::StringRef getFuncNameOrExternalSymbol(uint64_t FuncMD5Hash)
- public inline llvm::Function * getFunction(uint64_t FuncMD5Hash)
- public uint64_t getFunctionHashFromAddress(uint64_t Address)
- public inline llvm::StringRef getNameData() const
- public inline llvm::StringRef getOrigFuncName(uint64_t FuncMD5Hash)
- public static bool isExternalSymbol(const llvm::StringRef & Symbol)
- public void mapAddress(uint64_t Addr, uint64_t MD5Val)
Methods
¶InstrProfSymtab()
InstrProfSymtab()
Declared at: llvm/include/llvm/ProfileData/InstrProf.h:436
¶llvm::Error addFuncName(llvm::StringRef FuncName)
llvm::Error addFuncName(llvm::StringRef FuncName)
Description
Update the symtab by adding \p FuncName to the table. This interface is used by the raw and text profile readers.
Declared at: llvm/include/llvm/ProfileData/InstrProf.h:467
Parameters
- llvm::StringRef FuncName
¶llvm::Error create(object::SectionRef& Section)
llvm::Error create(object::SectionRef& Section)
Description
Create InstrProfSymtab from an object file section which contains function PGO names. When section may contain raw string data or string data in compressed form. This method only initialize the symtab with reference to the data and the section base address. The decompression will be delayed until before it is used. See also \c create(StringRef) method.
Declared at: llvm/include/llvm/ProfileData/InstrProf.h:444
Parameters
- object::SectionRef& Section
¶inline llvm::Error create(llvm::StringRef D,
uint64_t BaseAddr)
inline llvm::Error create(llvm::StringRef D,
uint64_t BaseAddr)
Description
This interface is used by reader of CoverageMapping test format.
Declared at: llvm/include/llvm/ProfileData/InstrProf.h:448
Parameters
- llvm::StringRef D
- uint64_t BaseAddr
¶inline llvm::Error create(
llvm::StringRef NameStrings)
inline llvm::Error create(
llvm::StringRef NameStrings)
Description
\c NameStrings is a string composed of one of more sub-strings encoded in the format described in \c collectPGOFuncNameStrings. This method is a wrapper to \c readPGOFuncNameStrings method.
Declared at: llvm/include/llvm/ProfileData/InstrProf.h:453
Parameters
- llvm::StringRef NameStrings
¶llvm::Error create(llvm::Module& M,
bool InLTO = false)
llvm::Error create(llvm::Module& M,
bool InLTO = false)
Description
A wrapper interface to populate the PGO symtab with functions decls from module \c M. This interface is used by transformation passes such as indirect function call promotion. Variable \c InLTO indicates if this is called from LTO optimization passes.
Declared at: llvm/include/llvm/ProfileData/InstrProf.h:459
Parameters
- llvm::Module& M
- bool InLTO = false
¶template <typename NameIterRange>
llvm::Error create(const NameIterRange& IterRange)
template <typename NameIterRange>
llvm::Error create(const NameIterRange& IterRange)
Description
Create InstrProfSymtab from a set of names iteratable from\p IterRange. This interface is used by IndexedProfReader.
Declared at: llvm/include/llvm/ProfileData/InstrProf.h:463
Templates
- NameIterRange
Parameters
- const NameIterRange& IterRange
¶llvm::StringRef getFuncName(
uint64_t FuncNameAddress,
size_t NameSize)
llvm::StringRef getFuncName(
uint64_t FuncNameAddress,
size_t NameSize)
Description
Return function's PGO name from the function name's symbol address in the object file. If an error occurs, return an empty string.
Declared at: llvm/include/llvm/ProfileData/InstrProf.h:491
Parameters
- uint64_t FuncNameAddress
- size_t NameSize
¶inline llvm::StringRef getFuncName(
uint64_t FuncMD5Hash)
inline llvm::StringRef getFuncName(
uint64_t FuncMD5Hash)
Description
Return function's PGO name from the name's md5 hash value. If not found, return an empty string.
Declared at: llvm/include/llvm/ProfileData/InstrProf.h:495
Parameters
- uint64_t FuncMD5Hash
¶inline llvm::StringRef
getFuncNameOrExternalSymbol(uint64_t FuncMD5Hash)
inline llvm::StringRef
getFuncNameOrExternalSymbol(uint64_t FuncMD5Hash)
Description
Just like getFuncName, except that it will return a non-empty StringRef if the function is external to this symbol table. All such cases will be represented using the same StringRef value.
Declared at: llvm/include/llvm/ProfileData/InstrProf.h:500
Parameters
- uint64_t FuncMD5Hash
¶inline llvm::Function* getFunction(
uint64_t FuncMD5Hash)
inline llvm::Function* getFunction(
uint64_t FuncMD5Hash)
Description
Return function from the name's md5 hash. Return nullptr if not found.
Declared at: llvm/include/llvm/ProfileData/InstrProf.h:508
Parameters
- uint64_t FuncMD5Hash
¶uint64_t getFunctionHashFromAddress(
uint64_t Address)
uint64_t getFunctionHashFromAddress(
uint64_t Address)
Description
Return a function's hash, or 0, if the function isn't in this SymTab.
Declared at: llvm/include/llvm/ProfileData/InstrProf.h:486
Parameters
- uint64_t Address
¶inline llvm::StringRef getNameData() const
inline llvm::StringRef getNameData() const
Description
Return the name section data.
Declared at: llvm/include/llvm/ProfileData/InstrProf.h:516
¶inline llvm::StringRef getOrigFuncName(
uint64_t FuncMD5Hash)
inline llvm::StringRef getOrigFuncName(
uint64_t FuncMD5Hash)
Description
Return the function's original assembly name by stripping off the prefix attached (to symbols with priviate linkage). For global functions, it returns the same string as getFuncName.
Declared at: llvm/include/llvm/ProfileData/InstrProf.h:513
Parameters
- uint64_t FuncMD5Hash
¶static bool isExternalSymbol(
const llvm::StringRef& Symbol)
static bool isExternalSymbol(
const llvm::StringRef& Symbol)
Description
True if Symbol is the value used to represent external symbols.
Declared at: llvm/include/llvm/ProfileData/InstrProf.h:503
Parameters
- const llvm::StringRef& Symbol
¶void mapAddress(uint64_t Addr, uint64_t MD5Val)
void mapAddress(uint64_t Addr, uint64_t MD5Val)
Description
Map a function address to its name's MD5 hash. This interface is only used by the raw profiler reader.
Declared at: llvm/include/llvm/ProfileData/InstrProf.h:481
Parameters
- uint64_t Addr
- uint64_t MD5Val