[llvm-profdata] Add support for weighted merge of profile data (2nd try)
authorNathan Slingerland <slingn@gmail.com>
Tue, 15 Dec 2015 17:37:09 +0000 (17:37 +0000)
committerNathan Slingerland <slingn@gmail.com>
Tue, 15 Dec 2015 17:37:09 +0000 (17:37 +0000)
commit824c3eccffcd018f624bda8224c5aa946253a163
treed0f619af27d2d70338e06181de0020ef7830d77a
parent44c3e26b9596ba117968d5d94ef1f2ac8fe7cb86
[llvm-profdata] Add support for weighted merge of profile data (2nd try)

Summary:
This change adds support for specifying a weight when merging profile data with the llvm-profdata tool.
Weights are specified by using the --weighted-input=<weight>,<filename> option. Input files not specified
with this option (normal positional list after options) are given a default weight of 1.

Adding support for arbitrary weighting of input profile data allows for relative importance to be placed on the
input data from multiple training runs.

Both sampled and instrumented profiles are supported.

Reviewers: davidxl, dnovillo, bogner, silvas

Subscribers: silvas, davidxl, llvm-commits

Differential Revision: http://reviews.llvm.org/D15306

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255659 91177308-0d34-0410-b5e6-96231b3b80d8
14 files changed:
docs/CommandGuide/llvm-profdata.rst
include/llvm/ProfileData/InstrProf.h
include/llvm/ProfileData/InstrProfWriter.h
include/llvm/ProfileData/SampleProf.h
lib/ProfileData/InstrProfWriter.cpp
test/tools/llvm-profdata/Inputs/weight-instr-bar.profdata [new file with mode: 0644]
test/tools/llvm-profdata/Inputs/weight-instr-foo.profdata [new file with mode: 0644]
test/tools/llvm-profdata/Inputs/weight-sample-bar.proftext [new file with mode: 0644]
test/tools/llvm-profdata/Inputs/weight-sample-foo.proftext [new file with mode: 0644]
test/tools/llvm-profdata/text-format-errors.test
test/tools/llvm-profdata/weight-instr.test [new file with mode: 0644]
test/tools/llvm-profdata/weight-sample.test [new file with mode: 0644]
tools/llvm-profdata/llvm-profdata.cpp
unittests/ProfileData/InstrProfTest.cpp