aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/TargetLibraryInfo.cpp
AgeCommit message (Collapse)AuthorFilesLines
2015-01-07R600/SI: Add check for amdgcn triple forgotten in r225276.Tom Stellard1-2/+3
llvm-svn: 225331
2014-11-12Add fortified (__*_chk) library functions to TLI (NFC)Ahmed Bougacha1-0/+6
One of them (__memcpy_chk) was already there, the others were checked by comparing function names. Note that the fortified libfuncs are now part of TLI, but are always available, because they aren't generated, only optimized into the non-checking versions. Differential Revision: http://reviews.llvm.org/D6179 llvm-svn: 221817
2014-10-09Use triple's isiOS() and isOSDarwin() methods.Bob Wilson1-2/+2
These methods are already used in lots of places. This makes things more consistent. NFC. llvm-svn: 219386
2014-10-03PR21145: Teach LLVM about C++14 sized deallocation functions.Richard Smith1-0/+4
C++14 adds new builtin signatures for 'operator delete'. This change allows new/delete pairs to be removed in C++14 onwards, as they were in C++11 and before. llvm-svn: 219014
2014-07-24Target: invert condition for WindowsSaleem Abdulrasool1-1/+1
The Microsoft ABI and MSVCRT are considered the canonical C runtime and ABI. The long double routines are not part of this environment. However, cygwin and MinGW both provide supplementary implementations. Change the condition to reflect this reality. llvm-svn: 213896
2014-07-24X86: correct library call setup for Windows itaniumSaleem Abdulrasool1-1/+1
This target is identical to the Windows MSVC (and follows Microsoft ABI for C). Correct the library call setup for this target. The same set of library calls are missing on this environment. llvm-svn: 213883
2014-04-02TargetLibraryInfo: Disable memcpy and memset on R600Tom Stellard1-1/+10
There are no implementations of these for R600. llvm-svn: 205455
2014-03-27Canonicalise Windows target triple spellingsSaleem Abdulrasool1-1/+1
Construct a uniform Windows target triple nomenclature which is congruent to the Linux counterpart. The old triples are normalised to the new canonical form. This cleans up the long-standing issue of odd naming for various Windows environments. There are four different environments on Windows: MSVC: The MS ABI, MSVCRT environment as defined by Microsoft GNU: The MinGW32/MinGW32-W64 environment which uses MSVCRT and auxiliary libraries Itanium: The MSVCRT environment + libc++ built with Itanium ABI Cygnus: The Cygwin environment which uses custom libraries for everything The following spellings are now written as: i686-pc-win32 => i686-pc-windows-msvc i686-pc-mingw32 => i686-pc-windows-gnu i686-pc-cygwin => i686-pc-windows-cygnus This should be sufficiently flexible to allow us to target other windows environments in the future as necessary. llvm-svn: 204977
2014-03-07"Mac OS/X" -> "Mac OS X" spelling fixes for llvm.Nico Weber1-1/+1
Patch from Sean McBride <sean@rogue-research.com>! llvm-svn: 203258
2014-02-04SimplifyLibCalls: Push TLI through the exp2->ldexp transform.Benjamin Kramer1-0/+5
For the odd case of platforms with exp2 available but not ldexp. llvm-svn: 200795
2014-02-04OS X: the correct function is __sincospif_stret, not __sincospi_stretfTim Northover1-2/+2
rdar://problem/13729466 llvm-svn: 200771
2013-12-28Disable transforms that introduce calls to exp10*() on Linux due toChandler Carruth1-6/+10
widespread glibc bugs. The glibc implementation of exp10 has a very serious precision bug in version 2.15 (and older versions). This is still very widely used (the current Ubuntu LTS for example uses it) and so it isn't reasonable to make transforms that produce these functions. This fixes many miscompiles introduced when we started transforming pow(10.0, ...) into exp10, and it may have fixed other latent miscompiles where exp10 provided sufficient precision but exp10f did not. This is all really horrible. The primary bug has been fixed for over a year and glibc 2.18 works correctly for the test cases I have, but it will be 2017 before the LTS using 2.15 is no longer supported by Ubuntu (and thus reasonable for folks to be relying on). =[ We're either going to need to live without these optimizations, or find a way to switch behavior more dynamically than using simply the fact that the OS is "Linux". To make matters worse, there appears to be significant testing and fixing of numerous other bugs in the exp10 family of functions right now in glibc. While those haven't been causing problems I've seen in the wild, it gives me concerns that we may need to wait until an even later release of glibc before we can reliably transform code into exp10. llvm-svn: 198093
2013-12-26TLI: Make exp10* avaiable on Linux/Mac/iOS and unavailable elsewhereReid Kleckner1-34/+33
This makes it unavailable on NetBSD, Android, etc. Patch by Brad Smith! llvm-svn: 198056
2013-12-16Enable double to float shrinking optimizations for binary functions like ↵Yi Jiang1-0/+10
'fmin/fmax'. Fix radar:15283121 llvm-svn: 197434
2013-12-15There is no exp10 on NetBSD.Joerg Sonnenberger1-0/+6
llvm-svn: 197348
2013-12-12Resubmit r196544: Apply transformation on OS X 10.9+ and iOS 7.0+: pow(10, ↵Yi Jiang1-0/+25
x) ―> __exp10(x) llvm-svn: 197109
2013-12-08Revert 196544 due to internal bot failures.Manman Ren1-25/+0
llvm-svn: 196732
2013-12-05Apply transformation on OS X 10.9+ and iOS 7.0+: pow(10, x) ―> __exp10(x)Yi Jiang1-0/+25
llvm-svn: 196544
2013-11-03Convert calls to __sinpi and __cospi into __sincospi_stretBob Wilson1-0/+33
This adds an SimplifyLibCalls case which converts the special __sinpi and __cospi (float & double variants) into a __sincospi_stret where appropriate to remove duplicated work. Patch by Tim Northover llvm-svn: 193943
2013-08-29Clean up some usage of Triple. The base class has methods for determining ↵Cameron Esfahani1-2/+2
if the target is iOS and Linux. llvm-svn: 189604
2013-07-21Treat nothrow forms of ::operator delete and ::operator delete[] asRichard Smith1-0/+2
deallocation functions. llvm-svn: 186798
2013-07-03Added posix function gettimeofday to LibFunc::Func for all platforms but ↵Michael Gottesman1-0/+2
Windows. *NOTE* In a recent version of posix, they added the restrict keyword to the arguments for this function. From some spelunking it seems that on some platforms, the call has restrict on its arguments and others it does not. Thus I left off the restrict keyword from the function prototype in the comment. llvm-svn: 185501
2013-05-27Convert sqrt functions into sqrt instructions when -ffast-math is in effect.Preston Gurd1-0/+3
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
2013-03-13Add one more overload to make VS2008's debug mody happy.Benjamin Kramer1-0/+3
sigh. llvm-svn: 176946
2013-03-09TLI: Microoptimize calls to strlen+memcmp to strncmp.Benjamin Kramer1-2/+24
The strlen+memcmp was hidden in a call to StringRef::operator==. We check if there are any null bytes in the string upfront so we can simplify the comparison Small speedup when compiling code with many function calls. llvm-svn: 176766
2013-03-05Add more functions to the TLI.Meador Inge1-9/+212
This patch adds many more functions to the target library information. All of the functions being added were discovered while doing the migration of the simplify-libcalls attribute annotation functionality to the functionattrs pass. As a part of that work the attribute annotation logic will query TLI to determine if a function should be annotated or not. Signed-off-by: Meador Inge <meadori@codesourcery.com> llvm-svn: 176514
2012-11-22Add more functions to the target library information.Meador Inge1-0/+47
I discovered a few more missing functions while migrating optimizations from the simplify-libcalls pass to the instcombine (I already added some in r167659). llvm-svn: 168501
2012-11-10Add more functions to the target library information.Meador Inge1-0/+18
In the process of migrating optimizations from the simplify-libcalls pass to the instcombine pass I noticed that a few functions are missing from the target library information. These functions need to be available for querying in the instcombine library call simplifiers. More functions will probably be added in the future as more simplifiers are migrated to instcombine. llvm-svn: 167659
2012-08-29Make MemoryBuiltins aware of TargetLibraryInfo.Benjamin Kramer1-1/+20
This disables malloc-specific optimization when -fno-builtin (or -ffreestanding) is specified. This has been a problem for a long time but became more severe with the recent memory builtin improvements. Since the memory builtin functions are used everywhere, this required passing TLI in many places. This means that functions that now have an optional TLI argument, like RecursivelyDeleteTriviallyDeadFunctions, won't remove dead mallocs anymore if the TLI argument is missing. I've updated most passes to do the right thing. Fixes PR13694 and probably others. llvm-svn: 162841
2012-08-21Add a few functions to TargetLibraryInfo as part of PR13574.Chad Rosier1-0/+36
Patch by Weiming Zhao <weimingz@codeaurora.org>. llvm-svn: 162329
2012-08-03Add new getLibFunc method to TargetLibraryInfo.Bob Wilson1-37/+56
This just provides a way to look up a LibFunc::Func enum value for a function name. Alphabetize the enums and function names so we can use a binary search. llvm-svn: 161231
2012-07-25make all Emit*() functions consult the TargetLibraryInfo information before ↵Nuno Lopes1-1/+2
creating a call to a library function. Update all clients to pass the TLI information around. Previous draft reviewed by Eli. llvm-svn: 160733
2012-07-24add a few more functions to TargetLibraryInfo:Nuno Lopes1-0/+7
fputc, memchr, memcmp, putchar, puts, strchr, strncmp llvm-svn: 160690
2012-07-24TargetLibraryInfo: add strn?cat, strn?cpy, and strn?lenNuno Lopes1-0/+6
llvm-svn: 160678
2012-04-17fix pr12559: mark unavailable win32 math libcallsJoe Groff1-1/+79
also fix SimplifyLibCalls to use TLI rather than compile-time conditionals to enable optimizations on floor, ceil, round, rint, and nearbyint llvm-svn: 154960
2012-02-12Remove redundant getAnalysis<> calls in GlobalOpt. Add a few Itanium ABI callsNick Lewycky1-1/+5
to TargetLibraryInfo and use one of them in GlobalOpt. llvm-svn: 150323
2011-12-20Unweaken vtables as per ↵David Blaikie1-0/+2
http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146960
2011-12-08Enhance both TargetLibraryInfo and SelectionDAGBuilder so that the latter ↵Owen Anderson1-1/+13
can use the former to prevent the formation of libm SDNode's when -fno-builtin is passed. llvm-svn: 146193
2011-12-01Add missing functions.Chad Rosier1-1/+4
llvm-svn: 145608
2011-12-01Add a few more functions to TargetLibraryInfo. More of rdar://10500969.Chad Rosier1-1/+16
llvm-svn: 145596
2011-11-30Add a few functions to TargetLibraryInfo.Chad Rosier1-2/+50
llvm-svn: 145508
2011-11-30Alphabetize TargetLibraryInfo enum and fix doxygen comments. No functionalChad Rosier1-6/+6
change intended. llvm-svn: 145468
2011-11-29Add support for sqrt, sqrtl, and sqrtf in TargetLibraryInfo. Disable Chad Rosier1-0/+3
(fptrunc (sqrt (fpext x))) -> (sqrtf x) transformation if -fno-builtin is specified. rdar://10466410 llvm-svn: 145460
2011-11-17Add support for custom names for library functions in TargetLibraryInfo. ↵Eli Friedman1-0/+25
Add a custom name for fwrite and fputs on x86-32 OSX. Make SimplifyLibCalls honor the custom names for fwrite and fputs. Fixes <rdar://problem/9815881>. llvm-svn: 144876
2011-06-09Enable printf() to iprintf() optimization for the TCE target.Duncan Sands1-2/+2
Patch by Pekka Jaaskelainen. llvm-svn: 132774
2011-05-21add a copy ctor to TargetLibraryInfo.Chris Lattner1-0/+6
llvm-svn: 131806
2011-04-20ADT/Triple: Renambe isOSX... methods to isMacOSX for consistency with the OSDaniel Dunbar1-2/+2
triple component. llvm-svn: 129838
2011-04-19Target: Eliminate a use of getDarwinMajorNumber().Daniel Dunbar1-1/+8
llvm-svn: 129803
2011-03-03Optimize fprintf -> iprintf if there are no floating point argumentsRichard Osborne1-0/+1
and siprintf is available on the target. llvm-svn: 126940
2011-03-03Optimize sprintf -> siprintf if there are no floating point argumentsRichard Osborne1-2/+4
and siprintf is available on the target. llvm-svn: 126937