aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-10-04 19:42:20 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-10-04 19:42:20 +0000
commite20e508aecf413f84b0dc4928cbf4bb5ce6c5bdc (patch)
treecf81b2047df1ac17e3e7ac18d94ba1451fd8f533 /lib/Driver/Tools.cpp
parent45bed131a1a4219cc0bfb3c9f666dca54ddb59fa (diff)
Driver: Link crtfastmath.o if it's available and -ffast-math is specified.
crtfastmath.o contains routines to set the floating point flags to a faster, unsafe mode. Linking it in speeds up code dealing with denormals significantly (PR14024). For now this is only enabled on linux where I can test it and crtfastmath.o is widely available. We may want to provide a similar file with compiler-rt eventually and/or enable it on other platforms too. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165240 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r--lib/Driver/Tools.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 86781cc178..9f068b9d7c 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -5828,6 +5828,9 @@ void linuxtools::Link::ConstructJob(Compilation &C, const JobAction &JA,
else
crtbegin = isAndroid ? "crtbegin_dynamic.o" : "crtbegin.o";
CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtbegin)));
+
+ // Add crtfastmath.o if available and fast math is enabled.
+ ToolChain.AddFastMathRuntimeIfAvailable(Args, CmdArgs);
}
Args.AddAllArgs(CmdArgs, options::OPT_L);