[InstCombine] Replace an and+icmp with a trunc+icmp
authorDavid Majnemer <david.majnemer@gmail.com>
Sun, 16 Aug 2015 07:09:17 +0000 (07:09 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Sun, 16 Aug 2015 07:09:17 +0000 (07:09 +0000)
commit2363b41211d441306afa9d21555b6d73fa930425
tree57ac16368b52acd076dd97e2205b50bf1770e894
parent5df1207c2cf57a98763c28c8534230726ca8fc3a
[InstCombine] Replace an and+icmp with a trunc+icmp

Bitwise arithmetic can obscure a simple sign-test.  If replacing the
mask with a truncate is preferable if the type is legal because it
permits us to rephrase the comparison more explicitly.

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