[InstCombine] Refactor out OptimizeOverflowCheck. NFCI.
authorSanjoy Das <sanjoy@playingwithpointers.com>
Wed, 8 Apr 2015 04:27:22 +0000 (04:27 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Wed, 8 Apr 2015 04:27:22 +0000 (04:27 +0000)
commit368f045de1985ce3c14c036b7d13dba881d39453
treedcdd6dc4646fe86c19ff80458120e3494e869cb1
parentb343d1cd8560c9ba67c32eee30609641428f110a
[InstCombine] Refactor out OptimizeOverflowCheck.  NFCI.

Summary:
This patch adds an enum `OverflowCheckFlavor` and a function
`OptimizeOverflowCheck`.  This will allow InstCombine to optimize
overflow checks without directly introducing an intermediate call to the
`llvm.$op.with.overflow` instrinsics.

This specific change is a refactoring and does not intend to change
behavior.

Reviewers: majnemer, atrick

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D8888

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234388 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCalls.cpp
lib/Transforms/InstCombine/InstCombineCompares.cpp
lib/Transforms/InstCombine/InstCombineInternal.h