summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Passes
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2018-01-23 01:25:20 +0000
committerDavid Blaikie <dblaikie@gmail.com>2018-01-23 01:25:20 +0000
commit0c64f5a2eba6ed11c1e04cfbb19ab8dcf0a469ed (patch)
treebd5b7b020667dfe8e148f8acb3b974090c3bbb4e /llvm/lib/Passes
parent60ec30340ff0c9b51fd1da4b7173dc087e2a96ae (diff)
downloadbcm5719-llvm-0c64f5a2eba6ed11c1e04cfbb19ab8dcf0a469ed.tar.gz
bcm5719-llvm-0c64f5a2eba6ed11c1e04cfbb19ab8dcf0a469ed.zip
NewPM: Add an extension point for the start of the pipeline.
This applies to most pipelines except the LTO and ThinLTO backend actions - it is for use at the beginning of the overall pipeline. This extension point will be used to add the GCOV pass when enabled in Clang. llvm-svn: 323166
Diffstat (limited to 'llvm/lib/Passes')
-rw-r--r--llvm/lib/Passes/PassBuilder.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index c344a3165a0..07c6f55afd6 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -150,7 +150,6 @@
#include "llvm/Transforms/Vectorize/LoopVectorize.h"
#include "llvm/Transforms/Vectorize/SLPVectorizer.h"
-
using namespace llvm;
static cl::opt<unsigned> MaxDevirtIterations("pm-max-devirt-iterations",
@@ -841,6 +840,10 @@ PassBuilder::buildPerModuleDefaultPipeline(OptimizationLevel Level,
// Force any function attributes we want the rest of the pipeline to observe.
MPM.addPass(ForceFunctionAttrsPass());
+ // Apply module pipeline start EP callback.
+ for (auto &C : PipelineStartEPCallbacks)
+ C(MPM);
+
if (PGOOpt && PGOOpt->SamplePGOSupport)
MPM.addPass(createModuleToFunctionPassAdaptor(AddDiscriminatorsPass()));
@@ -867,6 +870,10 @@ PassBuilder::buildThinLTOPreLinkDefaultPipeline(OptimizationLevel Level,
if (PGOOpt && PGOOpt->SamplePGOSupport)
MPM.addPass(createModuleToFunctionPassAdaptor(AddDiscriminatorsPass()));
+ // Apply module pipeline start EP callback.
+ for (auto &C : PipelineStartEPCallbacks)
+ C(MPM);
+
// If we are planning to perform ThinLTO later, we don't bloat the code with
// unrolling/vectorization/... now. Just simplify the module as much as we
// can.
OpenPOWER on IntegriCloud