[PATCH] D15258: [PGO] Remove data races on Data->Values field

David Li via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 11 10:32:43 PST 2015


davidxl updated this revision to Diff 42541.
davidxl added a comment.

[Update the patch according to Betul's feedback)

By removing the dependency on ->Values field from the reader, the runtime patch now becomes quite clean. Lots of unnecessary things are removed:

1. The value profile data no longer needs to be put into an contiguous array before writing (as there will no relocation needed at read time)
2. This removes the need to compute the total size ahead of time.
3. It eliminates the problem of possible dropping of hot value sites due to updates from other threads
4. It eliminates the need to reserve extra bytes for buffer, thus the need to set reserved space at runtime
5. It greatly simplifies dumping -- there will be no need for two pass data collection -- one for total size, one for actual data collect.

The only major interface change is the data gathering interface -- it will now gather an array of pointers to ValueProfData objects instead of a pointer to the contiguous array.


http://reviews.llvm.org/D15258

Files:
  lib/profile/InstrProfiling.h
  lib/profile/InstrProfilingFile.c
  lib/profile/InstrProfilingInternal.h
  lib/profile/InstrProfilingValue.c
  lib/profile/InstrProfilingWriter.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15258.42541.patch
Type: text/x-patch
Size: 11599 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151211/6a17a9e8/attachment.bin>


More information about the llvm-commits mailing list