]> granicus.if.org Git - llvm/commit
[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)
commit815d4b098ce998dfa0aa08064cadbb2718e48b7d
tree1bbf0627ceef4e4f75a08bf7491653cbe6e605ce
parent247b7e930a931c4a1d65c6b482c6ce67d3bc4233
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361857 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/IntrinsicInst.h
lib/IR/IntrinsicInst.cpp