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

Peter Cooper peter_cooper at apple.com
Thu Dec 15 09:22:41 PST 2011


Hi Duncan

Afraid they're out in the wild :)  I managed to get this pattern after flattening a weird CFG where one block put 'x' into a PHI and the other block put a conditional into a PHI when the condition was false.

Good point on the zest/sext cases though.  I should be seeing that here too, unless they've been pushed down to after the PHI.  Will have a look.

Thanks,
Pete

On Dec 15, 2011, at 12:36 AM, Duncan Sands wrote:

> 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.
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list