LLVM  4.0.0
Namespaces | Macros | Functions | Variables
InstrProf.cpp File Reference
#include "llvm/ProfileData/InstrProf.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/Triple.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/MDBuilder.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/Compression.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/LEB128.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Path.h"
#include "llvm/ProfileData/InstrProfData.inc"
Include dependency graph for InstrProf.cpp:

Go to the source code of this file.

Namespaces

 llvm
 Compute iterated dominance frontiers using a linear time algorithm.
 

Macros

#define INSTR_PROF_COMMON_API_IMPL
 

Functions

std::string llvm::getPGOFuncName (StringRef RawFuncName, GlobalValue::LinkageTypes Linkage, StringRef FileName, uint64_t Version=INSTR_PROF_INDEX_VERSION)
 Return the modified name for a function suitable to be used the key for profile lookup. More...
 
std::string llvm::getPGOFuncName (const Function &F, bool InLTO=false, uint64_t Version=INSTR_PROF_INDEX_VERSION)
 Return the modified name for function F suitable to be used the key for profile lookup. More...
 
StringRef llvm::getFuncNameWithoutPrefix (StringRef PGOFuncName, StringRef FileName="<unknown>")
 Given a PGO function name, remove the filename prefix and return the original (static) function name. More...
 
std::string llvm::getPGOFuncNameVarName (StringRef FuncName, GlobalValue::LinkageTypes Linkage)
 Return the name of the global variable used to store a function name in PGO instrumentation. More...
 
GlobalVariablellvm::createPGOFuncNameVar (Module &M, GlobalValue::LinkageTypes Linkage, StringRef PGOFuncName)
 Create and return the global variable for function name used in PGO instrumentation. More...
 
GlobalVariablellvm::createPGOFuncNameVar (Function &F, StringRef PGOFuncName)
 Create and return the global variable for function name used in PGO instrumentation. More...
 
Error llvm::collectPGOFuncNameStrings (const std::vector< std::string > &NameStrs, bool doCompression, std::string &Result)
 Given a vector of strings (function PGO names) NameStrs, the method generates a combined string Result thatis ready to be serialized. More...
 
StringRef llvm::getPGOFuncNameVarInitializer (GlobalVariable *NameVar)
 Return the initializer in string of the PGO name var NameVar. More...
 
Error llvm::collectPGOFuncNameStrings (const std::vector< GlobalVariable * > &NameVars, std::string &Result, bool doCompression=true)
 Produce Result string with the same format described above. More...
 
Error llvm::readPGOFuncNameStrings (StringRef NameStrings, InstrProfSymtab &Symtab)
 NameStrings is a string composed of one of more sub-strings encoded in the format described above. More...
 
uint32_t llvm::getNumValueKindsInstrProf (const void *Record)
 ValueProfRecordClosure Interface implementation for InstrProfRecord class. More...
 
uint32_t llvm::getNumValueSitesInstrProf (const void *Record, uint32_t VKind)
 
uint32_t llvm::getNumValueDataInstrProf (const void *Record, uint32_t VKind)
 
uint32_t llvm::getNumValueDataForSiteInstrProf (const void *R, uint32_t VK, uint32_t S)
 
void llvm::getValueForSiteInstrProf (const void *R, InstrProfValueData *Dst, uint32_t K, uint32_t S)
 
ValueProfData * llvm::allocValueProfDataInstrProf (size_t TotalSizeInBytes)
 
template<class T >
static T llvm::swapToHostOrder (const unsigned char *&D, support::endianness Orig)
 
static std::unique_ptr
< ValueProfData > 
llvm::allocValueProfData (uint32_t TotalSize)
 
void llvm::annotateValueSite (Module &M, Instruction &Inst, const InstrProfRecord &InstrProfR, InstrProfValueKind ValueKind, uint32_t SiteIndx, uint32_t MaxMDCount=3)
 Get the value profile data for value site SiteIdx from InstrProfR and annotate the instruction Inst with the value profile meta data. More...
 
void llvm::annotateValueSite (Module &M, Instruction &Inst, ArrayRef< InstrProfValueData > VDs, uint64_t Sum, InstrProfValueKind ValueKind, uint32_t MaxMDCount)
 Same as the above interface but using an ArrayRef, as well as Sum. More...
 
bool llvm::getValueProfDataFromInst (const Instruction &Inst, InstrProfValueKind ValueKind, uint32_t MaxNumValueData, InstrProfValueData ValueData[], uint32_t &ActualNumValueData, uint64_t &TotalC)
 Extract the value profile data from Inst which is annotated with value profile meta data. More...
 
MDNodellvm::getPGOFuncNameMetadata (const Function &F)
 Return the PGOFuncName meta data associated with a function. More...
 
void llvm::createPGOFuncNameMetadata (Function &F, StringRef PGOFuncName)
 Create the PGOFuncName meta data if PGOFuncName is different from function's raw name. More...
 
bool llvm::needsComdatForCounter (const Function &F, const Module &M)
 Check if we can use Comdat for profile variables. More...
 
bool llvm::isIRPGOFlagSet (const Module *M)
 Check if INSTR_PROF_RAW_VERSION_VAR is defined. More...
 
bool llvm::canRenameComdatFunc (const Function &F, bool CheckAddressTaken=false)
 Check if we can safely rename this Comdat function. More...
 

Variables

static cl::opt< boolStaticFuncFullModulePrefix ("static-func-full-module-prefix", cl::init(false), cl::desc("Use full module build paths in the profile counter names for ""static functions."))
 
static ManagedStatic
< InstrProfErrorCategoryType > 
ErrorCategory
 
static ValueProfRecordClosure llvm::InstrProfRecordClosure
 

Macro Definition Documentation

#define INSTR_PROF_COMMON_API_IMPL

Definition at line 472 of file InstrProf.cpp.

Variable Documentation

ManagedStatic<InstrProfErrorCategoryType> ErrorCategory
static

Definition at line 90 of file InstrProf.cpp.

Referenced by llvm::instrprof_category().

cl::opt<bool> StaticFuncFullModulePrefix("static-func-full-module-prefix", cl::init(false), cl::desc("Use full module build paths in the profile counter names for ""static functions."))
static

Referenced by llvm::getPGOFuncName().