[flang-commits] [clang] [flang] [Flang][Driver]Add support for option '-fpseudo-probe-for-profiling' in flang (PR #205046)
Tarun Prabhu via flang-commits
flang-commits at lists.llvm.org
Mon Jun 22 07:31:47 PDT 2026
================
@@ -995,7 +995,13 @@ void CodeGenAction::runOptimizationPipeline(llvm::raw_pwrite_stream &os) {
opts.SampleProfileFile, "", opts.ProfileRemappingFile,
opts.MemoryProfileUsePath, llvm::PGOOptions::SampleUse,
llvm::PGOOptions::NoCSAction, llvm::PGOOptions::ColdFuncOpt::Default,
- opts.DebugInfoForProfiling, /*PseudoProbeForProfiling=*/false);
+ opts.DebugInfoForProfiling, opts.PseudoProbeForProfiling);
+ } else if (opts.PseudoProbeForProfiling) {
+ // -fpseudo-probe-for-profiling
+ pgoOpt = llvm::PGOOptions(
+ "", "", "", /*MemoryProfile=*/"", llvm::PGOOptions::NoAction,
+ llvm::PGOOptions::NoCSAction, llvm::PGOOptions::ColdFuncOpt::Default,
+ opts.DebugInfoForProfiling, true);
----------------
tarunprabhu wrote:
It may be good to annotate the arguments with their corresponding parameter names. I have done so for the last `true`. The same should be done for the first three empty strings that are being passed.
```suggestion
"", "", "", /*MemoryProfile=*/"", llvm::PGOOptions::NoAction,
llvm::PGOOptions::NoCSAction, llvm::PGOOptions::ColdFuncOpt::Default,
opts.DebugInfoForProfiling, /*PseudoProbeForProfiling=*/true);
```
https://github.com/llvm/llvm-project/pull/205046
More information about the flang-commits
mailing list