Let += and -= operators in BranchProbability have saturation behaviors.
authorCong Hou <congh@google.com>
Wed, 18 Nov 2015 01:20:37 +0000 (01:20 +0000)
committerCong Hou <congh@google.com>
Wed, 18 Nov 2015 01:20:37 +0000 (01:20 +0000)
commit7b4feef4008452496f53f0da34b1e72fb3658a81
tree91c63665fe33175f19ac7dcb12757c65a2eab8b3
parent01400f4e22a2f05c9d0ab175a55eddabc7f81b87
Let += and -= operators in BranchProbability have saturation behaviors.

This commit is for a later patch that is depend on it. The sum of two
branch probabilities can be greater than 1 due to rounding. It is safer
to saturate the results of sum and subtraction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253421 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/BranchProbability.h