================
@@ -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) {
----------------
kaviya2510 wrote:
My implementation order deviated from clang's implementation. In Clang, the
order is:
1. hasProfileIRInstr() → -fprofile-generate
2. hasProfileIRUse() → -fprofile-use
3. !SampleProfileFile.empty() → -fprofile-sample-use
4. !MemoryProfileUsePath.empty() → -fmemory-profile-use
5. PseudoProbeForProfiling → -fpseudo-probe-for-profiling
6. DebugInfoForProfiling → -fdebug-info-for-profiling
In clang, `DebugInfoForProfiling` is checked last as it coexist with other
options. So when both the flags are specified `-fdebug-info-for-profiling
-fpseudo-probe-for-profiling` , PseudoProbeForProfiling branch is taken and
DebugInfoForProfiling also honoured via `opts.DebugInfoForProfiling`.
I modified the implementation similar to the ordering in Clang.
https://github.com/llvm/llvm-project/pull/205046
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits