[APInt] Add saturating left-shift ops
authorRoman Lebedev <lebedev.ri@gmail.com>
Fri, 25 Oct 2019 15:17:48 +0000 (18:17 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Fri, 25 Oct 2019 15:20:00 +0000 (18:20 +0300)
commit1cc8e1e1d7d78fc3f2185c5ba207cd21f227fa1c
tree23ed419b7338aceb2b0b098502c476e27b1a061d
parentb2c184458e990c8faeffd5047e7086e4f7ff07a6
[APInt] Add saturating left-shift 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 `shlWithNoWrap()`

Reviewers: spatel, nikic

Reviewed By: nikic

Subscribers: hiraditya, dexonsmith, llvm-commits

Tags: #llvm

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