Fix more instances of dropped fast math flags when optimizing FADD instructions. All found by inspection (aka grep).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199528 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson
2014-01-18 00:48:14 +00:00
parent 3cbfa1617f
commit 774cec5748
6 changed files with 62 additions and 7 deletions

View File

@@ -160,6 +160,22 @@ define float @fold15(float %x, float %y) {
; CHECK: ret
}
; (select X+Y, X-Y) => X + (select Y, -Y)
define float @fold16(float %x, float %y) {
%cmp = fcmp ogt float %x, %y
%plus = fadd fast float %x, %y
%minus = fsub fast float %x, %y
%r = select i1 %cmp, float %plus, float %minus
ret float %r
; CHECK: fold16
; CHECK: fsub fast float
; CHECK: select
; CHECK: fadd fast float
; CHECK: ret
}
; =========================================================================
;
; Testing-cases about fmul begin

View File

@@ -31,6 +31,15 @@ define half @test4(float %a) {
ret half %c
}
; CHECK: test4-fast
define half @test4-fast(float %a) {
; CHECK: fptrunc
; CHECK: fsub fast
%b = fsub fast float -0.0, %a
%c = fptrunc float %b to half
ret half %c
}
; CHECK: test5
define half @test5(float %a, float %b, float %c) {
; CHECK: fcmp ogt