Commit Graph

18533 Commits

Author SHA1 Message Date
Reid Spencer
e6ec8cc8c6 Add the StrNCmpOptimization which is similar to strcmp.
Unfortunately, this optimization didn't trigger on any llvm-test tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21660 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-03 01:43:45 +00:00
Reid Spencer
f31918b84a Correct the title and the success criteria: strcmp -> strncmp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21659 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-03 00:52:19 +00:00
Reid Spencer
d2db880222 Add a new test case for the StrNCmpOptimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21658 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-03 00:50:43 +00:00
Reid Spencer
a1b4390938 Implement the fprintf optimization which converts calls like this:
fprintf(F,"hello") -> fwrite("hello",strlen("hello"),1,F)
  fprintf(F,"%s","hello") -> fwrite("hello",strlen("hello"),1,F)
  fprintf(F,"%c",'x') -> fputc('c',F)

This optimization fires severals times in llvm-test:

313 MultiSource/Applications/Burg
302 MultiSource/Benchmarks/Prolangs-C/TimberWolfMC
189 MultiSource/Benchmarks/Prolangs-C/mybison
175 MultiSource/Benchmarks/Prolangs-C/football
130 MultiSource/Benchmarks/Prolangs-C/unix-tbl


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21657 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-02 23:59:26 +00:00
Reid Spencer
6302abe69f Add a test case for testing the FPrintFOptimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21656 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-02 23:07:14 +00:00
Andrew Lenharth
8b9e3e6511 fold fp div by 0 to inf, the way gcc does. This is legal according to the FP spec
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21655 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-02 21:25:47 +00:00
Andrew Lenharth
abc73b3e5d Remove support for 1.0 style varargs
amusing of course, because we will have to go back to those semantics soon


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21654 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-02 19:07:27 +00:00
John Criswell
fe3706a12b Fixed a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21653 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-02 14:47:42 +00:00
Duraid Madina
40c9e6be3e support multiplication by constant negative integers
this constmul code is still buggy though, so beware. mul by 7427 is currently
broken, for example. will fix it when I get a moment :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21652 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-02 07:27:14 +00:00
Duraid Madina
4bd708d8a6 add support for bools to SELECT, this fixes Prolangs-C/bison from the
testsuite, however 09-vor is still dead (hopefully for other reasons!)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21651 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-02 06:41:13 +00:00
Reid Spencer
a7e302aadc Mention that arguments to functions must be first class types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21650 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-01 22:22:57 +00:00
Tanya Lattner
21d6ff546d Add accessor method,
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21649 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-01 16:22:41 +00:00
Tanya Lattner
9d6b6280c7 Adding ModuloSched SB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21648 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-01 16:14:34 +00:00
Chris Lattner
9fb25db11e Implement getelementptr.ll:test11
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21647 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-01 04:42:15 +00:00
Chris Lattner
f05fd0893e new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21646 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-01 04:41:57 +00:00
Chris Lattner
37366c1ba8 Check for volatile loads only once.
Implement load.ll:test7


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21645 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-01 04:24:53 +00:00
Chris Lattner
45c2bdd2f9 add a new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21644 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-01 04:24:15 +00:00
Tanya Lattner
874abe50ac SMS for superblocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21643 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-01 01:27:47 +00:00
Tanya Lattner
be2b84aa9e Added extra constructor for superblocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21642 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-01 01:25:53 +00:00
Tanya Lattner
c50156360a Fixed bug in searchPath function for finding nodes between two recurrences.
Changed dependence analyzer to only use dep distances of 2 or less.
This is experimental.

Changed MSchedGraph to be able to represent more then one BB (first steps).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21641 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-30 23:07:59 +00:00
Andrew Lenharth
50d91d71a5 I was sure I had thought about this and there was a reason it should work.
But it is entirely possible I am just crazy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21640 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-30 14:19:13 +00:00
Alkis Evlogimenos
b1beff0f0d Do not use deprecated APIs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21639 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-30 07:13:31 +00:00
Reid Spencer
63a7513ac1 Fix a comment that stated the wrong thing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21638 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-30 06:45:47 +00:00
Chris Lattner
9c9183aef4 Eliminate some random whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21637 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-30 04:44:07 +00:00
Chris Lattner
f76e7dc8d8 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21636 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-30 04:43:14 +00:00
Chris Lattner
ac766dca82 add sin/cos tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21635 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-30 04:41:27 +00:00
Chris Lattner
08cae7f519 Doesn't support these nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21634 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-30 04:26:56 +00:00
Chris Lattner
17234b7d78 This target doesn't support the FSIN/FCOS/FSQRT nodes yet
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21633 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-30 04:26:06 +00:00
Chris Lattner
c5dcb53bea Add support for FSIN/FCOS when unsafe math ops are enabled. Patch contributed by
Morten Ofstad!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21632 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-30 04:25:35 +00:00
Chris Lattner
5434b429c8 Add support for llvm.sqrt and sin/cos if unsafe math optimizations are enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21631 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-30 04:12:40 +00:00
Chris Lattner
34f74a6162 Expose an option allowing unsafe math optimizations. Patch contributed by
Morten Ofstad!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21630 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-30 04:09:52 +00:00
Chris Lattner
b42a9ffbe9 Lower llvm.sqrt -> fsqrt/sqrt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21629 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-30 04:07:50 +00:00
Chris Lattner
459ced2657 Add a test for llvm.sqrt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21628 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-30 04:07:15 +00:00
Chris Lattner
eed37bad01 Add llvm.sqrt intrinsic, patch contributed by Morten Ofstad
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21627 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-30 03:44:07 +00:00
Reid Spencer
9f56b1feeb * 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)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21626 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-30 03:17:54 +00:00
Reid Spencer
abffafd90f * Fix signed/unsigned usage problem
* Rearrange for readability.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21625 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-30 03:06:36 +00:00
Reid Spencer
b2ae078c9a A new test case for the ToAsciiOptimizer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21624 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-30 01:00:52 +00:00
Reid Spencer
926bd0cc45 A new test case for the StrCmpOptimization in -simplify-libcalls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21623 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-30 00:52:04 +00:00
Reid Spencer
e589cc4b76 This is StrCpy, NOT StrCat!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21622 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-29 23:02:15 +00:00
Reid Spencer
41571c8961 Get the name of the pass right in the documentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21621 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-29 23:01:21 +00:00
Reid Spencer
3f169a13b7 Fix the success criteria for the test to make call instructions with "pow"
not just any occurrence of "pow".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21620 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-29 10:11:23 +00:00
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