aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/TargetLibraryInfo.cpp
diff options
context:
space:
mode:
authorPreston Gurd <preston.gurd@intel.com>2013-05-27 15:44:35 +0000
committerPreston Gurd <preston.gurd@intel.com>2013-05-27 15:44:35 +0000
commit048f99de112c306c928acbc0ccf7fccc2d4f7b39 (patch)
treef325de3202afa042ee732ddfdc764abb50f20834 /llvm/lib/Target/TargetLibraryInfo.cpp
parent9043c74f497bfbb8ee708f5aee6229b2f212bc0b (diff)
downloadllvm-048f99de112c306c928acbc0ccf7fccc2d4f7b39.zip
llvm-048f99de112c306c928acbc0ccf7fccc2d4f7b39.tar.gz
llvm-048f99de112c306c928acbc0ccf7fccc2d4f7b39.tar.bz2
Convert sqrt functions into sqrt instructions when -ffast-math is in effect.
When -ffast-math is in effect (on Linux, at least), clang defines __FINITE_MATH_ONLY__ > 0 when including <math.h>. This causes the preprocessor to include <bits/math-finite.h>, which renames the sqrt functions. For instance, "sqrt" is renamed as "__sqrt_finite". This patch adds the 3 new names in such a way that they will be treated as equivalent to their respective original names. llvm-svn: 182739
Diffstat (limited to 'llvm/lib/Target/TargetLibraryInfo.cpp')
-rw-r--r--llvm/lib/Target/TargetLibraryInfo.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Target/TargetLibraryInfo.cpp b/llvm/lib/Target/TargetLibraryInfo.cpp
index ee88ce7..d2967d9 100644
--- a/llvm/lib/Target/TargetLibraryInfo.cpp
+++ b/llvm/lib/Target/TargetLibraryInfo.cpp
@@ -43,6 +43,9 @@ const char* TargetLibraryInfo::StandardNames[LibFunc::NumLibFuncs] =
"__isoc99_scanf",
"__isoc99_sscanf",
"__memcpy_chk",
+ "__sqrt_finite",
+ "__sqrtf_finite",
+ "__sqrtl_finite",
"__strdup",
"__strndup",
"__strtok_r",