aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Passes/PassBuilderPipelines.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2023-05-26 15:07:24 -0700
committerTeresa Johnson <tejohnson@google.com>2023-05-26 17:38:49 -0700
commitf354e971b09c244147ff59eb65b34487755598c0 (patch)
tree4ff51d9900549c7f2eb03849b031a399f6930f8a /llvm/lib/Passes/PassBuilderPipelines.cpp
parentb1b04ed96ac92d77ebb6de1ef8522f62ae4f517f (diff)
downloadllvm-f354e971b09c244147ff59eb65b34487755598c0.zip
llvm-f354e971b09c244147ff59eb65b34487755598c0.tar.gz
llvm-f354e971b09c244147ff59eb65b34487755598c0.tar.bz2
[MemProf] Clean up MemProf instrumentation pass invocation
First, removes the invocation of the memprof instrumentation passes from the end of the module simplification pass builder, where it doesn't really belong. However, it turns out that this was never being invoked, as it is guarded by an internal option not used anywhere (even tests). These passes are actually added via clang under the -fmemory-profile option. Changed this to add via the EP callback interface, similar to the sanitizer passes. They are added to the EP for the end of the optimization pipeline, which is roughly where they were being added already (end of the pre-LTO link pipelines and non-LTO optimization pipeline). Ideally we should plumb the output file through to LLVM and set it up there, so I have added a TODO. Differential Revision: https://reviews.llvm.org/D151593
Diffstat (limited to 'llvm/lib/Passes/PassBuilderPipelines.cpp')
-rw-r--r--llvm/lib/Passes/PassBuilderPipelines.cpp8
1 files changed, 0 insertions, 8 deletions
diff --git a/llvm/lib/Passes/PassBuilderPipelines.cpp b/llvm/lib/Passes/PassBuilderPipelines.cpp
index 05bb459..34d3b9d 100644
--- a/llvm/lib/Passes/PassBuilderPipelines.cpp
+++ b/llvm/lib/Passes/PassBuilderPipelines.cpp
@@ -155,9 +155,6 @@ static cl::opt<bool>
cl::Hidden,
cl::desc("Enable inline deferral during PGO"));
-static cl::opt<bool> EnableMemProfiler("enable-mem-prof", cl::Hidden,
- cl::desc("Enable memory profiler"));
-
static cl::opt<bool> EnableModuleInliner("enable-module-inliner",
cl::init(false), cl::Hidden,
cl::desc("Enable module inliner"));
@@ -1122,11 +1119,6 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
MPM.addPass(GlobalOptPass());
MPM.addPass(GlobalDCEPass());
- if (EnableMemProfiler && Phase != ThinOrFullLTOPhase::ThinLTOPreLink) {
- MPM.addPass(createModuleToFunctionPassAdaptor(MemProfilerPass()));
- MPM.addPass(ModuleMemProfilerPass());
- }
-
return MPM;
}