Reid Spencer | 6e87ec4 | 2007-04-16 17:36:08 +0000 | [diff] [blame] | 1 | ; RUN: llvm-upgrade < %s | llvm-as | opt -gcse -instcombine | \ |
| 2 | ; RUN: llvm-dis | not grep sub |
Chris Lattner | 1c4ecc0 | 2006-04-14 05:09:53 +0000 | [diff] [blame] | 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 | |