[InstCombine] FoldICmpCstShrCst failed for ashr when comparing against -1
authorDavid Majnemer <david.majnemer@gmail.com>
Sat, 19 Sep 2015 00:48:31 +0000 (00:48 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Sat, 19 Sep 2015 00:48:31 +0000 (00:48 +0000)
commitbdf4ccfe9b488e5413647774e7181f20d37ae238
tree789652fa336d5b04e23d8b39c8f67396635e5444
parent1e4af0841002c55ed6302a8c98c8d1c98daa34cb
[InstCombine] FoldICmpCstShrCst failed for ashr when comparing against -1

(icmp eq (ashr C1, %V) -1) may have multiple answers if C1 is not a
power of two and has the sign bit set.

This fixes PR24873.

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