|
17 | 17 | #include "llvm/ADT/Statistic.h"
|
18 | 18 | #include "llvm/Analysis/AliasAnalysis.h"
|
19 | 19 | #include "llvm/Analysis/BasicAliasAnalysis.h"
|
| 20 | +#include "llvm/Analysis/CFFunctionAnalysis.h" |
20 | 21 | #include "llvm/Analysis/CGSCCPassManager.h"
|
21 | 22 | #include "llvm/Analysis/GlobalsModRef.h"
|
22 | 23 | #include "llvm/Analysis/InlineAdvisor.h"
|
|
123 | 124 | #include "llvm/Transforms/Scalar/WarnMissedTransforms.h"
|
124 | 125 | #include "llvm/Transforms/Utils/AddDiscriminators.h"
|
125 | 126 | #include "llvm/Transforms/Utils/AssumeBundleBuilder.h"
|
| 127 | +#include "llvm/Transforms/Utils/CFFunctionInstrumentation.h" |
126 | 128 | #include "llvm/Transforms/Utils/CanonicalizeAliases.h"
|
127 | 129 | #include "llvm/Transforms/Utils/CountVisits.h"
|
128 |
| -#include "llvm/Transforms/Utils/CFFunctionInstrumentation.h" |
129 | 130 | #include "llvm/Transforms/Utils/InjectTLIMappings.h"
|
130 | 131 | #include "llvm/Transforms/Utils/LibCallsShrinkWrap.h"
|
131 | 132 | #include "llvm/Transforms/Utils/Mem2Reg.h"
|
@@ -181,9 +182,9 @@ static cl::opt<bool> EnablePostPGOLoopRotation(
|
181 | 182 | "enable-post-pgo-loop-rotation", cl::init(true), cl::Hidden,
|
182 | 183 | cl::desc("Run the loop rotation transformation after PGO instrumentation"));
|
183 | 184 |
|
184 |
| -static cl::opt<bool> EnableGlobalAnalyses( |
185 |
| - "enable-global-analyses", cl::init(true), cl::Hidden, |
186 |
| - cl::desc("Enable inter-procedural analyses")); |
| 185 | +static cl::opt<bool> |
| 186 | + EnableGlobalAnalyses("enable-global-analyses", cl::init(true), cl::Hidden, |
| 187 | + cl::desc("Enable inter-procedural analyses")); |
187 | 188 |
|
188 | 189 | static cl::opt<bool>
|
189 | 190 | RunPartialInlining("enable-partial-inlining", cl::init(false), cl::Hidden,
|
@@ -1084,11 +1085,10 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
|
1084 | 1085 | // and prior to optimizing globals.
|
1085 | 1086 | // FIXME: This position in the pipeline hasn't been carefully considered in
|
1086 | 1087 | // years, it should be re-analyzed.
|
1087 |
| - MPM.addPass(IPSCCPPass( |
1088 |
| - IPSCCPOptions(/*AllowFuncSpec=*/ |
1089 |
| - Level != OptimizationLevel::Os && |
1090 |
| - Level != OptimizationLevel::Oz && |
1091 |
| - !isLTOPreLink(Phase)))); |
| 1088 | + MPM.addPass(IPSCCPPass(IPSCCPOptions(/*AllowFuncSpec=*/ |
| 1089 | + Level != OptimizationLevel::Os && |
| 1090 | + Level != OptimizationLevel::Oz && |
| 1091 | + !isLTOPreLink(Phase)))); |
1092 | 1092 |
|
1093 | 1093 | // Attach metadata to indirect call sites indicating the set of functions
|
1094 | 1094 | // they may target at run-time. This should follow IPSCCP.
|
@@ -1498,6 +1498,7 @@ PassBuilder::buildPerModuleDefaultPipeline(OptimizationLevel Level,
|
1498 | 1498 |
|
1499 | 1499 | ModulePassManager MPM;
|
1500 | 1500 |
|
| 1501 | + MPM.addPass(CFFunctionAnalysisStorePass("cffunction-analysis-store.txt")); |
1501 | 1502 | MPM.addPass(CFFunctionInstrumentationPass());
|
1502 | 1503 |
|
1503 | 1504 | // Convert @llvm.global.annotations to !annotation metadata.
|
@@ -1559,7 +1560,7 @@ PassBuilder::buildFatLTODefaultPipeline(OptimizationLevel Level, bool ThinLTO,
|
1559 | 1560 | ModulePassManager
|
1560 | 1561 | PassBuilder::buildThinLTOPreLinkDefaultPipeline(OptimizationLevel Level) {
|
1561 | 1562 | if (Level == OptimizationLevel::O0)
|
1562 |
| - return buildO0DefaultPipeline(Level, /*LTOPreLink*/true); |
| 1563 | + return buildO0DefaultPipeline(Level, /*LTOPreLink*/ true); |
1563 | 1564 |
|
1564 | 1565 | ModulePassManager MPM;
|
1565 | 1566 |
|
|
0 commit comments