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

Duncan Sands baldrick at free.fr
Wed Jul 8 01:08:52 PDT 2009


Hi Dan,

> %y has type <4 x i1>. This is not a legal type on most current
> architectures. But, many architectures have ways of supporting
> this kind of code, often by putting the comparison result in a
> <4 x i32> register.
> 
> The main twist is that a type like <4 x i1> might be legalized
> to either <4 x i32> or <4 x i64> on a target like x86, depending
> on the type of the comparison operands, so the current
> getTypeToTransformTo, which assumes that every type has a
> unique destination type, isn't sufficient.

I think this is a misunderstanding of the roles of type and
operation legalization.  The getTypeToTransformTo method exists
entirely for the benefit of type legalization.  Since <4 x i1> is
an illegal type, it needs to be transformed into the legal type
given by getTypeToTransformTo, for example <4 x i8>.  After type
legalization has finished you will have vector comparison operations
returning <4 x i8>.  Now operation legalization kicks in.  Since the
target machine cannot handle vector comparisons returning <4 x i8>,
operation legalization needs to turn that into a comparison returning
<4 x i32> or <4 x i64>.  It of course needs some way to know which
type to use, but this has nothing to do with getTypeToTransformTo.

Ciao,

Duncan.



More information about the llvm-commits mailing list