summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.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/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
parent9043c74f497bfbb8ee708f5aee6229b2f212bc0b (diff)
downloadbcm5719-llvm-048f99de112c306c928acbc0ccf7fccc2d4f7b39.tar.gz
bcm5719-llvm-048f99de112c306c928acbc0ccf7fccc2d4f7b39.zip
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/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index aae11794eb0..f6867840aee 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -5562,6 +5562,9 @@ void SelectionDAGBuilder::visitCall(const CallInst &I) {
case LibFunc::sqrt:
case LibFunc::sqrtf:
case LibFunc::sqrtl:
+ case LibFunc::sqrt_finite:
+ case LibFunc::sqrtf_finite:
+ case LibFunc::sqrtl_finite:
if (visitUnaryFloatCall(I, ISD::FSQRT))
return;
break;
OpenPOWER on IntegriCloud