diff options
author | Xinliang David Li <davidxl@google.com> | 2016-01-08 05:45:21 +0000 |
---|---|---|
committer | Xinliang David Li <davidxl@google.com> | 2016-01-08 05:45:21 +0000 |
commit | 062cde9cc39714089346f92df0c33c4345b577dd (patch) | |
tree | 3ce036b29c9e724e842c7364ceedb22e3e29f35d /llvm/lib/ProfileData | |
parent | aa9243a25d523279f315ae31b2d6d3f9d83dad98 (diff) | |
download | bcm5719-llvm-062cde9cc39714089346f92df0c33c4345b577dd.tar.gz bcm5719-llvm-062cde9cc39714089346f92df0c33c4345b577dd.zip |
[PGO] Ensure vp data in indexed profile always sorted
Done in InstrProfWriter to eliminate the need for client
code to do the sorting. The operation is done once and reused
many times so it is more efficient. Update unit test to remove
sorting. Also update expected output of affected tests.
llvm-svn: 257145
Diffstat (limited to 'llvm/lib/ProfileData')
-rw-r--r-- | llvm/lib/ProfileData/InstrProfWriter.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/ProfileData/InstrProfWriter.cpp b/llvm/lib/ProfileData/InstrProfWriter.cpp index 07667e1221e..f5227248af2 100644 --- a/llvm/lib/ProfileData/InstrProfWriter.cpp +++ b/llvm/lib/ProfileData/InstrProfWriter.cpp @@ -117,6 +117,8 @@ std::error_code InstrProfWriter::addRecord(InstrProfRecord &&I, Result = Dest.merge(I, Weight); } + Dest.sortValueData(); + // We keep track of the max function count as we go for simplicity. // Update this statistic no matter the result of the merge. if (Dest.Counts[0] > MaxFunctionCount) |