[llvm-profdata] Add SaturatingAdd/SaturatingMultiply Helper Functions
authorNathan Slingerland <slingn@gmail.com>
Wed, 18 Nov 2015 00:52:43 +0000 (00:52 +0000)
committerNathan Slingerland <slingn@gmail.com>
Wed, 18 Nov 2015 00:52:43 +0000 (00:52 +0000)
commit4918b66f8428f0d5b4559da8f966e3aa54c3b1ba
tree800b5fcf691709ec6737139e77152e73d33635d2
parent9eaef595284c567310bc6f0009f83d77a554b881
[llvm-profdata] Add SaturatingAdd/SaturatingMultiply Helper Functions

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.

No functional changes.

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@253412 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ProfileData/InstrProf.h
include/llvm/ProfileData/SampleProf.h
include/llvm/Support/MathExtras.h
unittests/Support/MathExtrasTest.cpp