1 ; NOTE: Assertions have been autogenerated by update_test_checks.py
2 ; RUN: opt < %s -instcombine -S | FileCheck %s
4 declare double @fabs(double) readonly
6 define double @test(double %X) {
8 ; CHECK-NEXT: [[Y:%.*]] = fadd double %X, 0.000000e+00
9 ; CHECK-NEXT: ret double [[Y]]
11 %Y = fadd double %X, 0.0 ;; Should be a single add x, 0.0
12 %Z = fadd double %Y, 0.0
16 define double @test1(double %X) {
17 ; CHECK-LABEL: @test1(
18 ; CHECK-NEXT: [[Y:%.*]] = call double @llvm.fabs.f64(double %X)
19 ; CHECK-NEXT: ret double [[Y]]
21 %Y = call double @fabs(double %X)
22 %Z = fadd double %Y, 0.0