[IR] Add SaturatingInst and BinaryOpIntrinsic classes
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 28 May 2019 18:08:06 +0000 (18:08 +0000)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 28 May 2019 18:08:06 +0000 (18:08 +0000)
commit2fb0a820df9c9884b9f42efdd0919b309e2b1204
treec6b6e7bccdf4b9d9ebb7a49719c1e657c2d2ff3f
parent76696654322bd502cfd4592e48fc6a1782de5694
[IR] Add SaturatingInst and BinaryOpIntrinsic classes

Based on the suggestion in D62447, this adds a SaturatingInst class
that represents the saturating add/sub family of intrinsics. It
exposes the same interface as WithOverflowInst, for this reason I
have also added a common base class BinaryOpIntrinsic that holds the
actual implementation code and will be useful in some places handling
both overflowing and saturating math.

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

llvm-svn: 361857
llvm/include/llvm/IR/IntrinsicInst.h
llvm/lib/IR/IntrinsicInst.cpp