Home | History | Annotate | Download | only in InstCombine
      1 ; RUN: opt -S -instcombine < %s | FileCheck %s
      2 
      3 define float @test1(float %x) nounwind readnone ssp {
      4   %div = fdiv float %x, 0x3810000000000000
      5   ret float %div
      6 
      7 ; CHECK-LABEL: @test1(
      8 ; CHECK-NEXT: fmul float %x, 0x47D0000000000000
      9 }
     10 
     11 define float @test2(float %x) nounwind readnone ssp {
     12   %div = fdiv float %x, 0x47E0000000000000
     13   ret float %div
     14 
     15 ; CHECK-LABEL: @test2(
     16 ; CHECK-NEXT: fdiv float %x, 0x47E0000000000000
     17 }
     18 
     19 define float @test3(float %x) nounwind readnone ssp {
     20   %div = fdiv float %x, 0x36A0000000000000
     21   ret float %div
     22 
     23 ; CHECK-LABEL: @test3(
     24 ; CHECK-NEXT: fdiv float %x, 0x36A0000000000000
     25 }
     26 
     27 define float @test4(float %x) nounwind readnone ssp {
     28   %div = fdiv fast float %x, 8.0
     29   ret float %div
     30 
     31 ; CHECK-LABEL: @test4(
     32 ; CHECK-NEXT: fmul fast float %x, 1.250000e-01
     33 }
     34 
     35 define float @test5(float %x, float %y, float %z) nounwind readnone ssp {
     36   %div1 = fdiv fast float %x, %y
     37   %div2 = fdiv fast float %div1, %z
     38   ret float %div2
     39 ; CHECK-LABEL: @test5(
     40 ; CHECK-NEXT: fmul fast
     41 ; CHECK-NEXT: fdiv fast
     42 }
     43 
     44 define float @test6(float %x, float %y, float %z) nounwind readnone ssp {
     45   %div1 = fdiv fast float %x, %y
     46   %div2 = fdiv fast float %z, %div1
     47   ret float %div2
     48 ; CHECK-LABEL: @test6(
     49 ; CHECK-NEXT: fmul fast
     50 ; CHECK-NEXT: fdiv fast
     51 }
     52