[clang] [Profile] Add binary profile correlation to offload profile metadata at runtime. (PR #69493)

David Li via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 19 10:20:05 PDT 2023


================
@@ -61,9 +64,20 @@ uint64_t __llvm_profile_get_num_data(const __llvm_profile_data *Begin,
 COMPILER_RT_VISIBILITY
 uint64_t __llvm_profile_get_data_size(const __llvm_profile_data *Begin,
                                       const __llvm_profile_data *End) {
+  if ((__llvm_profile_get_version() & VARIANT_MASK_DBG_CORRELATE) ||
+      (__llvm_profile_get_version() & VARIANT_MASK_BIN_CORRELATE))
+    return 0;
   return __llvm_profile_get_num_data(Begin, End) * sizeof(__llvm_profile_data);
 }
 
+COMPILER_RT_VISIBILITY
+uint64_t __llvm_profile_get_name_size(const char *Begin, const char *End) {
+  if ((__llvm_profile_get_version() & VARIANT_MASK_DBG_CORRELATE) ||
----------------
david-xl wrote:

here

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


More information about the cfe-commits mailing list