Commit Graph

18510 Commits

Author SHA1 Message Date
Chris Lattner c8a6633dea Eliminate some random whitespace
llvm-svn: 21637
2005-04-30 04:44:07 +00:00
Chris Lattner 8002640eab Codegen and legalize sin/cos/llvm.sqrt as FSIN/FCOS/FSQRT calls. This patch
was contributed by Morten Ofstad, with some minor tweaks and bug fixes added
by me.

llvm-svn: 21636
2005-04-30 04:43:14 +00:00
Chris Lattner 9efa7e7533 add sin/cos tests
llvm-svn: 21635
2005-04-30 04:41:27 +00:00
Chris Lattner 9993823876 Doesn't support these nodes
llvm-svn: 21634
2005-04-30 04:26:56 +00:00
Chris Lattner 9c6bbafc15 This target doesn't support the FSIN/FCOS/FSQRT nodes yet
llvm-svn: 21633
2005-04-30 04:26:06 +00:00
Chris Lattner db68d39a01 Add support for FSIN/FCOS when unsafe math ops are enabled. Patch contributed by
Morten Ofstad!

llvm-svn: 21632
2005-04-30 04:25:35 +00:00
Chris Lattner 3b20386551 Add support for llvm.sqrt and sin/cos if unsafe math optimizations are enabled.
llvm-svn: 21631
2005-04-30 04:12:40 +00:00
Chris Lattner 4a2cc6603d Expose an option allowing unsafe math optimizations. Patch contributed by
Morten Ofstad!

llvm-svn: 21630
2005-04-30 04:09:52 +00:00
Chris Lattner 30fe4ac2fb Lower llvm.sqrt -> fsqrt/sqrt
llvm-svn: 21629
2005-04-30 04:07:50 +00:00
Chris Lattner 7100fcde6c Add a test for llvm.sqrt
llvm-svn: 21628
2005-04-30 04:07:15 +00:00
Chris Lattner 1c636f1118 Add llvm.sqrt intrinsic, patch contributed by Morten Ofstad
llvm-svn: 21627
2005-04-30 03:44:07 +00:00
Reid Spencer 4c444fe007 * Don't depend on "guessing" what a FILE* is, just require that the actual
type be obtained from a CallInst we're optimizing.
* Make it possible for getConstantStringLength to return the ConstantArray
  that it extracts in case the content is needed by an Optimization.
* Implement the strcmp optimization
* Implement the toascii optimization

This pass is now firing several to many times in the following MultiSource
tests:

Applications/Burg      -   7 (strcat,strcpy)
Applications/siod      -  13 (strcat,strcpy,strlen)
Applications/spiff     - 120 (exit,fputs,strcat,strcpy,strlen)
Applications/treecc    -  66 (exit,fputs,strcat,strcpy)
Applications/kimwitu++ -  34 (strcmp,strcpy,strlen)
Applications/SPASS     - 588 (exit,fputs,strcat,strcpy,strlen)

llvm-svn: 21626
2005-04-30 03:17:54 +00:00
Reid Spencer 29c6b848db * Fix signed/unsigned usage problem
* Rearrange for readability.

llvm-svn: 21625
2005-04-30 03:06:36 +00:00
Reid Spencer 10e99b2667 A new test case for the ToAsciiOptimizer.
llvm-svn: 21624
2005-04-30 01:00:52 +00:00
Reid Spencer 89339ffb22 A new test case for the StrCmpOptimization in -simplify-libcalls.
llvm-svn: 21623
2005-04-30 00:52:04 +00:00
Reid Spencer 1279398b1c This is StrCpy, NOT StrCat!
llvm-svn: 21622
2005-04-29 23:02:15 +00:00
Reid Spencer cadbe2bbf1 Get the name of the pass right in the documentation.
llvm-svn: 21621
2005-04-29 23:01:21 +00:00
Reid Spencer a2ddce3119 Fix the success criteria for the test to make call instructions with "pow"
not just any occurrence of "pow".

llvm-svn: 21620
2005-04-29 10:11:23 +00:00
Reid Spencer 9610da2670 Actually make this pass test something related to fputs.
llvm-svn: 21619
2005-04-29 10:10:17 +00:00
Reid Spencer 9361697f93 Implement the optimizations for "pow" and "fputs" library calls.
llvm-svn: 21618
2005-04-29 09:39:47 +00:00
Reid Spencer fc4cf1d435 Add a test case for the puts libcall optimization.
llvm-svn: 21616
2005-04-29 07:19:00 +00:00
Reid Spencer 2645640325 Add a testcase for optimizing the strcpy libcall.
llvm-svn: 21615
2005-04-29 06:01:28 +00:00
Reid Spencer c968ea0495 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 a8b889490e New test case for testing pow(3) math library optimizations.
llvm-svn: 21613
2005-04-29 05:47:05 +00:00
Jeff Cohen 4bc952f703 Consistently use 'class' to silence VC++
llvm-svn: 21612
2005-04-29 03:05:44 +00:00
Reid Spencer ed55a6b5e0 * 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 014d2c42e7 Add support for FSQRT node, patch contributed by Morten Ofstad
llvm-svn: 21610
2005-04-28 22:07:18 +00:00
Chris Lattner 59ecb57e4a These functions can set errno!
llvm-svn: 21609
2005-04-28 21:52:31 +00:00
Chris Lattner 61827484c7 Add some new X86 instrs, patch contributed by Morten Ofstad
llvm-svn: 21608
2005-04-28 21:50:05 +00:00
Chris Lattner effaec5436 Codegen fabs/fabsf as FABS. Patch contributed by Morten Ofstad
llvm-svn: 21607
2005-04-28 21:48:42 +00:00
Chris Lattner 9d6fa98ec7 Legalize FSQRT, FSIN, FCOS nodes, patch contributed by Morten Ofstad
llvm-svn: 21606
2005-04-28 21:44:33 +00:00
Chris Lattner 2f82d2d58a Add FSQRT, FSIN, FCOS nodes, patch contributed by Morten Ofstad
llvm-svn: 21605
2005-04-28 21:44:03 +00:00
Reid Spencer 16983ca865 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 649ac283e4 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 7ddcfb3375 Doxygenate.
llvm-svn: 21602
2005-04-27 21:29:20 +00:00
Chris Lattner 36ffb1ff37 remove 'statement with no effect' warning
llvm-svn: 21600
2005-04-27 20:12:17 +00:00
Andrew Lenharth 4a73c2cfdc 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 0a6f42ac1d Unbreak the sparc backend.
llvm-svn: 21598
2005-04-27 18:57:15 +00:00
Reid Spencer 08b4940509 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 3b63291fc1 import fix and plot multiple lines at once
llvm-svn: 21596
2005-04-27 17:32:41 +00:00
Andrew Lenharth 438225a8cb 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 e81871331f 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 be6ce82937 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 b071bef66a clean up some warnings
llvm-svn: 21590
2005-04-27 11:57:39 +00:00
Reid Spencer e249a82e73 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 93f4e9dd26 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 356cbfef73 Test the noreturn function optimization
llvm-svn: 21586
2005-04-27 04:51:01 +00:00
Reid Spencer a21f83f809 Add the simplify-libcalls pass.
llvm-svn: 21585
2005-04-27 02:22:47 +00:00
Andrew Lenharth 9b3114d4ed 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 dc11db68b6 Prefix the debug statistics so they group together.
llvm-svn: 21583
2005-04-27 00:20:23 +00:00