[InstCombine] Improve support for ashr in foldICmpAndShift
authorCraig Topper <craig.topper@intel.com>
Wed, 4 Oct 2017 23:06:13 +0000 (23:06 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 4 Oct 2017 23:06:13 +0000 (23:06 +0000)
commit7a930923999574d4ce02906ad68aff98c84a7689
tree7cd31740b9ed7ebd55e08349f4a05a2d3fc06cf0
parent9ab1fa68034e6c106bbe577e40a2423bd3457e76
[InstCombine] Improve support for ashr in foldICmpAndShift

We can support ashr similar to lshr, if we know that none of the shifted in bits are used. In that case SimplifyDemandedBits would normally convert it to lshr. But that conversion doesn't happen if the shift has additional users.

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

llvm-svn: 314945
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/icmp.ll