summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/fast-math.ll
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2014-01-18 00:48:14 +0000
committerOwen Anderson <resistor@mac.com>2014-01-18 00:48:14 +0000
commit48b842ef7cc430d303d420eb9efb410076345750 (patch)
treefed01d39ced425aa58419f6bf9c5f503f94a96d7 /llvm/test/Transforms/InstCombine/fast-math.ll
parent251e68b6aef5607fec853658cdc416ba2cd7ade4 (diff)
downloadbcm5719-llvm-48b842ef7cc430d303d420eb9efb410076345750.tar.gz
bcm5719-llvm-48b842ef7cc430d303d420eb9efb410076345750.zip
Fix more instances of dropped fast math flags when optimizing FADD instructions. All found by inspection (aka grep).
llvm-svn: 199528
Diffstat (limited to 'llvm/test/Transforms/InstCombine/fast-math.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/fast-math.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/fast-math.ll b/llvm/test/Transforms/InstCombine/fast-math.ll
index 0371488dfd8..de51c494685 100644
--- a/llvm/test/Transforms/InstCombine/fast-math.ll
+++ b/llvm/test/Transforms/InstCombine/fast-math.ll
@@ -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
OpenPOWER on IntegriCloud