diff options
author | David Green <david.green@arm.com> | 2019-10-22 15:39:47 +0000 |
---|---|---|
committer | David Green <david.green@arm.com> | 2019-10-22 15:39:47 +0000 |
commit | 2c4ca6832fa6b306ee6a7010bfb80a3f2596f824 (patch) | |
tree | b978d8fba715be02c4f33013cc94e12267e2c86c /lib/Transforms/InstCombine/InstCombineInternal.h | |
parent | 6e8533b05630a1e06d39a61270dcbf6d0662b3b5 (diff) |
This adds an instcombine matcher for code that attempts to perform signed
saturating arithmetic by casting to a higher type. Unsigned cases are already
matched, this adds extra matches for the more complex signed cases, which
involves matching the min(max(add a b)) nodes with proper extends to ensure
legality.
Differential Revision: https://reviews.llvm.org/D68651
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@375505 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstCombineInternal.h')
-rw-r--r-- | lib/Transforms/InstCombine/InstCombineInternal.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineInternal.h b/lib/Transforms/InstCombine/InstCombineInternal.h index 4917a355cad..1dbc06d92e7 100644 --- a/lib/Transforms/InstCombine/InstCombineInternal.h +++ b/lib/Transforms/InstCombine/InstCombineInternal.h @@ -601,6 +601,7 @@ private: Instruction *narrowMathIfNoOverflow(BinaryOperator &I); Instruction *narrowRotate(TruncInst &Trunc); Instruction *optimizeBitCastFromPhi(CastInst &CI, PHINode *PN); + Instruction *matchSAddSubSat(SelectInst &MinMax1); /// Determine if a pair of casts can be replaced by a single cast. /// |