[APInt] Add saturating multiply ops
authorRoman Lebedev <lebedev.ri@gmail.com>
Fri, 25 Oct 2019 15:17:38 +0000 (18:17 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Fri, 25 Oct 2019 15:19:54 +0000 (18:19 +0300)
commitb2c184458e990c8faeffd5047e7086e4f7ff07a6
tree1b2be1eeb77db6e5857631ac17d9eec37cbc7d6a
parent59a51d84b3a4f96bcc9669ee9c2b2041175a2ccd
[APInt] Add saturating multiply ops

Summary:
There are `*_ov()` functions already, so at least for consistency it may be good to also have saturating variants.
These may or may not be needed for `ConstantRange`'s `mulWithNoWrap()`

Reviewers: spatel, nikic

Reviewed By: nikic

Subscribers: hiraditya, dexonsmith, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69397
llvm/include/llvm/ADT/APInt.h
llvm/lib/Support/APInt.cpp
llvm/unittests/ADT/APIntTest.cpp