[llvm-profdata] Add support for weighted merge of profile data
authorNathan Slingerland <slingn@gmail.com>
Fri, 4 Dec 2015 00:00:20 +0000 (00:00 +0000)
committerNathan Slingerland <slingn@gmail.com>
Fri, 4 Dec 2015 00:00:20 +0000 (00:00 +0000)
commitb7250858d96b8ce567681214273ac0e62713c661
tree48bc628bc2143ee86fe13b3ea3dbab70a4966f9a
parent7008dd751d0660fee014bb2fcc31c92eb540faa4
[llvm-profdata] Add support for weighted merge of profile data

This change adds support for an optional weight when merging profile data with the llvm-profdata tool.
Weights are specified by adding an option ':<weight>' suffix to the input file names.

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: dnovillo, bogner, davidxl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254669 91177308-0d34-0410-b5e6-96231b3b80d8
13 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/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