1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-28 22:42:52 +01:00
Commit Graph

18753 Commits

Author SHA1 Message Date
Reid Spencer
a32eb179ed Implement the optimizations for "pow" and "fputs" library calls.
llvm-svn: 21618
2005-04-29 09:39:47 +00:00
Reid Spencer
1846b68692 Add a test case for the puts libcall optimization.
llvm-svn: 21616
2005-04-29 07:19:00 +00:00
Reid Spencer
5c9efed75f Add a testcase for optimizing the strcpy libcall.
llvm-svn: 21615
2005-04-29 06:01:28 +00:00
Reid Spencer
ff5cc3cb16 Remove optimizations that don't require both operands to be constant. These
are moved to simplify-libcalls pass.

llvm-svn: 21614
2005-04-29 05:55:35 +00:00
Reid Spencer
16dac19584 New test case for testing pow(3) math library optimizations.
llvm-svn: 21613
2005-04-29 05:47:05 +00:00
Jeff Cohen
6dccb593c9 Consistently use 'class' to silence VC++
llvm-svn: 21612
2005-04-29 03:05:44 +00:00
Reid Spencer
fb6e0590a8 * Add constant folding for additional floating point library calls such as
sinh, cosh, etc.
* Make the name comparisons for the fp libcalls a little more efficient by
  switching on the first character of the name before doing comparisons.

llvm-svn: 21611
2005-04-28 23:01:59 +00:00
Chris Lattner
27a534f181 Add support for FSQRT node, patch contributed by Morten Ofstad
llvm-svn: 21610
2005-04-28 22:07:18 +00:00
Chris Lattner
fb0d0ea349 These functions can set errno!
llvm-svn: 21609
2005-04-28 21:52:31 +00:00
Chris Lattner
236cef3563 Add some new X86 instrs, patch contributed by Morten Ofstad
llvm-svn: 21608
2005-04-28 21:50:05 +00:00
Chris Lattner
2f7a83ffbf Codegen fabs/fabsf as FABS. Patch contributed by Morten Ofstad
llvm-svn: 21607
2005-04-28 21:48:42 +00:00
Chris Lattner
6ec8bb9e8d Legalize FSQRT, FSIN, FCOS nodes, patch contributed by Morten Ofstad
llvm-svn: 21606
2005-04-28 21:44:33 +00:00
Chris Lattner
4678a790e6 Add FSQRT, FSIN, FCOS nodes, patch contributed by Morten Ofstad
llvm-svn: 21605
2005-04-28 21:44:03 +00:00
Reid Spencer
e7eb17c64b Remove from the TODO list those optimizations that are already handled by
constant folding implemented in lib/Transforms/Utils/Local.cpp.

llvm-svn: 21604
2005-04-28 18:05:16 +00:00
Reid Spencer
b5d4b854ea Document additional libcall transformations that need to be written.
Help Wanted!

There's a lot of them to write.

llvm-svn: 21603
2005-04-28 04:40:06 +00:00
Reid Spencer
49cfe25457 Doxygenate.
llvm-svn: 21602
2005-04-27 21:29:20 +00:00
Chris Lattner
96704dee49 remove 'statement with no effect' warning
llvm-svn: 21600
2005-04-27 20:12:17 +00:00
Andrew Lenharth
2a00530fa7 Implement Value* tracking for loads and stores in the selection DAG. This enables one to use alias analysis in the backends.
(TRUNK)Stores and (EXT|ZEXT|SEXT)Loads have an extra SDOperand which is a SrcValueSDNode which contains the Value*.  Note that if the operation is introduced by the backend, it will still have the operand, but the value* will be null.

llvm-svn: 21599
2005-04-27 20:10:01 +00:00
Chris Lattner
11f6bc02a9 Unbreak the sparc backend.
llvm-svn: 21598
2005-04-27 18:57:15 +00:00
Reid Spencer
b7cff5d9d1 More Cleanup:
* Name the instructions by appending to name of original
* Factor common part out of a switch statement.

llvm-svn: 21597
2005-04-27 17:46:54 +00:00
Andrew Lenharth
546799537e import fix and plot multiple lines at once
llvm-svn: 21596
2005-04-27 17:32:41 +00:00
Andrew Lenharth
6f0a7297ed Generate a gnuplot script for any program and any test (like llc or gcc)
llvm-svn: 21593
2005-04-27 16:41:50 +00:00
Andrew Lenharth
4cb11c1c66 So you want to import nightly tester data into a data base? Have we got the perl script for you
llvm-svn: 21592
2005-04-27 16:03:01 +00:00
Andrew Lenharth
20489f8c6e fix for parse, and a start at db import. Using CVS as scp :)
llvm-svn: 21591
2005-04-27 14:57:26 +00:00
Duraid Madina
2f8f3f018d clean up some warnings
llvm-svn: 21590
2005-04-27 11:57:39 +00:00
Reid Spencer
1eb67fef62 This is a cleanup commit:
* Correct stale documentation in a few places
* Re-order the file to better associate things and reduce line count
* Make the pass thread safe by caching the Function* objects needed by the
  optimizers in the pass object instead of globally.
* Provide the SimplifyLibCalls pass object to the optimizer classes so they
  can access cached Function* objects and TargetData info
* Make sure the pass resets its cache if the Module passed to runOnModule
  changes
* Rename CallOptimizer LibCallOptimization. All the classes are named
  *Optimization while the objects are *Optimizer.
