OSDN Git Service

Add checkMulAdd helper function to CheckedArithmetic
authorGeorge Karpenkov <ekarpenkov@apple.com>
Wed, 13 Jun 2018 18:32:02 +0000 (18:32 +0000)
committerGeorge Karpenkov <ekarpenkov@apple.com>
Wed, 13 Jun 2018 18:32:02 +0000 (18:32 +0000)
commitb97b3021fc7b9eb912c61f6c9dfd03f0e35b7cc4
treef93b8372a01abcb105d6c77f9abca95e970f2075
parentba86f98ba71d995dc8d91b2e737ee09f4d59fd14
Add checkMulAdd helper function to CheckedArithmetic

Multiplication followed by addition
(https://en.wikipedia.org/wiki/Multiply–accumulate_operation) is a
sufficiently common use-case to warrant a separate helper.

Differential Revision: https://reviews.llvm.org/D48138

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334635 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/CheckedArithmetic.h
unittests/Support/CheckedArithmeticTest.cpp