Home | History | Annotate | Download | only in Reassociate
      1 ; RUN: opt < %s -reassociate -S | FileCheck %s
      2 
      3 define float @test1(float %A) {
      4 ; CHECK-LABEL: test1
      5 ; CHECK-NEXT: %X = fadd float %A, 1.000000e+00
      6 ; CHECK-NEXT: %Y = fadd float %A, 1.000000e+00
      7 ; CHECK-NEXT: %r = fsub float %X, %Y
      8 ; CHECK-NEXT: ret float %r
      9 
     10   %X = fadd float %A, 1.000000e+00
     11   %Y = fadd float %A, 1.000000e+00
     12   %r = fsub float %X, %Y
     13   ret float %r
     14 }
     15 
     16 define float @test2(float %A) {
     17 ; CHECK-LABEL: test2
     18 ; CHECK-NEXT: ret float 0.000000e+00
     19 
     20   %X = fadd fast float 1.000000e+00, %A
     21   %Y = fadd fast float 1.000000e+00, %A
     22   %r = fsub fast float %X, %Y
     23   ret float %r
     24 }
     25