Use the llvm-upgrade program to upgrade llvm assembly.
[oota-llvm.git] / test / Transforms / InstCombine / vec_shuffle.ll
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output &&
2 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep vector_shuffle
3
4 %T = type <4 x float>
5
6 implementation
7
8 %T %test1(%T %v1) {
9   %v2 = shufflevector %T %v1, %T undef, <4 x uint> <uint 0, uint 1, uint 2, uint 3>
10   ret %T %v2
11 }
12
13 %T %test2(%T %v1) {
14   %v2 = shufflevector %T %v1, %T %v1, <4 x uint> <uint 0, uint 5, uint 2, uint 7>
15   ret %T %v2
16 }
17
18 float %test3(%T %A, %T %B, float %f) {
19         %C = insertelement %T %A, float %f, uint 0
20         %D = shufflevector %T %C, %T %B, <4 x uint> <uint 5, uint 0, uint 2, uint 7>
21         %E = extractelement %T %D, uint 1
22         ret float %E
23 }
24
25 int %test4(<4 x int> %X) {
26         %tmp152.i53899.i = shufflevector <4 x int> %X, <4 x int> undef, <4 x uint> zeroinitializer
27         %tmp34 = extractelement <4 x int> %tmp152.i53899.i, uint 0
28         ret int %tmp34
29 }
30
31 int %test5(<4 x int> %X) {
32         %tmp152.i53899.i = shufflevector <4 x int> %X, <4 x int> undef, <4 x uint> <uint 3, uint 2, uint undef, uint undef>
33         %tmp34 = extractelement <4 x int> %tmp152.i53899.i, uint 0
34         ret int %tmp34
35 }
36
37 float %test6(<4 x float> %X) {
38         %X = cast <4 x float> %X to <4 x int>
39         %tmp152.i53899.i = shufflevector <4 x int> %X, <4 x int> undef, <4 x uint> zeroinitializer
40         %tmp152.i53900.i = cast <4 x int> %tmp152.i53899.i to <4 x float>
41         %tmp34 = extractelement <4 x float> %tmp152.i53900.i, uint 0
42         ret float %tmp34
43 }
44