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

Tarun Prabhu via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 22 07:54: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() {
----------------
tarunprabhu wrote:

This looks like a duplicate of the code in I think this function definition could be moved to `llvm/lib/Frontend/Driver/CodeGenOptions.cpp` or somewhere within llvm/lib/Frontend. There is precedent for doing this with, for example, `createTLII`. In general, we would like to avoid duplicating code from `clang` as much as possible.

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


More information about the cfe-commits mailing list