LLVM 19.0.0git
|
#include "llvm/Transforms/Instrumentation/InstrProfiling.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Analysis/BlockFrequencyInfo.h"
#include "llvm/Analysis/BranchProbabilityInfo.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DIBuilder.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Type.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/ProfileData/InstrProf.h"
#include "llvm/ProfileData/InstrProfCorrelator.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/TargetParser/Triple.h"
#include "llvm/Transforms/Instrumentation.h"
#include "llvm/Transforms/Instrumentation/PGOInstrumentation.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/ModuleUtils.h"
#include "llvm/Transforms/Utils/SSAUpdater.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <string>
#include "llvm/ProfileData/InstrProfData.inc"
Go to the source code of this file.
Namespaces | |
namespace | llvm |
This is an optimization pass for GlobalISel generic memory operations. | |
Macros | |
#define | DEBUG_TYPE "instrprof" |
#define | VALUE_PROF_FUNC_PARAM(ParamType, ParamName, ParamLLVMType) ParamLLVMType |
#define | INSTR_PROF_DATA(Type, LLVMType, Name, Init) LLVMType, |
#define | INSTR_PROF_DATA(Type, LLVMType, Name, Init) Init, |
#define | INSTR_PROF_MIN_VAL_COUNTS 10 |
#define | INSTR_PROF_VALUE_NODE(Type, LLVMType, Name, Init) LLVMType, |
Functions | |
cl::opt< bool > | llvm::DebugInfoCorrelate ("debug-info-correlate", cl::desc("Use debug info to correlate profiles. (Deprecated, use " "-profile-correlate=debug-info)"), cl::init(false)) |
static bool | needsRuntimeHookUnconditionally (const Triple &TT) |
static bool | containsProfilingIntrinsics (Module &M) |
Check if the module contains uses of any profiling intrinsics. | |
static FunctionCallee | getOrInsertValueProfilingCall (Module &M, const TargetLibraryInfo &TLI, ValueProfilingCallType CallType=ValueProfilingCallType::Default) |
static std::string | getVarName (InstrProfInstBase *Inc, StringRef Prefix, bool &Renamed) |
Get the name of a profiling variable for a particular function. | |
static bool | shouldRecordFunctionAddr (Function *F) |
static bool | shouldUsePublicSymbol (Function *Fn) |
static Constant * | getFuncAddrForProfData (Function *Fn) |
static bool | needsRuntimeRegistrationOfSectionRange (const Triple &TT) |
Variables | |
cl::opt< InstrProfCorrelator::ProfCorrelatorKind > | llvm::ProfileCorrelate ("profile-correlate", cl::desc("Use debug info or binary file to correlate profiles."), cl::init(InstrProfCorrelator::NONE), cl::values(clEnumValN(InstrProfCorrelator::NONE, "", "No profile correlation"), clEnumValN(InstrProfCorrelator::DEBUG_INFO, "debug-info", "Use debug info to correlate"), clEnumValN(InstrProfCorrelator::BINARY, "binary", "Use binary to correlate"))) |
#define DEBUG_TYPE "instrprof" |
Definition at line 64 of file InstrProfiling.cpp.
#define INSTR_PROF_MIN_VAL_COUNTS 10 |
#define VALUE_PROF_FUNC_PARAM | ( | ParamType, | |
ParamName, | |||
ParamLLVMType | |||
) | ParamLLVMType |
Check if the module contains uses of any profiling intrinsics.
Definition at line 713 of file InstrProfiling.cpp.
References F, and llvm::Intrinsic::getName().
Definition at line 1151 of file InstrProfiling.cpp.
References llvm::GlobalAlias::create(), llvm::ConstantPointerNull::get(), llvm::Function::getContext(), llvm::GlobalValue::getLinkage(), llvm::Value::getName(), llvm::PointerType::getUnqual(), llvm::GlobalObject::hasComdat(), llvm::GlobalValue::HiddenVisibility, llvm::GlobalValue::PrivateLinkage, shouldRecordFunctionAddr(), and shouldUsePublicSymbol().
|
static |
Definition at line 793 of file InstrProfiling.cpp.
References assert(), llvm::FunctionType::get(), llvm::getInstrProfValueProfFuncName(), llvm::getInstrProfValueProfMemOpFuncName(), and llvm::Type::getVoidTy().
|
static |
Get the name of a profiling variable for a particular function.
Definition at line 1064 of file InstrProfiling.cpp.
References llvm::canRenameComdatFunc(), F, llvm::InstrProfInstBase::getHash(), llvm::getInstrProfNameVarPrefix(), llvm::InstrProfInstBase::getName(), llvm::Value::getName(), llvm::BasicBlock::getParent(), llvm::Instruction::getParent(), llvm::ConstantInt::getZExtValue(), llvm::isIRPGOFlagSet(), Name, llvm::StringRef::size(), llvm::StringRef::substr(), and llvm::dwarf::toStringRef().
Definition at line 704 of file InstrProfiling.cpp.
Definition at line 1186 of file InstrProfiling.cpp.
Definition at line 1083 of file InstrProfiling.cpp.
References F.
Referenced by getFuncAddrForProfData().
Definition at line 1120 of file InstrProfiling.cpp.
References llvm::GlobalValue::getVisibility(), llvm::GlobalObject::hasComdat(), llvm::GlobalValue::hasLocalLinkage(), llvm::GlobalObject::hasMetadata(), llvm::GlobalValue::HiddenVisibility, and llvm::GlobalValue::isDeclarationForLinker().
Referenced by getFuncAddrForProfData().