[PATCH] D111847: [CSSPGO] Turn off PseudoProbeUpdatePass for non-FDO builds.

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 14 15:33:12 PDT 2021


hoy created this revision.
Herald added subscribers: modimo, wenlei, hiraditya.
hoy requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D111847

Files:
  llvm/lib/Passes/PassBuilderPipelines.cpp


Index: llvm/lib/Passes/PassBuilderPipelines.cpp
===================================================================
--- llvm/lib/Passes/PassBuilderPipelines.cpp
+++ llvm/lib/Passes/PassBuilderPipelines.cpp
@@ -1202,7 +1202,7 @@
   // Now add the optimization pipeline.
   MPM.addPass(buildModuleOptimizationPipeline(Level, LTOPreLink));
 
-  if (PGOOpt && PGOOpt->PseudoProbeForProfiling)
+  if (PGOOpt && PGOOpt->PseudoProbeForProfiling && PGOOpt->Action == PGOOptions::SampleUse)
     MPM.addPass(PseudoProbeUpdatePass());
 
   // Emit annotation remarks.
@@ -1258,7 +1258,7 @@
   // on these, we schedule the cleanup here.
   MPM.addPass(createModuleToFunctionPassAdaptor(CoroCleanupPass()));
 
-  if (PGOOpt && PGOOpt->PseudoProbeForProfiling)
+  if (PGOOpt && PGOOpt->PseudoProbeForProfiling && PGOOpt->Action == PGOOptions::SampleUse)
     MPM.addPass(PseudoProbeUpdatePass());
 
   // Handle OptimizerLastEPCallbacks added by clang on PreLink. Actual


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111847.379867.patch
Type: text/x-patch
Size: 958 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211014/698b4bc7/attachment.bin>


More information about the llvm-commits mailing list