[PATCH] D12295: Use BranchProbability::scale() to scale an integer with a probability in ARMBaseInstrInfo.cpp,

Renato Golin via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 13:42:54 PDT 2015


rengolin accepted this revision.
rengolin added a comment.
This revision is now accepted and ready to land.

In http://reviews.llvm.org/D12295#233532, @congh wrote:

> When the probability is represented with a very large numerator, we will get overflow here (this happened to me when I changed the representation of the BranchProbability by using a very large fixed denominator). BranchProbability provides scale() interface just for this case, so using it should be the right way to scale an integer. Is a test necessary for this fix?


If the problem was found with a test case, then yes. But if it was just you fiddling with internal constants, I think the patch is obvious and should be ok without a test.


http://reviews.llvm.org/D12295





More information about the llvm-commits mailing list