diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-10-04 19:42:20 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-10-04 19:42:20 +0000 |
commit | 058666a8d02f5cd348150862a3401c9c4bd0b4d0 (patch) | |
tree | 528e657ffa85743e93147dcf2632a66d1da5949f /clang/lib/Driver/Tools.cpp | |
parent | fe5e770c6dc7f8b6615b1d40efb18755cd9c5609 (diff) | |
download | bcm5719-llvm-058666a8d02f5cd348150862a3401c9c4bd0b4d0.tar.gz bcm5719-llvm-058666a8d02f5cd348150862a3401c9c4bd0b4d0.zip |
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.
llvm-svn: 165240
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r-- | clang/lib/Driver/Tools.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 86781cc178e..9f068b9d7c7 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/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); |