diff options
Diffstat (limited to 'include/llvm/Transforms/IPO/PassManagerBuilder.h')
-rw-r--r-- | include/llvm/Transforms/IPO/PassManagerBuilder.h | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/include/llvm/Transforms/IPO/PassManagerBuilder.h b/include/llvm/Transforms/IPO/PassManagerBuilder.h index a4e7bce8ef4a..4f483deeefe5 100644 --- a/include/llvm/Transforms/IPO/PassManagerBuilder.h +++ b/include/llvm/Transforms/IPO/PassManagerBuilder.h @@ -15,11 +15,13 @@ #ifndef LLVM_TRANSFORMS_IPO_PASSMANAGERBUILDER_H #define LLVM_TRANSFORMS_IPO_PASSMANAGERBUILDER_H +#include <functional> #include <memory> +#include <string> #include <vector> namespace llvm { -class FunctionInfoIndex; +class ModuleSummaryIndex; class Pass; class TargetLibraryInfoImpl; class TargetMachine; @@ -58,8 +60,9 @@ class PassManagerBuilder { public: /// Extensions are passed the builder itself (so they can see how it is /// configured) as well as the pass manager to add stuff to. - typedef void (*ExtensionFn)(const PassManagerBuilder &Builder, - legacy::PassManagerBase &PM); + typedef std::function<void(const PassManagerBuilder &Builder, + legacy::PassManagerBase &PM)> + ExtensionFn; enum ExtensionPointTy { /// EP_EarlyAsPossible - This extension point allows adding passes before /// any other transformations, allowing them to see the code as it is coming @@ -116,8 +119,8 @@ public: /// added to the per-module passes. Pass *Inliner; - /// The function summary index to use for function importing. - const FunctionInfoIndex *FunctionIndex; + /// The module summary index to use for function importing. + const ModuleSummaryIndex *ModuleSummary; bool DisableTailCalls; bool DisableUnitAtATime; @@ -132,10 +135,17 @@ public: bool VerifyOutput; bool MergeFunctions; bool PrepareForLTO; + bool PrepareForThinLTO; + bool PerformThinLTO; + + /// Profile data file name that the instrumentation will be written to. + std::string PGOInstrGen; + /// Path of the profile data file. + std::string PGOInstrUse; private: /// ExtensionList - This is list of all of the extensions that are registered. - std::vector<std::pair<ExtensionPointTy, ExtensionFn> > Extensions; + std::vector<std::pair<ExtensionPointTy, ExtensionFn>> Extensions; public: PassManagerBuilder(); @@ -152,6 +162,9 @@ private: void addInitialAliasAnalysisPasses(legacy::PassManagerBase &PM) const; void addLTOOptimizationPasses(legacy::PassManagerBase &PM); void addLateLTOOptimizationPasses(legacy::PassManagerBase &PM); + void addPGOInstrPasses(legacy::PassManagerBase &MPM); + void addFunctionSimplificationPasses(legacy::PassManagerBase &MPM); + void addInstructionCombiningPass(legacy::PassManagerBase &MPM) const; public: /// populateFunctionPassManager - This fills in the function pass manager, @@ -162,6 +175,7 @@ public: /// populateModulePassManager - This sets up the primary pass manager. void populateModulePassManager(legacy::PassManagerBase &MPM); void populateLTOPassManager(legacy::PassManagerBase &PM); + void populateThinLTOPassManager(legacy::PassManagerBase &PM); }; /// Registers a function for adding a standard set of passes. This should be @@ -171,7 +185,7 @@ public: struct RegisterStandardPasses { RegisterStandardPasses(PassManagerBuilder::ExtensionPointTy Ty, PassManagerBuilder::ExtensionFn Fn) { - PassManagerBuilder::addGlobalExtension(Ty, Fn); + PassManagerBuilder::addGlobalExtension(Ty, std::move(Fn)); } }; |