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

Duncan Sands baldrick at free.fr
Wed Jul 8 02:03:07 PDT 2009


Hi Eli,

>> 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>.
> 
> We don't support that kind of promotion at the moment, although I
> suppose that's an implementation detail rather than a fundamental
> issue.

exactly.  The fact that this might not actually work right now is
an implementation problem, not a conceptual problem.

>> 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.
> 
> Well, suppose a comparison of two <4 x i32> vectors.  Your natural
> promotion for the result on x86 would be to a <4 x i16>.  But yes, you
> could put off the subsequent adjustments to operation legalization,
> although if it weren't custom-lowered, it would likely end up
> producing something really ugly.

Operation legalization = turning illegal operations into legal
operations.  This may be via custom lowering or via some kind of
generic expansion, it doesn't matter.  Since a comparison of two
<4 x i32> vectors that returns a <4 x i16> is an illegal operation
for x86, but with legal types, it is by definition the job of the
operation legalization code to take care of this.

Ciao,

Duncan.



More information about the llvm-commits mailing list