* Don't cache Function* in the optimizer objects because they could be used
  by multiple PassManager's running in multiple threads
* Add an optimization for strcpy which is similar to strcat
* Add a "TODO" list at the end of the file for ideas on additional libcall
  optimizations that could be added (get ideas from other compilers).

Sorry for the huge diff. Its mostly reorganization of code. That won't
happen again as I believe the design and infrastructure for this pass is
now done or close to it.

llvm-svn: 21589
2005-04-27 07:54:40 +00:00
Chris Lattner
792ae155ad detect functions that never return, and turn the instruction following a
call to them into an 'unreachable' instruction.

This triggers a bunch of times, particularly on gcc:

gzip: 36
gcc: 601
eon: 12
bzip: 38
llvm-svn: 21587
2005-04-27 04:52:23 +00:00
Chris Lattner
229735db58 Test the noreturn function optimization
llvm-svn: 21586
2005-04-27 04:51:01 +00:00
Reid Spencer
2f676b4fd8 Add the simplify-libcalls pass.
llvm-svn: 21585
2005-04-27 02:22:47 +00:00
Andrew Lenharth
58a23e6e90 A first step towards being able to do more interesting things with the nightly tester data. Moreinteresting things will come soon, so tune in
llvm-svn: 21584
2005-04-27 02:13:20 +00:00
Reid Spencer
e3b60245eb Prefix the debug statistics so they group together.
llvm-svn: 21583
2005-04-27 00:20:23 +00:00
Reid Spencer
27f80b8c96 In debug builds, make a statistic for each kind of call optimization. This
helps track down what gets triggered in the pass so its easier to identify
good test cases.

llvm-svn: 21582
2005-04-27 00:05:45 +00:00
Chris Lattner
bd077a1945 This analysis doesn't take 'throwing' into consideration, it looks at
'unwinding'

llvm-svn: 21581
2005-04-26 23:53:25 +00:00
Reid Spencer
ddef064121 Fix up the debug statement to actually use a newline .. radical concept.
llvm-svn: 21580
2005-04-26 23:07:08 +00:00
Reid Spencer
7f06064798 Uh, this isn't argpromotion.
llvm-svn: 21579
2005-04-26 23:05:17 +00:00
Reid Spencer
42906defb1 Add some debugging output so we can tell which calls are getting triggered
llvm-svn: 21578
2005-04-26 23:02:16 +00:00
Chris Lattner
70f60359cd no parens
llvm-svn: 21577
2005-04-26 22:57:07 +00:00
Chris Lattner
5cba4ccc8b update some paths
llvm-svn: 21576
2005-04-26 22:56:16 +00:00
Reid Spencer
47a20efcb0 No, seriously folks, memcpy really does return void.
llvm-svn: 21575
2005-04-26 22:49:48 +00:00
Reid Spencer
270f03e49e memcpy returns void!!!!!
llvm-svn: 21574
2005-04-26 22:46:23 +00:00
Reid Spencer
ef72727630 Convert the remainder of the intrinsic function prototypes to "declare"
form from the "call" form.

llvm-svn: 21573
2005-04-26 20:50:44 +00:00
Reid Spencer
a973fb004f Use the declare syntax not the call syntax for intrinsic prototypes so
the uninitiated reader is not confused.

llvm-svn: 21572
2005-04-26 20:41:16 +00:00
Chris Lattner
6b2ebc1531 don't let Reid build void*'s :)
llvm-svn: 21571
2005-04-26 20:03:33 +00:00
Reid Spencer
303c65cea6 Fix some bugs found by running on llvm-test:
* MemCpyOptimization can only be optimized if the 3rd and 4th arguments are
  constants and we weren't checking for that.
* The result of llvm.memcpy (and llvm.memmove) is void* not sbyte*, put in
  a cast.

llvm-svn: 21570
2005-04-26 19:55:57 +00:00
Reid Spencer
27afdaf88f Changes From Review Feedback:
* Have the SimplifyLibCalls pass acquire the TargetData and pass it down to
  the optimization classes so they can use it to make better choices for
  the signatures of functions, etc.
* Rearrange the code a little so the utility functions are closer to their
  usage and keep the core of the pass near the top of the files.
* Adjust the StrLen pass to get/use the correct prototype depending on the
  TargetData::getIntPtrType() result. The result of strlen is size_t which
  could be either uint or ulong depending on the platform.
* Clean up some coding nits (cast vs. dyn_cast, remove redundant items from
  a switch, etc.)
* Implement the MemMoveOptimization as a twin of MemCpyOptimization (they
  only differ in name).

llvm-svn: 21569
2005-04-26 19:13:17 +00:00
Reid Spencer
23a4d5b15c Add a test case for MemMove.ll
llvm-svn: 21568
2005-04-26 19:05:51 +00:00
Reid Spencer
5f499593d2 Result of strlen is size_t which is either uint or ulong, not int.
llvm-svn: 21567
2005-04-26 19:04:46 +00:00
Chris Lattner
5dc0b9e938 Make interval partition print correctly, patch contributed by
Vladimir Prus!

llvm-svn: 21566
2005-04-26 14:48:28 +00:00
Chris Lattner
f6199ef63a Fix the compile failures from last night.
llvm-svn: 21565
2005-04-26 14:40:41 +00:00
Duraid Madina
90bcae7fd2 constmul bugfix: multiply by 27611 was broken
llvm-svn: 21564
2005-04-26 09:42:50 +00:00