|
LLVM
4.0.0
|
A symbol table used for function PGO name look-up with keys (such as pointers, md5hash values) to the function. More...
#include <InstrProf.h>
Public Types | |
| typedef std::vector< std::pair < uint64_t, uint64_t > > | AddrHashMap |
Public Member Functions | |
| InstrProfSymtab () | |
| Error | create (object::SectionRef &Section) |
| Create InstrProfSymtab from an object file section which contains function PGO names. More... | |
| Error | create (StringRef D, uint64_t BaseAddr) |
| This interface is used by reader of CoverageMapping test format. More... | |
| Error | create (StringRef NameStrings) |
NameStrings is a string composed of one of more sub-strings encoded in the format described in collectPGOFuncNameStrings. More... | |
| void | create (Module &M, bool InLTO=false) |
A wrapper interface to populate the PGO symtab with functions decls from module M. More... | |
| template<typename NameIterRange > | |
| void | create (const NameIterRange &IterRange) |
Create InstrProfSymtab from a set of names iteratable from IterRange. More... | |
| void | finalizeSymtab () |
| void | addFuncName (StringRef FuncName) |
Update the symtab by adding FuncName to the table. More... | |
| void | mapAddress (uint64_t Addr, uint64_t MD5Val) |
| Map a function address to its name's MD5 hash. More... | |
| AddrHashMap & | getAddrHashMap () |
| StringRef | getFuncName (uint64_t FuncNameAddress, size_t NameSize) |
| Return function's PGO name from the function name's symbol address in the object file. More... | |
| StringRef | getFuncName (uint64_t FuncMD5Hash) |
| Return function's PGO name from the name's md5 hash value. More... | |
| Function * | getFunction (uint64_t FuncMD5Hash) |
| Return function from the name's md5 hash. Return nullptr if not found. More... | |
| StringRef | getOrigFuncName (uint64_t FuncMD5Hash) |
| Return the function's original assembly name by stripping off the prefix attached (to symbols with priviate linkage). More... | |
| StringRef | getNameData () const |
| Return the name section data. More... | |
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 getPGOFuncName() method for details on how PGO name is formed.
Definition at line 416 of file InstrProf.h.
| typedef std::vector<std::pair<uint64_t, uint64_t> > llvm::InstrProfSymtab::AddrHashMap |
Definition at line 418 of file InstrProf.h.
|
inline |
Definition at line 435 of file InstrProf.h.
|
inline |
Update the symtab by adding FuncName to the table.
This interface is used by the raw and text profile readers.
Definition at line 468 of file InstrProf.h.
References llvm::IndexedInstrProf::ComputeHash(), llvm::MipsISD::Ins, and llvm::StringSet< AllocatorTy >::insert().
Referenced by create(), llvm::readPGOFuncNameStrings(), and llvm::InstrProfWriter::writeText().
| Error InstrProfSymtab::create | ( | object::SectionRef & | Section | ) |
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 create(StringRef) method.
Definition at line 327 of file CoverageMappingReader.cpp.
References llvm::dwarf::syntax::Address, llvm::errorCodeToError(), llvm::object::SectionRef::getAddress(), llvm::object::SectionRef::getContents(), and llvm::Error::success().
Referenced by loadBinaryFormat(), loadTestingFormat(), llvm::InstrProfReaderIndex< HashTableImpl >::populateSymtab(), and promoteIndirectCalls().
This interface is used by reader of CoverageMapping test format.
Definition at line 497 of file InstrProf.h.
References D, and llvm::Error::success().
NameStrings is a string composed of one of more sub-strings encoded in the format described in collectPGOFuncNameStrings.
This method is a wrapper to readPGOFuncNameStrings method.
Definition at line 503 of file InstrProf.h.
References llvm::readPGOFuncNameStrings().
A wrapper interface to populate the PGO symtab with functions decls from module M.
This interface is used by transformation passes such as indirect function call promotion. Variable InLTO indicates if this is called from LTO optimization passes.
Definition at line 230 of file InstrProf.cpp.
References addFuncName(), F, finalizeSymtab(), llvm::GlobalValue::getGUID(), and llvm::getPGOFuncName().
| void llvm::InstrProfSymtab::create | ( | const NameIterRange & | IterRange | ) |
Create InstrProfSymtab from a set of names iteratable from IterRange.
This interface is used by IndexedProfReader.
Definition at line 508 of file InstrProf.h.
References addFuncName(), and finalizeSymtab().
|
inline |
Definition at line 515 of file InstrProf.h.
Referenced by create(), llvm::readPGOFuncNameStrings(), and llvm::InstrProfWriter::writeText().
|
inline |
Definition at line 479 of file InstrProf.h.
| StringRef InstrProfSymtab::getFuncName | ( | uint64_t | FuncNameAddress, |
| size_t | NameSize | ||
| ) |
Return function's PGO name from the function name's symbol address in the object file.
If an error occurs, return an empty string.
Definition at line 334 of file CoverageMappingReader.cpp.
References llvm::dwarf::syntax::Address, and Offset.
Referenced by llvm::coverage::CovMapFunctionRecordV1< IntPtrT >::getFuncName(), llvm::coverage::CovMapFunctionRecord::getFuncName(), getOrigFuncName(), and llvm::InstrProfWriter::writeRecordInText().
|
inline |
Return function's PGO name from the name's md5 hash value.
If not found, return an empty string.
Definition at line 523 of file InstrProf.h.
|
inline |
Return function from the name's md5 hash. Return nullptr if not found.
Definition at line 533 of file InstrProf.h.
|
inline |
Return the name section data.
Definition at line 494 of file InstrProf.h.
|
inline |
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.
Definition at line 545 of file InstrProf.h.
References llvm::StringRef::drop_front(), llvm::StringRef::find_first_of(), getFuncName(), and llvm::StringRef::npos.
|
inline |
Map a function address to its name's MD5 hash.
This interface is only used by the raw profiler reader.
Definition at line 476 of file InstrProf.h.
1.8.6