|
LLVM 24.0.0git
|
#include "llvm/Transforms/Instrumentation/MemProfInstrumentation.h"#include "InstrumentationOptions.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/Statistic.h"#include "llvm/ADT/StringRef.h"#include "llvm/Analysis/MemoryBuiltins.h"#include "llvm/Analysis/TargetLibraryInfo.h"#include "llvm/Analysis/ValueTracking.h"#include "llvm/IR/Constant.h"#include "llvm/IR/DataLayout.h"#include "llvm/IR/DiagnosticInfo.h"#include "llvm/IR/Function.h"#include "llvm/IR/GlobalValue.h"#include "llvm/IR/IRBuilder.h"#include "llvm/IR/Instruction.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/Module.h"#include "llvm/IR/Type.h"#include "llvm/IR/Value.h"#include "llvm/ProfileData/InstrProf.h"#include "llvm/ProfileData/MemProf.h"#include "llvm/Support/Debug.h"#include "llvm/TargetParser/Triple.h"#include "llvm/Transforms/Utils/BasicBlockUtils.h"#include "llvm/Transforms/Utils/ModuleUtils.h"Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "memprof" |
Functions | |
| STATISTIC (NumInstrumentedReads, "Number of instrumented reads") | |
| STATISTIC (NumInstrumentedWrites, "Number of instrumented writes") | |
| STATISTIC (NumSkippedStackReads, "Number of non-instrumented stack reads") | |
| STATISTIC (NumSkippedStackWrites, "Number of non-instrumented stack writes") | |
| void | createProfileFileNameVar (Module &M) |
| void | createMemprofHistogramFlagVar (const InstrumentationOptions &Opts, Module &M) |
| void | createMemprofDefaultOptionsVar (const InstrumentationOptions &Opts, Module &M) |
Variables | |
| constexpr int | LLVM_MEM_PROFILER_VERSION = 1 |
| constexpr uint64_t | DefaultMemGranularity = 64 |
| constexpr uint64_t | HistogramGranularity = 8 |
| constexpr char | MemProfModuleCtorName [] = "memprof.module_ctor" |
| constexpr uint64_t | MemProfCtorAndDtorPriority = 1 |
| constexpr uint64_t | MemProfEmscriptenCtorAndDtorPriority = 50 |
| constexpr char | MemProfInitName [] = "__memprof_init" |
| constexpr char | MemProfVersionCheckNamePrefix [] |
| constexpr char | MemProfShadowMemoryDynamicAddress [] |
| constexpr char | MemProfFilenameVar [] = "__memprof_profile_filename" |
| constexpr char | MemProfHistogramFlagVar [] = "__memprof_histogram" |
| #define DEBUG_TYPE "memprof" |
Definition at line 46 of file MemProfInstrumentation.cpp.
Definition at line 448 of file MemProfInstrumentation.cpp.
References llvm::GlobalValue::ExternalLinkage, llvm::memprof::getMemprofOptionsSymbolName(), llvm::Value::getName(), llvm::ConstantDataArray::getString(), llvm::Value::getType(), llvm::GlobalObject::setComdat(), llvm::GlobalValue::setLinkage(), and llvm::GlobalValue::WeakAnyLinkage.
Definition at line 432 of file MemProfInstrumentation.cpp.
References llvm::appendToCompilerUsed(), llvm::GlobalValue::ExternalLinkage, llvm::Type::getInt1Ty(), llvm::Constant::getIntegerValue(), MemProfHistogramFlagVar, and llvm::GlobalValue::WeakAnyLinkage.
| void createProfileFileNameVar | ( | Module & | M | ) |
Definition at line 411 of file MemProfInstrumentation.cpp.
References assert(), llvm::dyn_cast_or_null(), llvm::StringRef::empty(), llvm::GlobalValue::ExternalLinkage, llvm::ConstantDataArray::getString(), llvm::MDString::getString(), llvm::Value::getType(), MemProfFilenameVar, llvm::GlobalObject::setComdat(), llvm::GlobalValue::setLinkage(), and llvm::GlobalValue::WeakAnyLinkage.
| STATISTIC | ( | NumInstrumentedReads | , |
| "Number of instrumented reads" | ) |
| STATISTIC | ( | NumInstrumentedWrites | , |
| "Number of instrumented writes" | ) |
| STATISTIC | ( | NumSkippedStackReads | , |
| "Number of non-instrumented stack reads" | ) |
| STATISTIC | ( | NumSkippedStackWrites | , |
| "Number of non-instrumented stack writes" | ) |
References HistogramGranularity.
|
constexpr |
Definition at line 51 of file MemProfInstrumentation.cpp.
Referenced by llvm::MemProfilerPass::run().
|
constexpr |
Definition at line 54 of file MemProfInstrumentation.cpp.
Referenced by STATISTIC().
|
constexpr |
Definition at line 48 of file MemProfInstrumentation.cpp.
|
constexpr |
Definition at line 57 of file MemProfInstrumentation.cpp.
|
constexpr |
Definition at line 59 of file MemProfInstrumentation.cpp.
|
constexpr |
Definition at line 67 of file MemProfInstrumentation.cpp.
Referenced by createProfileFileNameVar().
|
constexpr |
Definition at line 69 of file MemProfInstrumentation.cpp.
Referenced by createMemprofHistogramFlagVar().
|
constexpr |
Definition at line 60 of file MemProfInstrumentation.cpp.
|
constexpr |
Definition at line 56 of file MemProfInstrumentation.cpp.
|
constexpr |
Definition at line 64 of file MemProfInstrumentation.cpp.
|
constexpr |
Definition at line 61 of file MemProfInstrumentation.cpp.