| commit | 884feb1b69f965dd57739defeca0d9943b40a47d | [log] [tgz] |
|---|---|---|
| author | Nikita Popov <nikita.ppv@gmail.com> | Wed Mar 06 18:30:00 2019 +0000 |
| committer | Nikita Popov <nikita.ppv@gmail.com> | Wed Mar 06 18:30:00 2019 +0000 |
| tree | 349f1382b8be6c9987fc4206717c4862f3a30846 | |
| parent | 11308bdb433e1ebd759fb4a509f9a8002bea1e92 [diff] [blame] |
[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
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h index 5b0c7fc..e4e6228 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h +++ b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h
@@ -592,6 +592,8 @@ 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 ///