Provide basic Full LTO extension points

Differential Revision: https://reviews.llvm.org/D61738

llvm-svn: 364937
This commit is contained in:
Serge Guelton 2019-07-02 15:52:39 +00:00
parent 82429ff8e0
commit 002a175085
2 changed files with 14 additions and 0 deletions

View File

@ -112,6 +112,16 @@ public:
/// passes at the end of the main CallGraphSCC passes and before any
/// function simplification passes run by CGPassManager.
EP_CGSCCOptimizerLate,
/// EP_FullLinkTimeOptimizationEarly - This extensions point allow adding
/// passes that
/// run at Link Time, before Full Link Time Optimization.
EP_FullLinkTimeOptimizationEarly,
/// EP_FullLinkTimeOptimizationLast - This extensions point allow adding
/// passes that
/// run at Link Time, after Full Link Time Optimization.
EP_FullLinkTimeOptimizationLast,
};
/// The Optimization Level - Specify the basic optimization level.

View File

@ -1016,6 +1016,8 @@ void PassManagerBuilder::populateLTOPassManager(legacy::PassManagerBase &PM) {
if (VerifyInput)
PM.add(createVerifierPass());
addExtensionsToPM(EP_FullLinkTimeOptimizationEarly, PM);
if (OptLevel != 0)
addLTOOptimizationPasses(PM);
else {
@ -1037,6 +1039,8 @@ void PassManagerBuilder::populateLTOPassManager(legacy::PassManagerBase &PM) {
if (OptLevel != 0)
addLateLTOOptimizationPasses(PM);
addExtensionsToPM(EP_FullLinkTimeOptimizationLast, PM);
if (VerifyOutput)
PM.add(createVerifierPass());
}