[PATCH] [InstCombineCompares] Added shl optimization for the instruction - icmp ugt/ult/uge/ule (shl Const2, A), Const1

Ankur Garg ankur29.garg at samsung.com
Mon Nov 10 06:19:06 PST 2014


Hi,
I found some errors in this optimization. Left-shifting an integer may cause it become lesser or greater than a constant based on the ordering of the bits.
For example,
AP1 = 01010000
AP2 = 00000101

if %a = 4, AP2 = AP1
if %a = 5, AP2 u> AP1
if %a = 6, AP2 u< AP1

I don't think this optimization is possible for 'shl'.
I will work on finding another way to do this, if possible.

Thanks.

http://reviews.llvm.org/D6131






More information about the llvm-commits mailing list