summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2015-04-09 15:03:23 +0000
committerSanjay Patel <spatel@rotateright.com>2015-04-09 15:03:23 +0000
commit359b105745cc7edf0d3c84a697de596ee331374d (patch)
tree759cf9f38fe866fbf3ad7dea34718629a26a5f46 /clang/test/CodeGen
parentf4db5462e3370b604e551ec6bb81441a254d77a4 (diff)
downloadbcm5719-llvm-359b105745cc7edf0d3c84a697de596ee331374d.tar.gz
bcm5719-llvm-359b105745cc7edf0d3c84a697de596ee331374d.zip
Process the -freciprocal-math optimization flag (PR20912)
The driver currently accepts but ignores the -freciprocal-math flag. This patch passes the flag through and enables 'arcp' fast-math-flag generation in IR. Note that this change does not actually enable the optimization for any target. The reassociation optimization that this flag specifies was implemented by http://reviews.llvm.org/D6334 : http://llvm.org/viewvc/llvm-project?view=revision&revision=222510 Because the optimization is done in the backend rather than IR, the backend must be modified to understand instruction-level fast-math-flags or a new function-level attribute must be created. Also note that -freciprocal-math is independent of any target-specific usage of reciprocal estimate hardware instructions. That requires its own flag ('-mrecip'). https://llvm.org/bugs/show_bug.cgi?id=20912 llvm-svn: 234493
Diffstat (limited to 'clang/test/CodeGen')
-rw-r--r--clang/test/CodeGen/finite-math.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/test/CodeGen/finite-math.c b/clang/test/CodeGen/finite-math.c
index fd8fcf6fad1..8365b56fe56 100644
--- a/clang/test/CodeGen/finite-math.c
+++ b/clang/test/CodeGen/finite-math.c
@@ -1,5 +1,6 @@
// RUN: %clang_cc1 -ffinite-math-only -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=FINITE
// RUN: %clang_cc1 -fno-signed-zeros -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=NSZ
+// RUN: %clang_cc1 -freciprocal-math -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=RECIP
float f0, f1, f2;
@@ -8,6 +9,7 @@ void foo(void) {
// FINITE: fadd nnan ninf
// NSZ: fadd nsz
+ // RECIP: fadd arcp
f0 = f1 + f2;
// CHECK: ret
OpenPOWER on IntegriCloud