[clang] [clang-tools-extra] [compiler-rt] [PGO] Exposing PGO's Counter Reset and File Dumping APIs (PR #76471)

Qiongsi Wu via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 28 06:49:22 PST 2023


================
@@ -1364,12 +1364,22 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
   TI.getTargetDefines(LangOpts, Builder);
 }
 
+static void InitializePGOProfileMacros(const CodeGenOptions &CodeGenOpts,
----------------
qiongsiwu wrote:

This [comment](https://discourse.llvm.org/t/pgo-are-the-llvm-profile-functions-stable-c-apis-across-llvm-releases/75832/7?u=qwu_ibm) seems to indicate that such macros are useful, in addition to the reason that the compiler adding these macros can make the user program cleaner (user can now avoid wrapping these PGO calls or guarding them with macros). This PR does not change the current behaviour of `compiler-rt/lib/profile/InstrProfiling.h` so the user still has the freedom to use their own macros (or use the weak symbol mechanism).

Does this sound reasonable so we keep the macros? If not, I can split this into two PRs.  

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


More information about the cfe-commits mailing list