[llvm-profdata] Change instr prof counter overflow to saturate rather than discard
authorNathan Slingerland <slingn@gmail.com>
Wed, 2 Dec 2015 18:19:24 +0000 (18:19 +0000)
committerNathan Slingerland <slingn@gmail.com>
Wed, 2 Dec 2015 18:19:24 +0000 (18:19 +0000)
commit1c2b998913d05c83a781da1a15738ac4c9379f6f
tree094a24ef57567744d8eb499a24f8aa7d13044ba3
parent57b1a9599b8b3a3c571103ed481932c2768d8da9
[llvm-profdata] Change instr prof counter overflow to saturate rather than discard

Summary: This changes overflow handling during instrumentation profile merge. Rathar than throwing away records that would result in counter overflow, merged counts are instead clamped to the maximum representable value. A warning about counter overflow is still surfaced to the user as before.

Reviewers: dnovillo, davidxl, silvas

Subscribers: llvm-commits

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

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