[clang] [flang] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 28 04:32:04 PDT 2025
================
@@ -130,6 +133,20 @@ static bool saveMLIRTempFile(const CompilerInvocation &ci,
// Custom BeginSourceFileAction
//===----------------------------------------------------------------------===//
+
+static llvm::cl::opt<llvm::PGOOptions::ColdFuncOpt> ClPGOColdFuncAttr(
----------------
fanju110 wrote:
> Adding a proper frontend driver option to both frontends is the best way forward.
Do you mean to let flang and clang reuse this definition? But this code of yours is defined in clang, and I need to let Flang link Clang's `BackendUtil.cpp`, which may cause some problems. So I put this definition in llvm namespace : `llvm/Frontend/Driver/CodeGenOptions.h`.This way I don't need to copy the code all over again in flang. What do you think about this?
https://github.com/llvm/llvm-project/pull/136098
More information about the cfe-commits
mailing list