[llvm-commits] [llvm] r146624 - in /llvm/trunk: lib/Transforms/InstCombine/InstCombineSelect.cpp test/Transforms/InstCombine/select.ll

Duncan Sands baldrick at free.fr
Thu Dec 15 00:36:02 PST 2011

Hi Peter,

> Added InstCombine for "select cond, ~cond, x" type patterns
> These can be reduced to "~cond&  x" or "~cond | x"

do these patterns really occur in the wild?

 > +    // select a, ~a, b -> (~a)&b
 > +    // select a, b, ~a -> (~a)|b

I would expect things like
   select a, sext(~a), b
   select a, zext(~a), b
to be much more common.  The sext case looks easy to handle by
extending your logic a bit.

Ciao, Duncan.

More information about the llvm-commits mailing list