Home | History | Annotate | Download | only in InstCombine
      1 ; RUN: opt < %s -instcombine -S | not grep fpext
      2 @X = external global float 
      3 @Y = external global float
      4 
      5 define void @test() nounwind  {
      6 entry:
      7 	%tmp = load float* @X, align 4		; <float> [#uses=1]
      8 	%tmp1 = fpext float %tmp to double		; <double> [#uses=1]
      9 	%tmp3 = fadd double %tmp1, 0.000000e+00		; <double> [#uses=1]
     10 	%tmp34 = fptrunc double %tmp3 to float		; <float> [#uses=1]
     11 	store float %tmp34, float* @X, align 4
     12 	ret void
     13 }
     14 
     15 define void @test3() nounwind  {
     16 entry:
     17 	%tmp = load float* @X, align 4		; <float> [#uses=1]
     18 	%tmp1 = fpext float %tmp to double		; <double> [#uses=1]
     19 	%tmp2 = load float* @Y, align 4		; <float> [#uses=1]
     20 	%tmp23 = fpext float %tmp2 to double		; <double> [#uses=1]
     21 	%tmp5 = fdiv double %tmp1, %tmp23		; <double> [#uses=1]
     22 	%tmp56 = fptrunc double %tmp5 to float		; <float> [#uses=1]
     23 	store float %tmp56, float* @X, align 4
     24 	ret void
     25 }
     26 
     27 define void @test4() nounwind  {
     28 entry:
     29 	%tmp = load float* @X, align 4		; <float> [#uses=1]
     30 	%tmp1 = fpext float %tmp to double		; <double> [#uses=1]
     31 	%tmp2 = fsub double -0.000000e+00, %tmp1		; <double> [#uses=1]
     32 	%tmp34 = fptrunc double %tmp2 to float		; <float> [#uses=1]
     33 	store float %tmp34, float* @X, align 4
     34 	ret void
     35 }
     36 
     37