Home | History | Annotate | Download | only in InstSimplify
      1 ; RUN: opt < %s -instsimplify -S | FileCheck %s
      2 
      3 ; fsub 0, (fsub 0, X) ==> X
      4 ; CHECK-LABEL: @fsub_0_0_x(
      5 define float @fsub_0_0_x(float %a) {
      6   %t1 = fsub float -0.0, %a
      7   %ret = fsub float -0.0, %t1
      8 
      9 ; CHECK: ret float %a
     10   ret float %ret
     11 }
     12 
     13 ; fsub X, 0 ==> X
     14 ; CHECK-LABEL: @fsub_x_0(
     15 define float @fsub_x_0(float %a) {
     16   %ret = fsub float %a, 0.0
     17 ; CHECK: ret float %a
     18   ret float %ret
     19 }
     20 
     21 ; fadd X, -0 ==> X
     22 ; CHECK-LABEL: @fadd_x_n0(
     23 define float @fadd_x_n0(float %a) {
     24   %ret = fadd float %a, -0.0
     25 ; CHECK: ret float %a
     26   ret float %ret
     27 }
     28 
     29 ; fmul X, 1.0 ==> X
     30 ; CHECK-LABEL: @fmul_X_1(
     31 define double @fmul_X_1(double %a) {
     32   %b = fmul double 1.000000e+00, %a                ; <double> [#uses=1]
     33   ; CHECK: ret double %a
     34   ret double %b
     35 }
     36