InstCombine: try to transform A-B < 0 into A < B
authorDavid Majnemer <david.majnemer@gmail.com>
Wed, 31 Dec 2014 04:21:41 +0000 (04:21 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Wed, 31 Dec 2014 04:21:41 +0000 (04:21 +0000)
commit0f77ccd6bbe35543153dcd97a10fe552a5077e8d
treea6ada73e6fdf72de9e23da3daf986c8ec65e4bbd
parentc0319dd9c254d0854c94f407e3eefec57922880d
InstCombine: try to transform A-B < 0 into A < B

We are allowed to move the 'B' to the right hand side if we an prove
there is no signed overflow and if the comparison itself is signed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225034 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCompares.cpp
test/Transforms/InstCombine/icmp.ll