diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-03-06 18:30:00 +0000 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-03-06 18:30:00 +0000 |
commit | 884feb1b69f965dd57739defeca0d9943b40a47d (patch) | |
tree | 349f1382b8be6c9987fc4206717c4862f3a30846 /llvm/lib/Transforms/InstCombine/InstCombineInternal.h | |
parent | 11308bdb433e1ebd759fb4a509f9a8002bea1e92 (diff) | |
download | bcm5719-llvm-884feb1b69f965dd57739defeca0d9943b40a47d.tar.gz bcm5719-llvm-884feb1b69f965dd57739defeca0d9943b40a47d.zip |
[InstCombine] Fold add nsw + sadd.with.overflow
Fold `add nsw` and `sadd.with.overflow` with constants if the addition
does not overflow.
Part of https://bugs.llvm.org/show_bug.cgi?id=38146.
Patch by Dan Robertson.
Differential Revision: https://reviews.llvm.org/D58881
llvm-svn: 355530
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineInternal.h')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineInternal.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h index 5b0c7fce0d1..e4e6228a047 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h +++ b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h @@ -592,6 +592,8 @@ private: Value *matchSelectFromAndOr(Value *A, Value *B, Value *C, Value *D); Value *getSelectCondition(Value *A, Value *B); + Instruction *foldIntrinsicWithOverflowCommon(IntrinsicInst *II); + public: /// Inserts an instruction \p New before instruction \p Old /// |