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

Snehasish Kumar via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 27 14:56:29 PST 2023


================
@@ -100,12 +103,6 @@ ValueProfNode *__llvm_profile_begin_vnodes();
 ValueProfNode *__llvm_profile_end_vnodes();
 uint32_t *__llvm_profile_begin_orderfile();
 
-/*!
- * \brief Clear profile counters to zero.
- *
- */
-void __llvm_profile_reset_counters(void);
----------------
snehasish wrote:

Ok, if we don't want to expose the internals then the existing approach seems like the simplest one. I think @davidxl's comment in the discourse thread is about ensuring no control flow changes in profile gen and use in hot code paths. This does not necessarily preclude additional wrappers. 

> Update: I think the explicit definition needs to be guarded by an #ifndef.
Yes, I misread the original as `#ifdef` causing some confusion. This should also be `#undef` afterwards. I was thinking about churn for existing users of InstrProfiling.h but it should be a no-op.

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


More information about the cfe-commits mailing list