Home | History | Annotate | Download | only in InstCombine
      1 ; NOTE: Assertions have been autogenerated by update_test_checks.py
      2 ; RUN: opt < %s -instcombine -S | FileCheck %s
      3 
      4 declare double @fabs(double) readonly
      5 
      6 define double @test(double %X) {
      7 ; CHECK-LABEL: @test(
      8 ; CHECK-NEXT:    [[Y:%.*]] = fadd double %X, 0.000000e+00
      9 ; CHECK-NEXT:    ret double [[Y]]
     10 ;
     11   %Y = fadd double %X, 0.0          ;; Should be a single add x, 0.0
     12   %Z = fadd double %Y, 0.0
     13   ret double %Z
     14 }
     15 
     16 define double @test1(double %X) {
     17 ; CHECK-LABEL: @test1(
     18 ; CHECK-NEXT:    [[Y:%.*]] = call double @fabs(double %X)
     19 ; CHECK-NEXT:    ret double [[Y]]
     20 ;
     21   %Y = call double @fabs(double %X)
     22   %Z = fadd double %Y, 0.0
     23   ret double %Z
     24 }
     25