[LLVMdev] Extending vector operations

Stefanus Du Toit stefanus.dutoit at rapidmind.com
Wed Jul 23 09:51:00 PDT 2008


On 23-Jul-08, at 12:23 PM, David Greene wrote:
> On Tuesday 22 July 2008 08:33, Stefanus Du Toit wrote:
>
>> Right, the type that needs to be used at the birthpoint of the value
>> will generally be determined by the operation being performed to
>> define it. At uses, that representation will have to be converted.
>
> Why would this ever happen?  If the mask doesn't match the vector
> length of the operation, isn't the operation undefined?
>
> I suppose a mask could be longer than the vector length and still
> have defined behavior, but this kind of mismatch strikes me as odd.
>
>> There are some operations which may not provide a unique
>> representation at a definition. Phi statements are the most obvious
>> ones - if a phi statement joins two boolean vectors of different
>> representations, the optimal choice of the result may depend on where
>> that result is used.
>
> Again, why would this happen?  Does a phi today ever join two vectors
> of different type/length?

The issue is not joining vectors of different types or length, but  
that at some point an <N x i1> will (on many architectures) have to be  
turned into a mask that's something like <N x i8>, <N x i32>, <N x  
i64> etc. This internal type will depend on the operation producing  
the mask, and phi nodes may join such <N x i1>s which are internally  
going to be differently sized.

I've included an example in another response to you that I just sent.  
Hopefully that makes things clear. Let me know if it's not.

Stefanus

--
Stefanus Du Toit <stefanus.dutoit at rapidmind.com>
   RapidMind Inc.
   phone: +1 519 885 5455 x116 -- fax: +1 519 885 1463






More information about the llvm-dev mailing list