[LLVMdev] llvm::ShuffleVectorInst yields incorrect vector length in 2.6

Bob Wilson
Tue, 02 Feb 2010 16:38:39 -0000

On Feb 2, 2010, at 4:56 AM, Maarten Hoeben wrote:

>
> Hi,
>
> When I emit the llvm::ShuffleVectorInst instruction from my code generator
> the result vector has the length of vector 1, instead of the element type
of
> vector 1 and the length of the mask vector;
>
>  %13 = load <3 x float>* %w                      ; <<3 x
float>> [#uses=0]
>  %14 = shufflevector <3 x float> %13, <3 x float> undef, <2
x i32> <i32 1,
> i32 0> ; <<3 x float>> [#uses=0]

The type of %14 should be <2 x float>, since the elements are floats and
the mask has 2 entries.  What do you mean when you write that it has "the
length of vector 1"?


>
> The documentation reads;
>
> "The result of the instruction is a vector whose length is the same as
the
> shuffle mask and whose element type is the same as the element type of the
> first two operands."
>
> Is this a bug, or am I misusing the ShuffleVectorInst instruction?
>
> Dumping the individual parameters before calling the ShuffleVectorInst
> yields;
>
>  %13 = load <3 x float>* %w                      ; <<3 x
float>> [#uses=0]
> <3 x float> undef
> <2 x i32> <i32 1, i32 0>
>
> Any suggesion? Thanks in advance!
>
> Regards,
>
> Maarten Hoeben
> --
> View this message in context:
http://old.nabble.com/llvm%3A%3AShuffleVectorInst-yields-incorrect-vector-length-in-2.6-tp27419900p27419900.html
> Sent from the LLVM - Dev mailing list archive at Nabble.com.
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev