[ValueTracking] Teach computeNumSignBits to understand min/max clamp patterns with...
authorCraig Topper <craig.topper@intel.com>
Wed, 22 Aug 2018 23:27:50 +0000 (23:27 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 22 Aug 2018 23:27:50 +0000 (23:27 +0000)
commitbec15b6516466a1f3eeb2a52e5584b5d4f5b713e
tree67c86d1ebe8b3b72c392fc6bf98a15596e7456c5
parent2b3900643364f568c2308b178a30e8926b779c70
[ValueTracking] Teach computeNumSignBits to understand min/max clamp patterns with constant/splat values

If we have a min/max pair we can do a better job of counting sign bits if we look at them together. This is similar to what is done in the SelectionDAG version of computeNumSignBits for ISD::SMAX/SMIN.

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

llvm-svn: 340480
llvm/lib/Analysis/ValueTracking.cpp
llvm/test/Transforms/InstCombine/max_known_bits.ll