Hi Benjamin, > The attached patch adds a new transformation to instcombine: > (X>s -1) ? C1 : C2 --> ((X>>s 31)& (C2 - C1)) + C1 how about (X >s -1) ? C1 : C2 --> ((X >>s 31) & (C2 xor C1)) xor C1 instead? It might interact better with other bit fiddling optimizations. Otherwise the patch looks good. Ciao, Duncan.