[PGO] Value profiling (index format) code cleanup and testing
authorXinliang David Li <davidxl@google.com>
Mon, 2 Nov 2015 05:08:23 +0000 (05:08 +0000)
committerXinliang David Li <davidxl@google.com>
Mon, 2 Nov 2015 05:08:23 +0000 (05:08 +0000)
commit61c7e68339b15eb0b9d4f3cfe2e48ebd23e60c40
treecaa2d5a6db10f01e1be62c0c1dcf24315315ea95
parent15465ea1a2de1290e7a4f695a5d57039f7c76796
[PGO] Value profiling (index format) code cleanup and testing

 1. Added a set of public interfaces in InstrProfRecord
    class to access (read/write) value profile data.
 2. Changed IndexedProfile reader and writer code to
    use the newly defined interfaces and hide implementation
    details.
 3. Added a couple of unittests for value profiling:
   - Test new interfaces to get and set value profile data
   - Test value profile data merging with various scenarios.

 No functional change is expected. The new interfaces will also
 make it possible to change on-disk format of value prof data
 to be more compact (to be submitted).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251771 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ProfileData/InstrProf.h
include/llvm/ProfileData/InstrProfReader.h
lib/ProfileData/InstrProfReader.cpp
lib/ProfileData/InstrProfWriter.cpp
tools/llvm-profdata/llvm-profdata.cpp
unittests/ProfileData/InstrProfTest.cpp