Hi,
I have added function to transform the two instructions of the type:
icmp slt/sle/ult/ule/sge/sgt/uge/ugt (ashr/lshr (Const2) %A), (Const1)
The patch for operators eq/ne has already been added in: http://reviews.llvm.org/D4068
This handles it for rest of the operators.
Please help in reviewing it.
Edit:
This patch now implements the optimization for only unsigned operators (ult/ule/ugt/uge). I've split it into two to make it easier to review. Earlier, the size of the diff was quite large.
Thanks.
Regards,
Ankur Garg
This should be handled by InstSimplify.