Commit Graph

18492 Commits

Author SHA1 Message Date
Reid Spencer
b2825216a4 Actually make this pass test something related to fputs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21619 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-29 10:10:17 +00:00
Reid Spencer
ff5525daf3 Implement the optimizations for "pow" and "fputs" library calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21618 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-29 09:39:47 +00:00
Reid Spencer
bb4cae7d69 Add a test case for the puts libcall optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21616 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-29 07:19:00 +00:00
Reid Spencer
45254f7be0 Add a testcase for optimizing the strcpy libcall.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21615 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-29 06:01:28 +00:00
Reid Spencer
df4945bcb5 Remove optimizations that don't require both operands to be constant. These
are moved to simplify-libcalls pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21614 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-29 05:55:35 +00:00
Reid Spencer
0f4a891803 New test case for testing pow(3) math library optimizations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21613 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-29 05:47:05 +00:00
Jeff Cohen
5882b92360 Consistently use 'class' to silence VC++
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21612 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-29 03:05:44 +00:00
Reid Spencer
1d3b71846b * 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21611 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-28 23:01:59 +00:00
Chris Lattner
2c56e8a23e Add support for FSQRT node, patch contributed by Morten Ofstad
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21610 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-28 22:07:18 +00:00
Chris Lattner
5b103c20e3 These functions can set errno!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21609 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-28 21:52:31 +00:00
Chris Lattner
5afc124bdf Add some new X86 instrs, patch contributed by Morten Ofstad
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21608 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-28 21:50:05 +00:00
Chris Lattner
3b6b63711e Codegen fabs/fabsf as FABS. Patch contributed by Morten Ofstad
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21607 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-28 21:48:42 +00:00
Chris Lattner
da6ba87d23 Legalize FSQRT, FSIN, FCOS nodes, patch contributed by Morten Ofstad
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21606 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-28 21:44:33 +00:00
Chris Lattner
7f64464ff1 Add FSQRT, FSIN, FCOS nodes, patch contributed by Morten Ofstad
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21605 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-28 21:44:03 +00:00
Reid Spencer
5624c75f9f Remove from the TODO list those optimizations that are already handled by
constant folding implemented in lib/Transforms/Utils/Local.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21604 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-28 18:05:16 +00:00
Reid Spencer
8441a01146 Document additional libcall transformations that need to be written.
Help Wanted!

There's a lot of them to write.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21603 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-28 04:40:06 +00:00
Reid Spencer
716f49e5a2 Doxygenate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21602 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-27 21:29:20 +00:00
Chris Lattner
209a0aea22 remove 'statement with no effect' warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21600 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-27 20:12:17 +00:00
Andrew Lenharth
2d86ea21dd 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21599 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-27 20:10:01 +00:00
Chris Lattner
22cab6c752 Unbreak the sparc backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21598 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-27 18:57:15 +00:00
Reid Spencer
3f7d8c65bb More Cleanup:
* Name the instructions by appending to name of original
* Factor common part out of a switch statement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21597 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-27 17:46:54 +00:00
Andrew Lenharth
e3142bee52 import fix and plot multiple lines at once
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21596 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-27 17:32:41 +00:00
Andrew Lenharth
e43b3fbb5f Generate a gnuplot script for any program and any test (like llc or gcc)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21593 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-27 16:41:50 +00:00
Andrew Lenharth
91aa9eec5f So you want to import nightly tester data into a data base? Have we got the perl script for you
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21592 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-27 16:03:01 +00:00
Andrew Lenharth
6e92729e98 fix for parse, and a start at db import. Using CVS as scp :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21591 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-27 14:57:26 +00:00
Duraid Madina
85d5f6067d clean up some warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21590 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-27 11:57:39 +00:00
Reid Spencer
a16d5a5185 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21589 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-27 07:54:40 +00:00
Chris Lattner
d651f441ae 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21587 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-27 04:52:23 +00:00
Chris Lattner
cd4b7a4454 Test the noreturn function optimization
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21586 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-27 04:51:01 +00:00
Reid Spencer
ff1c9e2147 Add the simplify-libcalls pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21585 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-27 02:22:47 +00:00
Andrew Lenharth
4430e3a4a8 A first step towards being able to do more interesting things with the nightly tester data. Moreinteresting things will come soon, so tune in
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21584 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-27 02:13:20 +00:00
Reid Spencer
026a87a868 Prefix the debug statistics so they group together.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21583 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-27 00:20:23 +00:00
Reid Spencer
1ea099c5fd 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21582 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-27 00:05:45 +00:00
Chris Lattner
bc9fa589ef This analysis doesn't take 'throwing' into consideration, it looks at
'unwinding'


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21581 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-26 23:53:25 +00:00
Reid Spencer
0ddf0d6bec Fix up the debug statement to actually use a newline .. radical concept.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21580 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-26 23:07:08 +00:00
Reid Spencer
ef99ea318e Uh, this isn't argpromotion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21579 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-26 23:05:17 +00:00
Reid Spencer
8f13261863 Add some debugging output so we can tell which calls are getting triggered
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21578 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-26 23:02:16 +00:00
Chris Lattner
c915108e1d no parens
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21577 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-26 22:57:07 +00:00
Chris Lattner
695b78b5f7 update some paths
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21576 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-26 22:56:16 +00:00
Reid Spencer
47a3785062 No, seriously folks, memcpy really does return void.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21575 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-26 22:49:48 +00:00
Reid Spencer
a525f6d8f5 memcpy returns void!!!!!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21574 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-26 22:46:23 +00:00
Reid Spencer
a8d451e1d4 Convert the remainder of the intrinsic function prototypes to "declare"
form from the "call" form.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21573 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-26 20:50:44 +00:00
Reid Spencer
d462235968 Use the declare syntax not the call syntax for intrinsic prototypes so
the uninitiated reader is not confused.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21572 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-26 20:41:16 +00:00
Chris Lattner
3f80a38859 don't let Reid build void*'s :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21571 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-26 20:03:33 +00:00
Reid Spencer
43fd4d077f 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21570 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-26 19:55:57 +00:00
Reid Spencer
fcbdb9c85b 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21569 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-26 19:13:17 +00:00
Reid Spencer
7b7adcffa7 Add a test case for MemMove.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21568 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-26 19:05:51 +00:00
Reid Spencer
c662bc71df Result of strlen is size_t which is either uint or ulong, not int.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21567 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-26 19:04:46 +00:00
Chris Lattner
318c149823 Make interval partition print correctly, patch contributed by
Vladimir Prus!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21566 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-26 14:48:28 +00:00
Chris Lattner
93b94a6ccf Fix the compile failures from last night.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21565 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-26 14:40:41 +00:00