Hi,
The following patch implements the optimization for the instructions of the type:
icmp eq/ne (shl Const2, A), Const1
Such instructions can be converted to:
icmp eq/ne A, (TrailingZeros(Const1) - TrailingZeros(Const2))
This handles only the equality operators for now. Other operators need to be handled.
This patch is related to the http://reviews.llvm.org/D4068. The D4068 implements this optimization for ashr/lshr operators. The following patch implements the optimization for shl operator.
Please help in reviewing it.
Thanks.
Ankur
This should be named Zeros. Also, please reuse this for the calculation on line 1158.