[llvm] [SampleFDO] Support enabling sample loader pass in O0 mode (PR #113985)

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 1 14:37:07 PDT 2024


================
@@ -2153,6 +2153,17 @@ PassBuilder::buildO0DefaultPipeline(OptimizationLevel Level,
   if (PGOOpt && PGOOpt->DebugInfoForProfiling)
     MPM.addPass(createModuleToFunctionPassAdaptor(AddDiscriminatorsPass()));
 
+  if (PGOOpt && PGOOpt->Action == PGOOptions::SampleUse) {
+    // Explicitly disable sample loader inlining in O0 pipeline.
+    MPM.addPass(SampleProfileLoaderPass(PGOOpt->ProfileFile,
+                                        PGOOpt->ProfileRemappingFile,
+                                        ThinOrFullLTOPhase::None, nullptr,
+                                        /*DisableSampleProfileInlining*/ true));
----------------
MatzeB wrote:

I prefer `/*xxx=*/yyy` syntax as that can be check with clang-tidy (yes that clang-tidy check is not enabled for LLVM at the moment, but I hope someday we will :) )
```suggestion
                                        /*DisableSampleProfileInlining=*/true));
```

https://github.com/llvm/llvm-project/pull/113985


More information about the llvm-commits mailing list