2009-09-12 02:01:28 +08:00
|
|
|
; RUN: opt < %s -instcombine -S | grep 0.0 | count 1
|
2008-01-29 14:52:45 +08:00
|
|
|
|
|
|
|
declare double @abs(double)
|
|
|
|
|
|
|
|
define double @test(double %X) {
|
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) {
|
|
|
|
%Y = call double @abs(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
|
|
|
|
}
|