]> granicus.if.org Git - llvm/commit
[InstCombine] Move an optimization from foldICmpAndConstConst to foldICmpUsingKnownBits
authorCraig Topper <craig.topper@intel.com>
Mon, 25 Sep 2017 21:15:00 +0000 (21:15 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 25 Sep 2017 21:15:00 +0000 (21:15 +0000)
commit5b3e3e1523a68c0e17cc47f2406ddcc577770e25
tree6b6996033877b8f646e8f4c88d56fdbd28358dae
parent4bbcb4ce02014f39edfc416892a8a0c07258dc67
[InstCombine] Move an optimization from foldICmpAndConstConst to foldICmpUsingKnownBits

All this optimization cares about is knowing how many low bits of LHS is known to be zero and whether that means that the result is 0 or greater than the RHS constant. It doesn't matter where the zeros in the low bits came from. So we don't need to specifically look for an AND. Instead we can use known bits.

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

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