Home | History | Annotate | Download | only in AArch64
      1 ; RUN: opt < %s -mtriple=aarch64-linux-gnu -simplifycfg -enable-unsafe-fp-math -S >%t
      2 ; RUN: FileCheck %s < %t
      3 ; ModuleID = 't.cc'
      4 
      5 ; Function Attrs: nounwind
      6 define double @_Z3fooRdS_S_S_(double* dereferenceable(8) %x, double* dereferenceable(8) %y, double* dereferenceable(8) %a) #0 {
      7 entry:
      8   %0 = load double, double* %y, align 8
      9   %cmp = fcmp oeq double %0, 0.000000e+00
     10   %1 = load double, double* %x, align 8
     11   br i1 %cmp, label %if.then, label %if.else
     12 
     13 ; fadd (const, (fmul x, y))
     14 if.then:                                          ; preds = %entry
     15 ; CHECK-LABEL: if.then:
     16 ; CHECK:   %3 = fmul fast double %1, %2
     17 ; CHECK-NEXT:   %mul = fadd fast double 1.000000e+00, %3
     18   %2 = load double, double* %a, align 8
     19   %3 = fmul fast double %1, %2
     20   %mul = fadd fast double 1.000000e+00, %3
     21   store double %mul, double* %y, align 8
     22   br label %if.end
     23 
     24 ; fsub ((fmul x, y), z)
     25 if.else:                                          ; preds = %entry
     26 ; CHECK-LABEL: if.else:
     27 ; CHECK:   %mul1 = fmul fast double %1, %2
     28 ; CHECK-NEXT:   %sub1 = fsub fast double %mul1, %0
     29   %4 = load double, double* %a, align 8
     30   %mul1 = fmul fast double %1, %4
     31   %sub1 = fsub fast double %mul1, %0
     32   store double %sub1, double* %y, align 8
     33   br label %if.end
     34 
     35 if.end:                                           ; preds = %if.else, %if.then
     36   %5 = load double, double* %y, align 8
     37   %cmp2 = fcmp oeq double %5, 2.000000e+00
     38   %6 = load double, double* %x, align 8
     39   br i1 %cmp2, label %if.then2, label %if.else2
     40 
     41 ; fsub (x, (fmul y, z))
     42 if.then2:                                         ; preds = %entry
     43 ; CHECK-LABEL: if.then2:
     44 ; CHECK:   %7 = fmul fast double %5, 3.000000e+00
     45 ; CHECK-NEXT:   %mul2 = fsub fast double %6, %7
     46   %7 = load double, double* %a, align 8
     47   %8 = fmul fast double %6, 3.0000000e+00
     48   %mul2 = fsub fast double %7, %8
     49   store double %mul2, double* %y, align 8
     50   br label %if.end2
     51 
     52 ; fsub (fneg((fmul x, y)), const)
     53 if.else2:                                         ; preds = %entry
     54 ; CHECK-LABEL: if.else2:
     55 ; CHECK:   %mul3 = fmul fast double %5, 3.000000e+00
     56 ; CHECK-NEXT:   %neg = fsub fast double 0.000000e+00, %mul3
     57 ; CHECK-NEXT:   %sub2 = fsub fast double %neg, 3.000000e+00
     58   %mul3 = fmul fast double %6, 3.0000000e+00
     59   %neg = fsub fast double 0.0000000e+00, %mul3
     60   %sub2 = fsub fast double %neg, 3.0000000e+00
     61   store double %sub2, double* %y, align 8
     62   br label %if.end2
     63 
     64 if.end2:                                           ; preds = %if.else, %if.then
     65   %9 = load double, double* %x, align 8
     66   %10 = load double, double* %y, align 8
     67   %add = fadd fast double %9, %10
     68   %11 = load double, double* %a, align 8
     69   %add2 = fadd fast double %add, %11
     70   ret double %add2
     71 }
     72 
     73