summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/TargetLibraryInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
* R600/SI: Add check for amdgcn triple forgotten in r225276.Tom Stellard2015-01-071-2/+3
| | | | llvm-svn: 225331
* Add fortified (__*_chk) library functions to TLI (NFC)Ahmed Bougacha2014-11-121-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
* Use triple's isiOS() and isOSDarwin() methods.Bob Wilson2014-10-091-2/+2
| | | | | | | These methods are already used in lots of places. This makes things more consistent. NFC. llvm-svn: 219386
* PR21145: Teach LLVM about C++14 sized deallocation functions.Richard Smith2014-10-031-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
* Target: invert condition for WindowsSaleem Abdulrasool2014-07-241-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
* X86: correct library call setup for Windows itaniumSaleem Abdulrasool2014-07-241-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
* TargetLibraryInfo: Disable memcpy and memset on R600Tom Stellard2014-04-021-1/+10
| | | | | | There are no implementations of these for R600. llvm-svn: 205455
* Canonicalise Windows target triple spellingsSaleem Abdulrasool2014-03-271-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
* "Mac OS/X" -> "Mac OS X" spelling fixes for llvm.Nico Weber2014-03-071-1/+1
| | | | | | Patch from Sean McBride <sean@rogue-research.com>! llvm-svn: 203258
* SimplifyLibCalls: Push TLI through the exp2->ldexp transform.Benjamin Kramer2014-02-041-0/+5
| | | | | | For the odd case of platforms with exp2 available but not ldexp. llvm-svn: 200795
* OS X: the correct function is __sincospif_stret, not __sincospi_stretfTim Northover2014-02-041-2/+2
| | | | | | rdar://problem/13729466 llvm-svn: 200771
* Disable transforms that introduce calls to exp10*() on Linux due toChandler Carruth2013-12-281-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
* TLI: Make exp10* avaiable on Linux/Mac/iOS and unavailable elsewhereReid Kleckner2013-12-261-34/+33
| | | | | | | | This makes it unavailable on NetBSD, Android, etc. Patch by Brad Smith! llvm-svn: 198056
* Enable double to float shrinking optimizations for binary functions like ↵Yi Jiang2013-12-161-0/+10
| | | | | | 'fmin/fmax'. Fix radar:15283121 llvm-svn: 197434
* There is no exp10 on NetBSD.Joerg Sonnenberger2013-12-151-0/+6
| | | | llvm-svn: 197348
* Resubmit r196544: Apply transformation on OS X 10.9+ and iOS 7.0+: pow(10, ↵Yi Jiang2013-12-121-0/+25
| | | | | | x) ―> __exp10(x) llvm-svn: 197109
* Revert 196544 due to internal bot failures.Manman Ren2013-12-081-25/+0
| | | | llvm-svn: 196732
* Apply transformation on OS X 10.9+ and iOS 7.0+: pow(10, x) ―> __exp10(x)Yi Jiang2013-12-051-0/+25
| | | | llvm-svn: 196544
* Convert calls to __sinpi and __cospi into __sincospi_stretBob Wilson2013-11-031-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
* Clean up some usage of Triple. The base class has methods for determining ↵Cameron Esfahani2013-08-291-2/+2
| | | | | | if the target is iOS and Linux. llvm-svn: 189604
* Treat nothrow forms of ::operator delete and ::operator delete[] asRichard Smith2013-07-211-0/+2
| | | | | | deallocation functions. llvm-svn: 186798
* Added posix function gettimeofday to LibFunc::Func for all platforms but ↵Michael Gottesman2013-07-031-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
* Convert sqrt functions into sqrt instructions when -ffast-math is in effect.Preston Gurd2013-05-271-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
* Add one more overload to make VS2008's debug mody happy.Benjamin Kramer2013-03-131-0/+3
| | | | | | sigh. llvm-svn: 176946
* TLI: Microoptimize calls to strlen+memcmp to strncmp.Benjamin Kramer2013-03-091-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
* Add more functions to the TLI.Meador Inge2013-03-051-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
* Add more functions to the target library information.Meador Inge2012-11-221-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
* Add more functions to the target library information.Meador Inge2012-11-101-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
* Make MemoryBuiltins aware of TargetLibraryInfo.Benjamin Kramer2012-08-291-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
* Add a few functions to TargetLibraryInfo as part of PR13574.Chad Rosier2012-08-211-0/+36
| | | | | | Patch by Weiming Zhao <weimingz@codeaurora.org>. llvm-svn: 162329
* Add new getLibFunc method to TargetLibraryInfo.Bob Wilson2012-08-031-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
* make all Emit*() functions consult the TargetLibraryInfo information before ↵Nuno Lopes2012-07-251-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
* add a few more functions to TargetLibraryInfo:Nuno Lopes2012-07-241-0/+7
| | | | | | fputc, memchr, memcmp, putchar, puts, strchr, strncmp llvm-svn: 160690
* TargetLibraryInfo: add strn?cat, strn?cpy, and strn?lenNuno Lopes2012-07-241-0/+6
| | | | llvm-svn: 160678
* fix pr12559: mark unavailable win32 math libcallsJoe Groff2012-04-171-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
* Remove redundant getAnalysis<> calls in GlobalOpt. Add a few Itanium ABI callsNick Lewycky2012-02-121-1/+5
| | | | | | to TargetLibraryInfo and use one of them in GlobalOpt. llvm-svn: 150323
* Unweaken vtables as per ↵David Blaikie2011-12-201-0/+2
| | | | | | http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146960
* Enhance both TargetLibraryInfo and SelectionDAGBuilder so that the latter ↵Owen Anderson2011-12-081-1/+13
| | | | | | can use the former to prevent the formation of libm SDNode's when -fno-builtin is passed. llvm-svn: 146193
* Add missing functions.Chad Rosier2011-12-011-1/+4
| | | | llvm-svn: 145608
* Add a few more functions to TargetLibraryInfo. More of rdar://10500969.Chad Rosier2011-12-011-1/+16
| | | | llvm-svn: 145596
* Add a few functions to TargetLibraryInfo.Chad Rosier2011-11-301-2/+50
| | | | llvm-svn: 145508
* Alphabetize TargetLibraryInfo enum and fix doxygen comments. No functionalChad Rosier2011-11-301-6/+6
| | | | | | change intended. llvm-svn: 145468
* Add support for sqrt, sqrtl, and sqrtf in TargetLibraryInfo. Disable Chad Rosier2011-11-291-0/+3
| | | | | | | | (fptrunc (sqrt (fpext x))) -> (sqrtf x) transformation if -fno-builtin is specified. rdar://10466410 llvm-svn: 145460
* Add support for custom names for library functions in TargetLibraryInfo. ↵Eli Friedman2011-11-171-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
* Enable printf() to iprintf() optimization for the TCE target.Duncan Sands2011-06-091-2/+2
| | | | | | Patch by Pekka Jaaskelainen. llvm-svn: 132774
* add a copy ctor to TargetLibraryInfo.Chris Lattner2011-05-211-0/+6
| | | | llvm-svn: 131806
* ADT/Triple: Renambe isOSX... methods to isMacOSX for consistency with the OSDaniel Dunbar2011-04-201-2/+2
| | | | | | triple component. llvm-svn: 129838
* Target: Eliminate a use of getDarwinMajorNumber().Daniel Dunbar2011-04-191-1/+8
| | | | llvm-svn: 129803
* Optimize fprintf -> iprintf if there are no floating point argumentsRichard Osborne2011-03-031-0/+1
| | | | | | and siprintf is available on the target. llvm-svn: 126940
* Optimize sprintf -> siprintf if there are no floating point argumentsRichard Osborne2011-03-031-2/+4
| | | | | | and siprintf is available on the target. llvm-svn: 126937
OpenPOWER on IntegriCloud