[ValueTracking] Use KnownOnes to provide a better bound on known zeros for ctlz/cttz...
authorCraig Topper <craig.topper@gmail.com>
Mon, 8 May 2017 17:22:34 +0000 (17:22 +0000)
committerCraig Topper <craig.topper@gmail.com>
Mon, 8 May 2017 17:22:34 +0000 (17:22 +0000)
commit868813ffbb2b3d2ea1b5e97289460541363950f7
tree7c5635099bb7a16199f2155e0efad055d4cf1161
parentf358d48f238673cd738f53a2329d8173d13f575a
[ValueTracking] Use KnownOnes to provide a better bound on known zeros for ctlz/cttz intrinics

This patch uses KnownOnes of the input of ctlz/cttz to bound the value that can be returned from these intrinsics. This makes these intrinsics more similar to the handling for ctpop which already uses known bits to produce a similar bound.

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

llvm-svn: 302444
llvm/lib/Analysis/ValueTracking.cpp
llvm/test/Transforms/InstCombine/intrinsics.ll