]> granicus.if.org Git - llvm/commit
[InstCombine] Fix wrong folding of constant comparisons involving ashr and negative...
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Thu, 9 Oct 2014 12:41:49 +0000 (12:41 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Thu, 9 Oct 2014 12:41:49 +0000 (12:41 +0000)
commitc53401ee91bf0c1944f28a29d939dd146b1f06a3
tree5f5d7e0ac5e501e9f8a55684280711533e97719c
parentf73400a864953bdb6a69cff0ea8b2e6350de07a1
[InstCombine] Fix wrong folding of constant comparisons involving ashr and negative values.

This patch fixes a bug in method InstCombiner::FoldCmpCstShrCst where we
wrongly computed the distance between the highest bits set of two negative
values.

This fixes PR21222.

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

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