2016-03-26 02:01:23 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by update_test_checks.py
|
|
|
|
; RUN: opt < %s -instcombine -S | FileCheck %s
|
2008-01-29 14:52:45 +08:00
|
|
|
|
2016-04-13 14:55:52 +08:00
|
|
|
declare double @fabs(double) readonly
|
2008-01-29 14:52:45 +08:00
|
|
|
|
|
|
|
define double @test(double %X) {
|
2016-03-26 02:01:23 +08:00
|
|
|
; CHECK-LABEL: @test(
|
2016-04-06 01:24:54 +08:00
|
|
|
; CHECK-NEXT: [[Y:%.*]] = fadd double %X, 0.000000e+00
|
2016-03-26 02:01:23 +08:00
|
|
|
; CHECK-NEXT: ret double [[Y]]
|
|
|
|
;
|
2009-06-05 06:49:04 +08:00
|
|
|
%Y = fadd double %X, 0.0 ;; Should be a single add x, 0.0
|
|
|
|
%Z = fadd double %Y, 0.0
|
2008-01-29 14:52:45 +08:00
|
|
|
ret double %Z
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @test1(double %X) {
|
2016-03-26 02:01:23 +08:00
|
|
|
; CHECK-LABEL: @test1(
|
2016-04-13 14:55:52 +08:00
|
|
|
; CHECK-NEXT: [[Y:%.*]] = call double @fabs(double %X)
|
2016-03-26 02:01:23 +08:00
|
|
|
; CHECK-NEXT: ret double [[Y]]
|
|
|
|
;
|
2016-04-13 14:55:52 +08:00
|
|
|
%Y = call double @fabs(double %X)
|
2009-06-05 06:49:04 +08:00
|
|
|
%Z = fadd double %Y, 0.0
|
2008-01-29 14:52:45 +08:00
|
|
|
ret double %Z
|
|
|
|
}
|