[clang] [flang] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)
Tom Eccles via cfe-commits
cfe-commits at lists.llvm.org
Sat Apr 26 03:03:43 PDT 2025
================
@@ -148,6 +148,55 @@ class CodeGenOptions : public CodeGenOptionsBase {
/// OpenMP is enabled.
using DoConcurrentMappingKind = flangomp::DoConcurrentMappingKind;
+ enum ProfileInstrKind {
+ ProfileNone, // Profile instrumentation is turned off.
+ ProfileClangInstr, // Clang instrumentation to generate execution counts
+ // to use with PGO.
+ ProfileIRInstr, // IR level PGO instrumentation in LLVM.
+ ProfileCSIRInstr, // IR level PGO context sensitive instrumentation in LLVM.
+ };
+
+
+ /// Name of the profile file to use as output for -fprofile-instr-generate,
+ /// -fprofile-generate, and -fcs-profile-generate.
+ std::string InstrProfileOutput;
+
+ /// Name of the profile file to use as input for -fmemory-profile-use.
+ std::string MemoryProfileUsePath;
+
+ unsigned int DebugInfoForProfiling;
+
+ unsigned int AtomicProfileUpdate;
----------------
tblah wrote:
Sorry what I meant was that doesn't CodeGenOptions.def already add class members you could use? Or have I misunderstood the changes?
https://github.com/llvm/llvm-project/pull/136098
More information about the cfe-commits
mailing list