summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorPhilip Pfaffe <philip.pfaffe@gmail.com>2018-11-12 11:17:07 +0000
committerPhilip Pfaffe <philip.pfaffe@gmail.com>2018-11-12 11:17:07 +0000
commit2d4effb25c7a82728684c7f042ff9bb06bb5f3bd (patch)
treec520108b921b8b880fc5fa24b88b3d52706917b8 /llvm/lib
parent2c7f3d32825fc1cf181dc9748329768bf77d9d47 (diff)
downloadbcm5719-llvm-2d4effb25c7a82728684c7f042ff9bb06bb5f3bd.tar.gz
bcm5719-llvm-2d4effb25c7a82728684c7f042ff9bb06bb5f3bd.zip
Add an OptimizerLast EP
Summary: It turns out that we need an OptimizerLast PassBuilder extension point after all. I missed the relevance of this EP the first time. By legacy PM magic, function passes added at this EP get added to the last _Function_ PM, which is a feature we lost when dropping this EP for the new PM. A key difference between this and the legacy PassManager's OptimizerLast callback is that this extension point is not triggered at O0. Extensions to the O0 pipeline should append their passes to the end of the overall pipeline. Differential Revision: https://reviews.llvm.org/D54374 llvm-svn: 346645
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Passes/PassBuilder.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index 0c6dfff06f1..33f74cfd9ed 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -862,6 +862,9 @@ PassBuilder::buildModuleOptimizationPipeline(OptimizationLevel Level,
// inserting redudnancies into the progrem. This even includes SimplifyCFG.
OptimizePM.addPass(SpeculateAroundPHIsPass());
+ for (auto &C : OptimizerLastEPCallbacks)
+ C(OptimizePM, Level);
+
// Add the core optimizing pipeline.
MPM.addPass(createModuleToFunctionPassAdaptor(std::move(OptimizePM)));
OpenPOWER on IntegriCloud