[llvm-profdata] Add SaturatingAdd/SaturatingMultiply Helper Functions (2nd try)
authorNathan Slingerland <slingn@gmail.com>
Wed, 18 Nov 2015 20:40:41 +0000 (20:40 +0000)
committerNathan Slingerland <slingn@gmail.com>
Wed, 18 Nov 2015 20:40:41 +0000 (20:40 +0000)
commit156d5ee497ef9b6b08bad403f66c52bb15887db9
treefc4f8319570c3b72f19f746f6172fde4061975ad
parent985201d38ceb7ddca755ae0b945327a5833255a4
[llvm-profdata] Add SaturatingAdd/SaturatingMultiply Helper Functions (2nd try)

Summary:
This change adds MathExtras helper functions for handling unsigned, saturating addition and multiplication. It also updates the instrumentation and sample profile merge implementations to use them.

Reviewers: dnovillo, bogner, davidxl

Subscribers: davidxl, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253497 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ProfileData/InstrProf.h
include/llvm/ProfileData/SampleProf.h
include/llvm/Support/MathExtras.h
unittests/ProfileData/InstrProfTest.cpp
unittests/Support/MathExtrasTest.cpp