[llvm-profdata] Improve error messaging when merging mismatched profile data
authorNathan Slingerland <slingn@gmail.com>
Tue, 17 Nov 2015 22:08:53 +0000 (22:08 +0000)
committerNathan Slingerland <slingn@gmail.com>
Tue, 17 Nov 2015 22:08:53 +0000 (22:08 +0000)
commit0833ccb526c74402438bfc5f5a79606de9991156
treeda3bebd440e0066196316383105eed005fb7001f
parentd82a1c70eb2d088855d36c829dbaa81aff8c80ac
[llvm-profdata] Improve error messaging when merging mismatched profile data

Summary:
This change tries to make the root cause of instrumented profile data merge failures clearer.

Previous:

$ llvm-profdata merge test_0.profraw test_1.profraw -o test_merged.profdata
test_1.profraw: foo: Function count mismatch
test_1.profraw: bar: Function count mismatch
test_1.profraw: baz: Function count mismatch
...

Changed:

$ llvm-profdata merge test_0.profraw test_1.profraw -o test_merged.profdata
test_1.profraw: foo: Function basic block count change detected (counter mismatch)
Make sure that all profile data to be merged is generated from the same binary.
test_1.profraw: bar: Function basic block count change detected (counter mismatch)
test_1.profraw: baz: Function basic block count change detected (counter mismatch)
...

Reviewers: dnovillo, davidxl, bogner

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253384 91177308-0d34-0410-b5e6-96231b3b80d8
lib/ProfileData/InstrProf.cpp
test/tools/llvm-profdata/count-mismatch.proftext
tools/llvm-profdata/llvm-profdata.cpp