Skip to content

Commit 42ad7e1

Browse files
committed
[CSSPGO] Turn off PseudoProbeUpdatePass for non-FDO builds.
PseudoProbeUpdatePass is used to distribute sample counts among dulplicated probes. It doesn't make sense for it to run without a sample profile. The pass takes 1% of the build time. Reviewed By: wenlei Differential Revision: https://reviews.llvm.org/D111847
1 parent a1e78ae commit 42ad7e1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/lib/Passes/PassBuilderPipelines.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,8 @@ PassBuilder::buildPerModuleDefaultPipeline(OptimizationLevel Level,
12021202
// Now add the optimization pipeline.
12031203
MPM.addPass(buildModuleOptimizationPipeline(Level, LTOPreLink));
12041204

1205-
if (PGOOpt && PGOOpt->PseudoProbeForProfiling)
1205+
if (PGOOpt && PGOOpt->PseudoProbeForProfiling &&
1206+
PGOOpt->Action == PGOOptions::SampleUse)
12061207
MPM.addPass(PseudoProbeUpdatePass());
12071208

12081209
// Emit annotation remarks.
@@ -1258,7 +1259,8 @@ PassBuilder::buildThinLTOPreLinkDefaultPipeline(OptimizationLevel Level) {
12581259
// on these, we schedule the cleanup here.
12591260
MPM.addPass(createModuleToFunctionPassAdaptor(CoroCleanupPass()));
12601261

1261-
if (PGOOpt && PGOOpt->PseudoProbeForProfiling)
1262+
if (PGOOpt && PGOOpt->PseudoProbeForProfiling &&
1263+
PGOOpt->Action == PGOOptions::SampleUse)
12621264
MPM.addPass(PseudoProbeUpdatePass());
12631265

12641266
// Handle OptimizerLastEPCallbacks added by clang on PreLink. Actual

0 commit comments

Comments
 (0)