]> granicus.if.org Git - llvm/commit
[InstSimplify] Simplify saturating add/sub + icmp
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 17 Dec 2018 17:45:18 +0000 (17:45 +0000)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 17 Dec 2018 17:45:18 +0000 (17:45 +0000)
commite84034484b91c045e1241a01c89b1b274bf2bd7c
tree3e9d5b3143434a273255e9ed31675ce33c8b2d36
parent51120d77dfd813b25fe2957d3dbe3fb250b0e3ec
[InstSimplify] Simplify saturating add/sub + icmp

If a saturating add/sub has one constant operand, then we can
determine the possible range of outputs it can produce, and simplify
an icmp comparison based on that.

The implementation is based on a similar existing mechanism for
simplifying binary operator + icmps.

Differential Revision: https://reviews.llvm.org/D55735

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349369 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/InstructionSimplify.cpp
test/Transforms/InstSimplify/saturating-add-sub.ll