LLVM  13.0.0git
MemProfiler.h
Go to the documentation of this file.
1 //===--------- Definition of the MemProfiler class --------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file declares the MemProfiler class.
11 //
12 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_TRANSFORMS_INSTRUMENTATION_MEMPROFILER_H
14 #define LLVM_TRANSFORMS_INSTRUMENTATION_MEMPROFILER_H
15 
16 #include "llvm/IR/Function.h"
17 #include "llvm/IR/Module.h"
18 #include "llvm/IR/PassManager.h"
19 
20 namespace llvm {
21 
22 /// Public interface to the memory profiler pass for instrumenting code to
23 /// profile memory accesses.
24 ///
25 /// The profiler itself is a function pass that works by inserting various
26 /// calls to the MemProfiler runtime library functions. The runtime library
27 /// essentially replaces malloc() and free() with custom implementations that
28 /// record data about the allocations.
29 class MemProfilerPass : public PassInfoMixin<MemProfilerPass> {
30 public:
31  explicit MemProfilerPass();
33  static bool isRequired() { return true; }
34 };
35 
36 /// Public interface to the memory profiler module pass for instrumenting code
37 /// to profile memory allocations and accesses.
38 class ModuleMemProfilerPass : public PassInfoMixin<ModuleMemProfilerPass> {
39 public:
40  explicit ModuleMemProfilerPass();
42  static bool isRequired() { return true; }
43 };
44 
45 // Insert MemProfiler instrumentation
46 FunctionPass *createMemProfilerFunctionPass();
48 
49 } // namespace llvm
50 
51 #endif
llvm::PreservedAnalyses
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:155
llvm
Definition: AllocatorList.h:23
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
llvm::PassInfoMixin
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:374
llvm::Function
Definition: Function.h:61
Module.h
llvm::createMemProfilerFunctionPass
FunctionPass * createMemProfilerFunctionPass()
Definition: MemProfiler.cpp:281
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::ModuleMemProfilerPass::ModuleMemProfilerPass
ModuleMemProfilerPass()
Definition: MemProfiler.cpp:262
llvm::MemProfilerPass::MemProfilerPass
MemProfilerPass()
Definition: MemProfiler.cpp:249
llvm::MemProfilerPass
Public interface to the memory profiler pass for instrumenting code to profile memory accesses.
Definition: MemProfiler.h:29
llvm::ModuleMemProfilerPass
Public interface to the memory profiler module pass for instrumenting code to profile memory allocati...
Definition: MemProfiler.h:38
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
llvm::createModuleMemProfilerLegacyPassPass
ModulePass * createModuleMemProfilerLegacyPassPass()
llvm::MemProfilerPass::run
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Definition: MemProfiler.cpp:251
Function.h
llvm::ModuleMemProfilerPass::run
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
Definition: MemProfiler.cpp:264
PassManager.h
llvm::ModuleMemProfilerPass::isRequired
static bool isRequired()
Definition: MemProfiler.h:42
llvm::AnalysisManager
A container for analyses that lazily runs them and caches their results.
Definition: InstructionSimplify.h:44
llvm::MemProfilerPass::isRequired
static bool isRequired()
Definition: MemProfiler.h:33