[LLVMdev] Bug in visitSIGN_EXTEND in DAGCombiner.cpp?

Nadav Rotem nrotem at apple.com
Mon Mar 11 11:27:13 PDT 2013

> Line 4501 in trunk DAGCombiner.cpp… I changed the ISD::SELECT to the VT.isVector() ? ISD::VSELECT : ISD::SELECT...

Thanks. From the commit message I think that we should only run this optimization on scalars. 

>> Can you write down the input SDNode ?  What types are inputs ? 
>           0x107046d10: v2i8 = vselect 0x107046c10, 0x107046b10, 0x107045e10 [ID=-3]
>             0x107046c10: v2i32 = setcc 0x107045c10, 0x107045e10, 0x107045f10 [ID=-3]
>            0x107046b10: v2i8 = BUILD_VECTOR 0x107046a10, 0x107046a10 [ID=-3]
>   0x107046a10: i8 = Constant<-1> [ID=-3]
>   0x107045e10: v2i8 = BUILD_VECTOR 0x107045d10, 0x107045d10 [ORD=10] [ID=-3]
>   0x107045d10: i8 = Constant<0> [ORD=10] [ID=-3]

It looks like a type-legalization problem. Is v2i8 a legal type on your architecture ?  In any case, we can't XOR the mask with the operands because they are not the same width. You can custom-lower VSELECTS to work around this problem. 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130311/daaa68ed/attachment-0001.html>

More information about the llvm-dev mailing list