Reid Spencer [Wed, 4 May 2005 17:45:10 +0000 (17:45 +0000)]
Make sure both optimization cases get tested.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21687
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Wed, 4 May 2005 17:34:55 +0000 (17:34 +0000)]
Add a test case for the IsDigitOptimization class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21686
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Wed, 4 May 2005 15:56:34 +0000 (15:56 +0000)]
comment fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21685
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Wed, 4 May 2005 15:51:07 +0000 (15:51 +0000)]
see if the legalize code propery compensates for the additional zeros introduced
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21684
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Wed, 4 May 2005 15:43:40 +0000 (15:43 +0000)]
Correct the descriptions of WHILE...END and RROT. Thanks to Lalo Martins
for pointing out these errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21683
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Wed, 4 May 2005 15:33:48 +0000 (15:33 +0000)]
WHILE does not "pop" a value, it "examines" to top of stack. Make this
clear in the applicable comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21682
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Wed, 4 May 2005 15:20:16 +0000 (15:20 +0000)]
added a use of ctpop to debug stuff with
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21681
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Wed, 4 May 2005 14:58:31 +0000 (14:58 +0000)]
fixup argument
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21680
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Wed, 4 May 2005 03:20:21 +0000 (03:20 +0000)]
* Correct the function prototypes for some of the functions to match the
actual spec (int -> uint)
* Add the ability to get/cache the strlen function prototype.
* Make sure generated values are appropriately named for debugging purposes
* Add the SPrintFOptimiation for 4 casts of sprintf optimization:
sprintf(str,cstr) -> llvm.memcpy(str,cstr) (if cstr has no %)
sprintf(str,"") -> store sbyte 0, str
sprintf(str,"%s",src) -> llvm.memcpy(str,src) (if src is constant)
sprintf(str,"%c",chr) -> store chr, str ; store sbyte 0, str+1
The sprintf optimization didn't fire as much as I had hoped:
2 MultiSource/Applications/SPASS
5 MultiSource/Benchmarks/McCat/18-imp
22 MultiSource/Benchmarks/Prolangs-C/TimberWolfMC
1 MultiSource/Benchmarks/Prolangs-C/assembler
6 MultiSource/Benchmarks/Prolangs-C/unix-smail
2 MultiSource/Benchmarks/mediabench/mpeg2/mpeg2dec
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21679
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Tue, 3 May 2005 20:30:34 +0000 (20:30 +0000)]
Minor clean-ups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21678
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Tue, 3 May 2005 18:01:48 +0000 (18:01 +0000)]
initial descriptions of count intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21677
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Tue, 3 May 2005 17:19:30 +0000 (17:19 +0000)]
Implement count leading zeros (ctlz), count trailing zeros (cttz), and count
population (ctpop). Generic lowering is implemented, however only promotion
is implemented for SelectionDAG at the moment.
More coming soon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21676
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Tue, 3 May 2005 17:09:38 +0000 (17:09 +0000)]
Fix this test to succeed even if "strchr" is on a call instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21675
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Tue, 3 May 2005 17:08:45 +0000 (17:08 +0000)]
Add a test case for SPrintFOptimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21674
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Tue, 3 May 2005 17:00:48 +0000 (17:00 +0000)]
yea yea yea
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21673
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Tue, 3 May 2005 16:59:09 +0000 (16:59 +0000)]
note the vararg change, and other stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21672
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Tue, 3 May 2005 16:49:48 +0000 (16:49 +0000)]
pre add count tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21671
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 3 May 2005 16:44:45 +0000 (16:44 +0000)]
fix a bug in the 1 index GEP handling code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21670
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Tue, 3 May 2005 07:23:44 +0000 (07:23 +0000)]
Implement optimizations for the strchr and llvm.memset library calls.
Neither of these activated as many times as was hoped:
strchr:
9 MultiSource/Applications/siod
1 MultiSource/Applications/d
2 MultiSource/Prolangs-C/archie-client
1 External/SPEC/CINT2000/176.gcc/176.gcc
llvm.memset:
no hits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21669
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Tue, 3 May 2005 06:22:41 +0000 (06:22 +0000)]
Add a test case for StrChrOptimizer for -simplify-libcalls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21668
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Tue, 3 May 2005 06:13:18 +0000 (06:13 +0000)]
Clean up and correct llvmc configurations for C and C++
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21667
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Tue, 3 May 2005 06:10:51 +0000 (06:10 +0000)]
std::string(NULL) does not a proper constructor make
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21666
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 3 May 2005 05:43:30 +0000 (05:43 +0000)]
add direct support for making GEP instrs with one index
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21665
91177308-0d34-0410-b5e6-
96231b3b80d8
Misha Brukman [Tue, 3 May 2005 05:36:14 +0000 (05:36 +0000)]
Omit periods at the end of command-line switch explanations for consistency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21664
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Tue, 3 May 2005 04:00:24 +0000 (04:00 +0000)]
A new test case for the LLVMMemSetOptimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21663
91177308-0d34-0410-b5e6-
96231b3b80d8
Jeff Cohen [Tue, 3 May 2005 03:13:01 +0000 (03:13 +0000)]
Use ANSI-approved way of getting the value infinity (otherwise VC++ won't compile it)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21662
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Tue, 3 May 2005 02:54:54 +0000 (02:54 +0000)]
Avoid garbage output in the statistics display by ensuring that the
strings passed to Statistic's constructor are not destructable. The stats
are printed during static destruction and the SimplifyLibCalls module was
getting destructed before the statistics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21661
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Tue, 3 May 2005 01:43:45 +0000 (01:43 +0000)]
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
Reid Spencer [Tue, 3 May 2005 00:52:19 +0000 (00:52 +0000)]
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
Reid Spencer [Tue, 3 May 2005 00:50:43 +0000 (00:50 +0000)]
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
Reid Spencer [Mon, 2 May 2005 23:59:26 +0000 (23:59 +0000)]
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
Reid Spencer [Mon, 2 May 2005 23:07:14 +0000 (23:07 +0000)]
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
Andrew Lenharth [Mon, 2 May 2005 21:25:47 +0000 (21:25 +0000)]
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
Andrew Lenharth [Mon, 2 May 2005 19:07:27 +0000 (19:07 +0000)]
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
John Criswell [Mon, 2 May 2005 14:47:42 +0000 (14:47 +0000)]
Fixed a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21653
91177308-0d34-0410-b5e6-
96231b3b80d8
Duraid Madina [Mon, 2 May 2005 07:27:14 +0000 (07:27 +0000)]
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
Duraid Madina [Mon, 2 May 2005 06:41:13 +0000 (06:41 +0000)]
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
Reid Spencer [Sun, 1 May 2005 22:22:57 +0000 (22:22 +0000)]
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
Tanya Lattner [Sun, 1 May 2005 16:22:41 +0000 (16:22 +0000)]
Add accessor method,
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21649
91177308-0d34-0410-b5e6-
96231b3b80d8
Tanya Lattner [Sun, 1 May 2005 16:14:34 +0000 (16:14 +0000)]
Adding ModuloSched SB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21648
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 1 May 2005 04:42:15 +0000 (04:42 +0000)]
Implement getelementptr.ll:test11
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21647
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 1 May 2005 04:41:57 +0000 (04:41 +0000)]
new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21646
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 1 May 2005 04:24:53 +0000 (04:24 +0000)]
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
Chris Lattner [Sun, 1 May 2005 04:24:15 +0000 (04:24 +0000)]
add a new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21644
91177308-0d34-0410-b5e6-
96231b3b80d8
Tanya Lattner [Sun, 1 May 2005 01:27:47 +0000 (01:27 +0000)]
SMS for superblocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21643
91177308-0d34-0410-b5e6-
96231b3b80d8
Tanya Lattner [Sun, 1 May 2005 01:25:53 +0000 (01:25 +0000)]
Added extra constructor for superblocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21642
91177308-0d34-0410-b5e6-
96231b3b80d8
Tanya Lattner [Sat, 30 Apr 2005 23:07:59 +0000 (23:07 +0000)]
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
Andrew Lenharth [Sat, 30 Apr 2005 14:19:13 +0000 (14:19 +0000)]
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
Alkis Evlogimenos [Sat, 30 Apr 2005 07:13:31 +0000 (07:13 +0000)]
Do not use deprecated APIs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21639
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Sat, 30 Apr 2005 06:45:47 +0000 (06:45 +0000)]
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
Chris Lattner [Sat, 30 Apr 2005 04:44:07 +0000 (04:44 +0000)]
Eliminate some random whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21637
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 30 Apr 2005 04:43:14 +0000 (04:43 +0000)]
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
Chris Lattner [Sat, 30 Apr 2005 04:41:27 +0000 (04:41 +0000)]
add sin/cos tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21635
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 30 Apr 2005 04:26:56 +0000 (04:26 +0000)]
Doesn't support these nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21634
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 30 Apr 2005 04:26:06 +0000 (04:26 +0000)]
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
Chris Lattner [Sat, 30 Apr 2005 04:25:35 +0000 (04:25 +0000)]
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
Chris Lattner [Sat, 30 Apr 2005 04:12:40 +0000 (04:12 +0000)]
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
Chris Lattner [Sat, 30 Apr 2005 04:09:52 +0000 (04:09 +0000)]
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
Chris Lattner [Sat, 30 Apr 2005 04:07:50 +0000 (04:07 +0000)]
Lower llvm.sqrt -> fsqrt/sqrt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21629
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 30 Apr 2005 04:07:15 +0000 (04:07 +0000)]
Add a test for llvm.sqrt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21628
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 30 Apr 2005 03:44:07 +0000 (03:44 +0000)]
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
Reid Spencer [Sat, 30 Apr 2005 03:17:54 +0000 (03:17 +0000)]
* 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
Reid Spencer [Sat, 30 Apr 2005 03:06:36 +0000 (03:06 +0000)]
* 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
Reid Spencer [Sat, 30 Apr 2005 01:00:52 +0000 (01:00 +0000)]
A new test case for the ToAsciiOptimizer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21624
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Sat, 30 Apr 2005 00:52:04 +0000 (00:52 +0000)]
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
Reid Spencer [Fri, 29 Apr 2005 23:02:15 +0000 (23:02 +0000)]
This is StrCpy, NOT StrCat!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21622
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Fri, 29 Apr 2005 23:01:21 +0000 (23:01 +0000)]
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
Reid Spencer [Fri, 29 Apr 2005 10:11:23 +0000 (10:11 +0000)]
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
Reid Spencer [Fri, 29 Apr 2005 10:10:17 +0000 (10:10 +0000)]
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
Reid Spencer [Fri, 29 Apr 2005 09:39:47 +0000 (09:39 +0000)]
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
Reid Spencer [Fri, 29 Apr 2005 07:19:00 +0000 (07:19 +0000)]
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
Reid Spencer [Fri, 29 Apr 2005 06:01:28 +0000 (06:01 +0000)]
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
Reid Spencer [Fri, 29 Apr 2005 05:55:35 +0000 (05:55 +0000)]
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
Reid Spencer [Fri, 29 Apr 2005 05:47:05 +0000 (05:47 +0000)]
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
Jeff Cohen [Fri, 29 Apr 2005 03:05:44 +0000 (03:05 +0000)]
Consistently use 'class' to silence VC++
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21612
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Thu, 28 Apr 2005 23:01:59 +0000 (23:01 +0000)]
* 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
Chris Lattner [Thu, 28 Apr 2005 22:07:18 +0000 (22:07 +0000)]
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
Chris Lattner [Thu, 28 Apr 2005 21:52:31 +0000 (21:52 +0000)]
These functions can set errno!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21609
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 28 Apr 2005 21:50:05 +0000 (21:50 +0000)]
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
Chris Lattner [Thu, 28 Apr 2005 21:48:42 +0000 (21:48 +0000)]
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
Chris Lattner [Thu, 28 Apr 2005 21:44:33 +0000 (21:44 +0000)]
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
Chris Lattner [Thu, 28 Apr 2005 21:44:03 +0000 (21:44 +0000)]
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
Reid Spencer [Thu, 28 Apr 2005 18:05:16 +0000 (18:05 +0000)]
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
Reid Spencer [Thu, 28 Apr 2005 04:40:06 +0000 (04:40 +0000)]
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
Reid Spencer [Wed, 27 Apr 2005 21:29:20 +0000 (21:29 +0000)]
Doxygenate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21602
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 27 Apr 2005 20:12:17 +0000 (20:12 +0000)]
remove 'statement with no effect' warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21600
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Wed, 27 Apr 2005 20:10:01 +0000 (20:10 +0000)]
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
Chris Lattner [Wed, 27 Apr 2005 18:57:15 +0000 (18:57 +0000)]
Unbreak the sparc backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21598
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Wed, 27 Apr 2005 17:46:54 +0000 (17:46 +0000)]
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
Andrew Lenharth [Wed, 27 Apr 2005 17:32:41 +0000 (17:32 +0000)]
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
Andrew Lenharth [Wed, 27 Apr 2005 16:41:50 +0000 (16:41 +0000)]
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
Andrew Lenharth [Wed, 27 Apr 2005 16:03:01 +0000 (16:03 +0000)]
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
Andrew Lenharth [Wed, 27 Apr 2005 14:57:26 +0000 (14:57 +0000)]
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
Duraid Madina [Wed, 27 Apr 2005 11:57:39 +0000 (11:57 +0000)]
clean up some warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21590
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Wed, 27 Apr 2005 07:54:40 +0000 (07:54 +0000)]
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
Chris Lattner [Wed, 27 Apr 2005 04:52:23 +0000 (04:52 +0000)]
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
Chris Lattner [Wed, 27 Apr 2005 04:51:01 +0000 (04:51 +0000)]
Test the noreturn function optimization
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21586
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Spencer [Wed, 27 Apr 2005 02:22:47 +0000 (02:22 +0000)]
Add the simplify-libcalls pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21585
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Wed, 27 Apr 2005 02:13:20 +0000 (02:13 +0000)]
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
Reid Spencer [Wed, 27 Apr 2005 00:20:23 +0000 (00:20 +0000)]
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