1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

33 Commits

Author SHA1 Message Date
Richard Smith
15b9b9e375 Treat nothrow forms of ::operator delete and ::operator delete[] as
deallocation functions.

llvm-svn: 186798
2013-07-21 23:11:42 +00:00
Michael Gottesman
d7c5289311 Added posix function gettimeofday to LibFunc::Func for all platforms but 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-07-03 04:00:51 +00:00
Preston Gurd
8be7e42cc2 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
2013-05-27 15:44:35 +00:00
Benjamin Kramer
10d47de154 Add one more overload to make VS2008's debug mody happy.
sigh.

llvm-svn: 176946
2013-03-13 13:50:47 +00:00
Benjamin Kramer
e185cd1e7b TLI: Microoptimize calls to strlen+memcmp to strncmp.
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-09 13:48:23 +00:00
Meador Inge
509bee9bf5 Add more functions to the TLI.
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
2013-03-05 21:47:40 +00:00
Meador Inge
9397e14bdb Add more functions to the target library information.
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-22 15:36:42 +00:00
Meador Inge
c87e59c34e Add more functions to the target library information.
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-11-10 03:11:06 +00:00
Benjamin Kramer
b92d13cc42 Make MemoryBuiltins aware of TargetLibraryInfo.
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-29 15:32:21 +00:00
Chad Rosier
3f65a99bf7 Add a few functions to TargetLibraryInfo as part of PR13574.
Patch by Weiming Zhao <weimingz@codeaurora.org>.

llvm-svn: 162329
2012-08-21 23:28:56 +00:00
Bob Wilson
627fc538a7 Add new getLibFunc method to TargetLibraryInfo.
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-08-03 04:06:22 +00:00
Nuno Lopes
537a3395e5 make all Emit*() functions consult the TargetLibraryInfo information before 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-25 16:46:31 +00:00
Nuno Lopes
6319e86c31 add a few more functions to TargetLibraryInfo:
fputc, memchr, memcmp, putchar, puts, strchr, strncmp

llvm-svn: 160690
2012-07-24 21:00:36 +00:00
Nuno Lopes
aa177bbdbc TargetLibraryInfo: add strn?cat, strn?cpy, and strn?len
llvm-svn: 160678
2012-07-24 17:25:06 +00:00
Joe Groff
cc9c07aacc fix pr12559: mark unavailable win32 math libcalls
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-04-17 23:05:54 +00:00
Nick Lewycky
0e211cfa88 Remove redundant getAnalysis<> calls in GlobalOpt. Add a few Itanium ABI calls
to TargetLibraryInfo and use one of them in GlobalOpt.

llvm-svn: 150323
2012-02-12 02:15:20 +00:00
David Blaikie
576aba04f1 Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch
llvm-svn: 146960
2011-12-20 02:50:00 +00:00
Owen Anderson
285891eccf Enhance both TargetLibraryInfo and SelectionDAGBuilder so that the latter can use the former to prevent the formation of libm SDNode's when -fno-builtin is passed.
llvm-svn: 146193
2011-12-08 22:15:21 +00:00
Chad Rosier
aafbda2d54 Add missing functions.
llvm-svn: 145608
2011-12-01 18:26:19 +00:00
Chad Rosier
7610c57a02 Add a few more functions to TargetLibraryInfo. More of rdar://10500969.
llvm-svn: 145596
2011-12-01 17:54:37 +00:00
Chad Rosier
8c6d695c1e Add a few functions to TargetLibraryInfo.
llvm-svn: 145508
2011-11-30 19:19:00 +00:00
Chad Rosier
8b15aca551 Alphabetize TargetLibraryInfo enum and fix doxygen comments. No functional
change intended.

llvm-svn: 145468
2011-11-30 01:51:49 +00:00
Chad Rosier
c5fa9f413a Add support for sqrt, sqrtl, and sqrtf in TargetLibraryInfo. Disable
(fptrunc (sqrt (fpext x))) -> (sqrtf x) transformation if -fno-builtin is 
specified.
rdar://10466410

llvm-svn: 145460
2011-11-29 23:57:10 +00:00
Eli Friedman
d02d82d355 Add support for custom names for library functions in TargetLibraryInfo. 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-11-17 01:27:36 +00:00
Duncan Sands
a0c88a5dd5 Enable printf() to iprintf() optimization for the TCE target.
Patch by Pekka Jaaskelainen. 

llvm-svn: 132774
2011-06-09 11:11:45 +00:00
Chris Lattner
777808dcaf add a copy ctor to TargetLibraryInfo.
llvm-svn: 131806
2011-05-21 20:09:13 +00:00
Daniel Dunbar
82a4062a4e ADT/Triple: Renambe isOSX... methods to isMacOSX for consistency with the OS
triple component.

llvm-svn: 129838
2011-04-20 00:14:25 +00:00
Daniel Dunbar
6a52508cb9 Target: Eliminate a use of getDarwinMajorNumber().
llvm-svn: 129803
2011-04-19 20:44:08 +00:00
Richard Osborne
88d0d840f2 Optimize fprintf -> iprintf if there are no floating point arguments
and siprintf is available on the target.

llvm-svn: 126940
2011-03-03 14:20:22 +00:00
Richard Osborne
021b589253 Optimize sprintf -> siprintf if there are no floating point arguments
and siprintf is available on the target.

llvm-svn: 126937
2011-03-03 14:09:28 +00:00
Richard Osborne
df829ddcb7 Optimize printf -> iprintf if there are no floating point arguments
and iprintf is available on the target. Currently iprintf is only
marked as being available on the XCore.

llvm-svn: 126935
2011-03-03 13:17:51 +00:00
Chris Lattner
a0dede2c21 add a way to disable all builtins, wire it up to opt's -disable-simplifylibcalls flag.
llvm-svn: 125978
2011-02-18 22:34:03 +00:00
Chris Lattner
63dfb2c797 introduce a new TargetLibraryInfo pass, which transformations can use to
query about available library functions.  For now this just has 
memset_pattern16, which exists on darwin, but it can be extended for a 
bunch of other things in the future.

llvm-svn: 125965
2011-02-18 21:50:34 +00:00