[llvm-commits] PATCH: remove VICmp and VFCmp.

Chris Lattner clattner at apple.com
Tue Jul 7 13:16:06 PDT 2009


On Jul 7, 2009, at 11:30 AM, Dan Gohman wrote:
> On Jul 6, 2009, at 10:10 AM, Chris Lattner wrote:
> On Jul 5, 2009, at 10:16 PM, Nick Lewycky wrote:
>>> This patch removes vicmp and vfcmp, which has the positive side that
>>>
>>> it fixes existing type-safety bugs and simplifies some code, but a
>>>
>>> downside in that it XFAILs 9 CodeGen tests.
>>>
>>
>> I haven't had a chance to look at the patch, but removing v[fi]cmp
>> will almost certainly break clang (which generates them for vector
>> comparisons in opencl/ext_vector mode).  The right way to remove this
>> is to make codegen pattern match [fi]cmp+sext to the same nodes it is
>> using for v[fi]cmp, then change clang to generate [fi]cmp+sext  
>> instead
>> of v[if]cmp, then nuke v[fi]cmp.  This way we won't loose any codegen
>> capability and clang will still build :).
>
> Vector [fi]cmp are not yet ready to replace v[fi]cmp, and there's
> more work required than just adding patterns.
>
> Work has been one to support vector [fi]cmp in the IR, however no
> work has been done to support it in CodeGen yet. Adding support in
> CodeGen will require a variety of fairly straight-forward
> changes, plus finding a solution for vectors of i1 in CodeGen.

I don't see a need to fix the "vector of i1" issue right now.  In  
fact, I don't see an issue at all.

There are two things we care about: making compare+sext turn into the  
current nice code that v*cmp produces, and eventually handling compare 
+select.  Both of these idioms are trivial enough that they could be  
handled by pre-legalize dag combine, forming (e.g.) ISD::VSETCC  
nodes.  Then legalize won't ever see vectors of i1 in code that we  
care about.

-Chris




More information about the llvm-commits mailing list