llvm.org GIT mirror llvm / b04d993
new testcase, vector operations should be CSE'd git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27690 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 13 years ago
1 changed file(s) with 26 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: llvm-as < %s | opt -gcse -instcombine -disable-output &&
1 ; RUN: llvm-as < %s | opt -gcse -instcombine | llvm-dis | not grep sub
2
3 uint %test_extractelement(<4 x uint> %V) {
4 %R = extractelement <4 x uint> %V, uint 1
5 %R2 = extractelement <4 x uint> %V, uint 1
6 %V = sub uint %R, %R2
7 ret uint %V
8 }
9
10 <4 x uint> %test_insertelement(<4 x uint> %V) {
11 %R = insertelement <4 x uint> %V, uint 0, uint 0
12 %R2 = insertelement <4 x uint> %V, uint 0, uint 0
13 %x = sub <4 x uint> %R, %R2
14 ret <4 x uint> %x
15 }
16
17 <4 x uint> %test_shufflevector(<4 x uint> %V) {
18 %R = shufflevector <4 x uint> %V, <4 x uint> %V,
19 <4 x uint> < uint 1, uint undef, uint 7, uint 2>
20 %R2 = shufflevector <4 x uint> %V, <4 x uint> %V,
21 <4 x uint> < uint 1, uint undef, uint 7, uint 2>
22 %x = sub <4 x uint> %R, %R2
23 ret <4 x uint> %x
24 }
25