[llvm-commits] [llvm] r58351 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/logical-select.ll

Nick Lewycky nicholas at mxc.ca
Tue Oct 28 21:01:22 PDT 2008


Dan Gohman wrote:
> On Oct 28, 2008, at 4:13 PM, Chris Lattner wrote:
> 
>> On Oct 28, 2008, at 3:39 PM, Dan Gohman wrote:
>>> URL: http://llvm.org/viewvc/llvm-project?rev=58351&view=rev
>>> Log:
>>> (A & sext(C)) | (B & ~sext(C)  ->  C ? A : B
>> Is sext from i1 really the canonical form or is select c, -1, 0?  If
>> so, do we turn "c ? -1 : 0" into sext(c)?  If not, do we already do
>> this xform for the ?: form?
> 
> 
> There doesn't appear to be a canonical form yet. sext i1 to i32 is
> not converted to select, and select x, -1, 0 is not converted to sext.
> 
> Also, we don't do the above xform for the ?: form.
> 
> Do you have a preference for which to make canonical?

Some day, select from i1 should be canonical. It would allow us to 
eliminate any long chain of computations that started with an i1.

However, I don't think the backends can currently handle that efficiently.

Nick

> Dan
> 
> _______________________________________________
> 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