Skip to content

Commit 3111262

Browse files
committed
add store pass to O3
1 parent 2112adc commit 3111262

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

llvm/lib/Passes/PassBuilderPipelines.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "llvm/ADT/Statistic.h"
1818
#include "llvm/Analysis/AliasAnalysis.h"
1919
#include "llvm/Analysis/BasicAliasAnalysis.h"
20+
#include "llvm/Analysis/CFFunctionAnalysis.h"
2021
#include "llvm/Analysis/CGSCCPassManager.h"
2122
#include "llvm/Analysis/GlobalsModRef.h"
2223
#include "llvm/Analysis/InlineAdvisor.h"
@@ -123,9 +124,9 @@
123124
#include "llvm/Transforms/Scalar/WarnMissedTransforms.h"
124125
#include "llvm/Transforms/Utils/AddDiscriminators.h"
125126
#include "llvm/Transforms/Utils/AssumeBundleBuilder.h"
127+
#include "llvm/Transforms/Utils/CFFunctionInstrumentation.h"
126128
#include "llvm/Transforms/Utils/CanonicalizeAliases.h"
127129
#include "llvm/Transforms/Utils/CountVisits.h"
128-
#include "llvm/Transforms/Utils/CFFunctionInstrumentation.h"
129130
#include "llvm/Transforms/Utils/InjectTLIMappings.h"
130131
#include "llvm/Transforms/Utils/LibCallsShrinkWrap.h"
131132
#include "llvm/Transforms/Utils/Mem2Reg.h"
@@ -181,9 +182,9 @@ static cl::opt<bool> EnablePostPGOLoopRotation(
181182
"enable-post-pgo-loop-rotation", cl::init(true), cl::Hidden,
182183
cl::desc("Run the loop rotation transformation after PGO instrumentation"));
183184

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"));
187188

188189
static cl::opt<bool>
189190
RunPartialInlining("enable-partial-inlining", cl::init(false), cl::Hidden,
@@ -1084,11 +1085,10 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
10841085
// and prior to optimizing globals.
10851086
// FIXME: This position in the pipeline hasn't been carefully considered in
10861087
// 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))));
10921092

10931093
// Attach metadata to indirect call sites indicating the set of functions
10941094
// they may target at run-time. This should follow IPSCCP.
@@ -1498,6 +1498,7 @@ PassBuilder::buildPerModuleDefaultPipeline(OptimizationLevel Level,
14981498

14991499
ModulePassManager MPM;
15001500

1501+
MPM.addPass(CFFunctionAnalysisStorePass("cffunction-analysis-store.txt"));
15011502
MPM.addPass(CFFunctionInstrumentationPass());
15021503

15031504
// Convert @llvm.global.annotations to !annotation metadata.
@@ -1559,7 +1560,7 @@ PassBuilder::buildFatLTODefaultPipeline(OptimizationLevel Level, bool ThinLTO,
15591560
ModulePassManager
15601561
PassBuilder::buildThinLTOPreLinkDefaultPipeline(OptimizationLevel Level) {
15611562
if (Level == OptimizationLevel::O0)
1562-
return buildO0DefaultPipeline(Level, /*LTOPreLink*/true);
1563+
return buildO0DefaultPipeline(Level, /*LTOPreLink*/ true);
15631564

15641565
ModulePassManager MPM;
15651566

0 commit comments

Comments
 (0)