[clang] [flang] [llvm] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

David Truby via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 28 06:16:31 PDT 2025


================
@@ -892,6 +909,20 @@ static void generateMachineCodeOrAssemblyImpl(clang::DiagnosticsEngine &diags,
   delete tlii;
 }
 
+
+// Default filename used for profile generation.
+namespace llvm {
+  extern llvm::cl::opt<bool> DebugInfoCorrelate;
+  extern llvm::cl::opt<InstrProfCorrelator::ProfCorrelatorKind> ProfileCorrelate;
+
+
+std::string getDefaultProfileGenName() {
----------------
DavidTruby wrote:

You can change the source of clang to move that function to e.g. `llvm/lib/Frontend/Driver/CodeGenOptions.cpp` and use it from that location from both clang and flang. We've done that in a few different places for options like these (like `createTLII` as @tarunprabhu mentioned)

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


More information about the cfe-commits mailing list