[compiler-rt] Fixed __llvm_profile_write_buffer in presence of ValueProfileData. (PR #97350)

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 2 17:24:33 PDT 2024


================
@@ -214,6 +221,37 @@ static int writeOneValueProfData(ProfBufferIO *BufferIO,
   return 0;
 }
 
+/* Compute size of VPData, without actually writing it. This function follows
+ * the logic of writeValueProfData below it. It is used for predicting how big
+ * a buffer is needed to store the ValueProfileData.
----------------
minglotus-6 wrote:

nit: If possible, introduce a common helper function and call it from both `__llvm_profile_getSizeOfValueProfData` and `writeValueProfData` to de-duplicate logic. 

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


More information about the llvm-commits mailing list