Test that prune-eh doesn't make deductions based
[oota-llvm.git] / test / Transforms / GCSE / vectorops.ll
1 ; RUN: llvm-as < %s | opt -gcse -instcombine | \
2 ; RUN:   llvm-dis | not grep sub
3
4 define i32 @test_extractelement(<4 x i32> %V) {
5         %R = extractelement <4 x i32> %V, i32 1         ; <i32> [#uses=1]
6         %R2 = extractelement <4 x i32> %V, i32 1                ; <i32> [#uses=1]
7         %V.upgrd.1 = sub i32 %R, %R2            ; <i32> [#uses=1]
8         ret i32 %V.upgrd.1
9 }
10
11 define <4 x i32> @test_insertelement(<4 x i32> %V) {
12         %R = insertelement <4 x i32> %V, i32 0, i32 0           ; <<4 x i32>> [#uses=1]
13         %R2 = insertelement <4 x i32> %V, i32 0, i32 0          ; <<4 x i32>> [#uses=1]
14         %x = sub <4 x i32> %R, %R2              ; <<4 x i32>> [#uses=1]
15         ret <4 x i32> %x
16 }
17
18 define <4 x i32> @test_shufflevector(<4 x i32> %V) {
19         %R = shufflevector <4 x i32> %V, <4 x i32> %V, <4 x i32> < i32 1, i32 undef, i32 7, i32 2 >             ; <<4 x i32>> [#uses=1]
20         %R2 = shufflevector <4 x i32> %V, <4 x i32> %V, <4 x i32> < i32 1, i32 undef, i32 7, i32 2 >            ; <<4 x i32>> [#uses=1]
21         %x = sub <4 x i32> %R, %R2              ; <<4 x i32>> [#uses=1]
22         ret <4 x i32> %x
23 }
24