[PATCH] D44847: [profile] Fix value profile runtime merging issues

Rong Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 23 15:12:59 PDT 2018


xur added inline comments.


================
Comment at: lib/profile/InstrProfilingFile.c:230
+  // (which can leave garbage at the end of profile file).
+  if (!VPMergeHook)
+    truncate(ProfileFileName, 0);
----------------
davidxl wrote:
> non value profiling data has fixed size, so why is this needed?
Because there are still value counts in both in-memory and in-disk profiles.

Using the test in the patch as the example (running on my machine).
assuming the binary is named as 'gen' and VPMergeHook null.

if we don't do online merge,
"gen" will generate a profile of size 320 bytes.
"gen 1" will generate a profile with size of 352 bytes

If we run "gen 1 && gen", the result binary is still 352 bytes.
But the effective size is 320 bytes. The tail 32 bytes are trash.




https://reviews.llvm.org/D44847





More information about the llvm-commits mailing list