From 5fa635b5bf7240eb7ce9dc71db6470251ee8f389 Mon Sep 17 00:00:00 2001 From: Kostya Serebryany Date: Fri, 23 Mar 2012 23:22:59 +0000 Subject: [PATCH] add EP_OptimizerLast extension point llvm-svn: 153353 --- include/llvm/Transforms/IPO/PassManagerBuilder.h | 4 ++++ lib/Transforms/IPO/PassManagerBuilder.cpp | 1 + 2 files changed, 5 insertions(+) diff --git a/include/llvm/Transforms/IPO/PassManagerBuilder.h b/include/llvm/Transforms/IPO/PassManagerBuilder.h index a1b4f5cd90b..734f37e52eb 100644 --- a/include/llvm/Transforms/IPO/PassManagerBuilder.h +++ b/include/llvm/Transforms/IPO/PassManagerBuilder.h @@ -73,6 +73,10 @@ public: /// cleanup-ish optimizations. EP_ScalarOptimizerLate, + /// EP_OptimizerLast -- This extension point allows adding passes that + /// run after everything else. + EP_OptimizerLast, + /// EP_EnabledOnOptLevel0 - This extension point allows adding passes that /// should not be disabled by O0 optimization level. The passes will be /// inserted after the inlining pass. diff --git a/lib/Transforms/IPO/PassManagerBuilder.cpp b/lib/Transforms/IPO/PassManagerBuilder.cpp index 84084374b34..243ba1a85bf 100644 --- a/lib/Transforms/IPO/PassManagerBuilder.cpp +++ b/lib/Transforms/IPO/PassManagerBuilder.cpp @@ -202,6 +202,7 @@ void PassManagerBuilder::populateModulePassManager(PassManagerBase &MPM) { if (OptLevel > 1) MPM.add(createConstantMergePass()); // Merge dup global constants } + addExtensionsToPM(EP_OptimizerLast, MPM); } void PassManagerBuilder::populateLTOPassManager(PassManagerBase &PM,