From 884feb1b69f965dd57739defeca0d9943b40a47d Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 6 Mar 2019 18:30:00 +0000 Subject: [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 --- llvm/lib/Transforms/InstCombine/InstCombineInternal.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib/Transforms/InstCombine/InstCombineInternal.h') 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 /// -- cgit v1.2.3