1 ; RUN: opt < %s -instcombine -S | \
2 ; RUN: grep {fadd float}
3 ; RUN: opt < %s -instcombine -S | \
4 ; RUN: grep {fmul float}
5 ; RUN: opt < %s -instcombine -S | \
6 ; RUN: not grep {insertelement.*0.00}
7 ; RUN: opt < %s -instcombine -S | \
8 ; RUN: not grep {call.*llvm.x86.sse.mul}
9 ; RUN: opt < %s -instcombine -S | \
10 ; RUN: not grep {call.*llvm.x86.sse.sub}
13 define i16 @test1(float %f) {
15 %tmp = insertelement <4 x float> undef, float %f, i32 0 ; <<4 x float>> [#uses=1]
16 %tmp10 = insertelement <4 x float> %tmp, float 0.000000e+00, i32 1 ; <<4 x float>> [#uses=1]
17 %tmp11 = insertelement <4 x float> %tmp10, float 0.000000e+00, i32 2 ; <<4 x float>> [#uses=1]
18 %tmp12 = insertelement <4 x float> %tmp11, float 0.000000e+00, i32 3 ; <<4 x float>> [#uses=1]
19 %tmp28 = tail call <4 x float> @llvm.x86.sse.sub.ss( <4 x float> %tmp12, <4 x float> < float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00 > ) ; <<4 x float>> [#uses=1]
20 %tmp37 = tail call <4 x float> @llvm.x86.sse.mul.ss( <4 x float> %tmp28, <4 x float> < float 5.000000e-01, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00 > ) ; <<4 x float>> [#uses=1]
21 %tmp48 = tail call <4 x float> @llvm.x86.sse.min.ss( <4 x float> %tmp37, <4 x float> < float 6.553500e+04, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00 > ) ; <<4 x float>> [#uses=1]
22 %tmp59 = tail call <4 x float> @llvm.x86.sse.max.ss( <4 x float> %tmp48, <4 x float> zeroinitializer ) ; <<4 x float>> [#uses=1]
23 %tmp.upgrd.1 = tail call i32 @llvm.x86.sse.cvttss2si( <4 x float> %tmp59 ) ; <i32> [#uses=1]
24 %tmp69 = trunc i32 %tmp.upgrd.1 to i16 ; <i16> [#uses=1]
28 define i32 @test2(float %f) {
29 %tmp5 = fmul float %f, %f
30 %tmp9 = insertelement <4 x float> undef, float %tmp5, i32 0
31 %tmp10 = insertelement <4 x float> %tmp9, float 0.000000e+00, i32 1
32 %tmp11 = insertelement <4 x float> %tmp10, float 0.000000e+00, i32 2
33 %tmp12 = insertelement <4 x float> %tmp11, float 0.000000e+00, i32 3
34 %tmp19 = bitcast <4 x float> %tmp12 to <4 x i32>
35 %tmp21 = extractelement <4 x i32> %tmp19, i32 0
39 declare <4 x float> @llvm.x86.sse.sub.ss(<4 x float>, <4 x float>)
41 declare <4 x float> @llvm.x86.sse.mul.ss(<4 x float>, <4 x float>)
43 declare <4 x float> @llvm.x86.sse.min.ss(<4 x float>, <4 x float>)
45 declare <4 x float> @llvm.x86.sse.max.ss(<4 x float>, <4 x float>)
47 declare i32 @llvm.x86.sse.cvttss2si(<4 x float>)