[PGO] Fix a bug in InstProfWriter addRecord
authorXinliang David Li <davidxl@google.com>
Fri, 8 Jan 2016 03:49:59 +0000 (03:49 +0000)
committerXinliang David Li <davidxl@google.com>
Fri, 8 Jan 2016 03:49:59 +0000 (03:49 +0000)
commit4f87d1237a5336568da44bc23d5654b1ed2168ff
tree96d2975136b300f5ff6e61abd8d35bbf05a76b58
parent3569d3c5ebfff8b9b20c47e7eb1ddf508e6e9bbf
[PGO] Fix a bug in InstProfWriter addRecord

For a new record with weight != 1, only edge profiling
counters are scaled, VP data is not properly scaled.

This patch refactors the code and fixes the problem.
Also added sort by count interface (for follow up patch).

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