[compiler-rt] [llvm] [TypeProf][InstrPGO] Introduce raw and instr profile format change for type profiling. (PR #81691)

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 20 16:50:02 PST 2024


================
@@ -71,6 +75,19 @@ uint64_t __llvm_profile_get_data_size(const __llvm_profile_data *Begin,
   return __llvm_profile_get_num_data(Begin, End) * sizeof(__llvm_profile_data);
 }
 
+COMPILER_RT_VISIBILITY
+uint64_t __llvm_profile_get_num_vtable(const VTableProfData *Begin,
+                                       const VTableProfData *End) {
+  intptr_t EndI = (intptr_t)End, BeginI = (intptr_t)Begin;
+  return (EndI + sizeof(VTableProfData) - 1 - BeginI) / sizeof(VTableProfData);
----------------
minglotus-6 wrote:

Or rather, I wonder if I shall make `__llvm_profile_get_num_vtable` and `__llvm_profile_get_num_data` consistent (both should use `sizeof(c struct) - 1` or both should not use them).



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


More information about the llvm-commits mailing list