new bswap idiom
[oota-llvm.git] / test / Transforms / GCSE / vectorops.ll
1 ; RUN: llvm-as < %s | opt -gcse -instcombine -disable-output &&
2 ; RUN: llvm-as < %s | opt -gcse -instcombine | llvm-dis | not grep sub
3
4 uint %test_extractelement(<4 x uint> %V) {
5         %R = extractelement <4 x uint> %V, uint 1
6         %R2 = extractelement <4 x uint> %V, uint 1
7         %V = sub uint %R, %R2
8         ret uint %V
9 }
10
11 <4 x uint> %test_insertelement(<4 x uint> %V) {
12         %R = insertelement <4 x uint> %V, uint 0, uint 0
13         %R2 = insertelement <4 x uint> %V, uint 0, uint 0
14         %x = sub <4 x uint> %R, %R2
15         ret <4 x uint> %x
16 }
17
18 <4 x uint> %test_shufflevector(<4 x uint> %V) {
19         %R = shufflevector <4 x uint> %V, <4 x uint> %V, 
20                   <4 x uint> < uint 1, uint undef, uint 7, uint 2>
21         %R2 = shufflevector <4 x uint> %V, <4 x uint> %V, 
22                    <4 x uint> < uint 1, uint undef, uint 7, uint 2>
23         %x = sub <4 x uint> %R, %R2
24         ret <4 x uint> %x
25 }
26