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

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 16 13:52:42 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);
----------------
snehasish wrote:

I don't follow the math for the numerator. Can you add a comment to explain?

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


More information about the llvm-commits mailing list