[llvm-commits] [PATCH] Add a instcombine optimization.

Duncan Sands baldrick at free.fr
Thu Jul 8 00:12:56 PDT 2010


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.



More information about the llvm-commits mailing list