summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
* * Add two strlen optimizations:Reid Spencer2005-05-071-23/+56
| | | | | | | | | | | | strlen(x) != 0 -> *x != 0 strlen(x) == 0 -> *x == 0 * Change nested statistics to use style of other LLVM statistics so that only the name of the optimization (simplify-libcalls) is used as the statistic name, and the description indicates which specific all is optimized. Cuts down on some redundancy and saves a few bytes of space. * Make note of stpcpy optimization that could be done. llvm-svn: 21766
* Don't increment the counter unless the debug flag is set.Reid Spencer2005-05-071-1/+1
| | | | llvm-svn: 21762
* Convert shifts to muls to assist reassociation. This implementsChris Lattner2005-05-071-2/+27
| | | | | | Reassociate/shifttest.ll llvm-svn: 21761
* Simplify the code and rearrange it. No major functionality changes here.Chris Lattner2005-05-071-62/+82
| | | | llvm-svn: 21759
* Silence VC++ warnings about unsafe mixing of ints and bools with the | operator.Jeff Cohen2005-05-071-2/+2
| | | | llvm-svn: 21758
* remove some dead (always dynamically false) flagsChris Lattner2005-05-062-36/+1
| | | | llvm-svn: 21752
* encode calling conventions for call/invoke instructions.Chris Lattner2005-05-062-14/+80
| | | | llvm-svn: 21751
* encode function calling convs in the bytecode file. invoke and call areChris Lattner2005-05-062-1/+16
| | | | | | still to come. llvm-svn: 21749
* parse new calling conv specifiersChris Lattner2005-05-062-43/+65
| | | | llvm-svn: 21748
* wrap a longlineChris Lattner2005-05-061-1/+2
| | | | llvm-svn: 21747
* add support for explicit calling conventionsChris Lattner2005-05-063-3/+44
| | | | llvm-svn: 21746
* use splice instead of remove/insert for a minor speedupChris Lattner2005-05-061-4/+6
| | | | llvm-svn: 21743
* remove some ugly hacks that are no longer needed since andrew removed theChris Lattner2005-05-061-14/+6
| | | | | | varargs munging code llvm-svn: 21742
* BAD typeo which caused many testsuite failures last night. Note to self, doChris Lattner2005-05-061-1/+1
| | | | | | not change code after testing it without retesting! llvm-svn: 21741
* clean up the CBE output a bitChris Lattner2005-05-061-13/+15
| | | | llvm-svn: 21740
* add tail marker as a commentChris Lattner2005-05-061-0/+1
| | | | llvm-svn: 21739
* Make the stub functions be tail callsChris Lattner2005-05-061-1/+2
| | | | llvm-svn: 21738
* Preserve tail markerChris Lattner2005-05-063-4/+7
| | | | llvm-svn: 21737
* Implement Transforms/Inline/inline-tail.llChris Lattner2005-05-061-1/+16
| | | | llvm-svn: 21736
* preserve the tail markerChris Lattner2005-05-063-0/+6
| | | | llvm-svn: 21734
* lex tailChris Lattner2005-05-061-0/+1
| | | | llvm-svn: 21729
* add bytecode reader support for tail callsChris Lattner2005-05-062-1/+6
| | | | llvm-svn: 21727
* Add a 'tail' marker for call instructions, patch contributed byChris Lattner2005-05-064-6/+29
| | | | | | Alexander Friedman. llvm-svn: 21722
* Wrap long linesChris Lattner2005-05-061-6/+10
| | | | llvm-svn: 21720
* DCE intrinsic instructions without side effects.Chris Lattner2005-05-061-1/+20
| | | | llvm-svn: 21719
* These intrinsics do not access memoryChris Lattner2005-05-061-1/+1
| | | | llvm-svn: 21718
* Teach instcombine propagate zeroness through shl instructions, implementingChris Lattner2005-05-061-8/+4
| | | | | | and.ll:test31 llvm-svn: 21717
* Implement shift.ll:test23. If we are shifting right then immediately truncatingChris Lattner2005-05-061-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the result, turn signed shift rights into unsigned shift rights if possible. This leads to later simplification and happens *often* in 176.gcc. For example, this testcase: struct xxx { unsigned int code : 8; }; enum codes { A, B, C, D, E, F }; int foo(struct xxx *P) { if ((enum codes)P->code == A) bar(); } used to be compiled to: int %foo(%struct.xxx* %P) { %tmp.1 = getelementptr %struct.xxx* %P, int 0, uint 0 ; <uint*> [#uses=1] %tmp.2 = load uint* %tmp.1 ; <uint> [#uses=1] %tmp.3 = cast uint %tmp.2 to int ; <int> [#uses=1] %tmp.4 = shl int %tmp.3, ubyte 24 ; <int> [#uses=1] %tmp.5 = shr int %tmp.4, ubyte 24 ; <int> [#uses=1] %tmp.6 = cast int %tmp.5 to sbyte ; <sbyte> [#uses=1] %tmp.8 = seteq sbyte %tmp.6, 0 ; <bool> [#uses=1] br bool %tmp.8, label %then, label %UnifiedReturnBlock Now it is compiled to: %tmp.1 = getelementptr %struct.xxx* %P, int 0, uint 0 ; <uint*> [#uses=1] %tmp.2 = load uint* %tmp.1 ; <uint> [#uses=1] %tmp.2 = cast uint %tmp.2 to sbyte ; <sbyte> [#uses=1] %tmp.8 = seteq sbyte %tmp.2, 0 ; <bool> [#uses=1] br bool %tmp.8, label %then, label %UnifiedReturnBlock which is the difference between this: foo: subl $4, %esp movl 8(%esp), %eax movl (%eax), %eax shll $24, %eax sarl $24, %eax testb %al, %al jne .LBBfoo_2 and this: foo: subl $4, %esp movl 8(%esp), %eax movl (%eax), %eax testb %al, %al jne .LBBfoo_2 This occurs 3243 times total in the External tests, 215x in povray, 6x in each f2c'd program, 1451x in 176.gcc, 7x in crafty, 20x in perl, 25x in gap, 3x in m88ksim, 25x in ijpeg. Maybe this will cause a little jump on gcc tommorow :) llvm-svn: 21715
* Implement xor.ll:test22Chris Lattner2005-05-061-0/+9
| | | | llvm-svn: 21713
* implement and.ll:test30 and set.ll:test21Chris Lattner2005-05-061-18/+60
| | | | llvm-svn: 21712
* implement or.ll:test20Chris Lattner2005-05-061-0/+7
| | | | llvm-svn: 21709
* * Order #includes alphabeticallyMisha Brukman2005-05-051-4/+1
| | | | | | * Remove commented-out debug printouts llvm-svn: 21707
* Remove extra blank lineMisha Brukman2005-05-051-1/+0
| | | | llvm-svn: 21706
* Remove vim settings from source code; people should use llvm/utils/vim/vimrcMisha Brukman2005-05-0529-29/+0
| | | | llvm-svn: 21704
* add support for undef values of opaque type, addressing PR541Chris Lattner2005-05-052-12/+13
| | | | llvm-svn: 21701
* Add some extra checks. Opaque types don't have a null marker.Chris Lattner2005-05-051-4/+10
| | | | llvm-svn: 21700
* When hitting an unsupported intrinsic, actually print itChris Lattner2005-05-051-0/+10
| | | | | | Lower debug info to noops. llvm-svn: 21698
* ctpop lowering in legalizeAndrew Lenharth2005-05-051-1/+33
| | | | llvm-svn: 21697
* Fix a bug compimling Ruby, fixing this testcase:Chris Lattner2005-05-051-3/+11
| | | | | | LowerSetJmp/2005-05-05-OldUses.ll llvm-svn: 21696
* fix typoAndrew Lenharth2005-05-045-4/+9
| | | | llvm-svn: 21693
* Well, add support for ct* for 21264 only.Andrew Lenharth2005-05-042-5/+11
| | | | | | 21164 is broken until expand works. llvm-svn: 21692
* Make promoteOp work for CT*Andrew Lenharth2005-05-041-0/+28
| | | | | | | | | | | | | | | | | | | | Proof? ubyte %bar(ubyte %x) { entry: %tmp.1 = call ubyte %llvm.ctlz( ubyte %x ) ret ubyte %tmp.1 } ==> zapnot $16,1,$0 CTLZ $0,$0 subq $0,56,$0 zapnot $0,1,$0 ret $31,($26),1 llvm-svn: 21691
* Instcombine: cast (X != 0) to int, cast (X == 1) to int -> X iff X has only ↵Chris Lattner2005-05-041-3/+25
| | | | | | | | | | | | | | | | | | | | | | the low bit set. This implements set.ll:test20. This triggers 2x on povray, 9x on mesa, 11x on gcc, 2x on crafty, 1x on eon, 6x on perlbmk and 11x on m88ksim. It allows us to compile these two functions into the same code: struct s { unsigned int bit : 1; }; unsigned foo(struct s *p) { if (p->bit) return 1; else return 0; } unsigned bar(struct s *p) { return p->bit; } llvm-svn: 21690
* Implement the IsDigitOptimization for simplifying calls to the isdigitReid Spencer2005-05-041-6/+54
| | | | | | | | | | | | | library function: isdigit(chr) -> 0 or 1 if chr is constant isdigit(chr) -> chr - '0' <= 9 otherwise Although there are many calls to isdigit in llvm-test, most of them are compiled away by macros leaving only this: 2 MultiSource/Applications/hexxagon llvm-svn: 21688
* * Correct the function prototypes for some of the functions to match theReid Spencer2005-05-041-9/+172
| | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 21679
* Implement count leading zeros (ctlz), count trailing zeros (cttz), and countAndrew Lenharth2005-05-0311-9/+308
| | | | | | | | | population (ctpop). Generic lowering is implemented, however only promotion is implemented for SelectionDAG at the moment. More coming soon. llvm-svn: 21676
* fix a bug in the 1 index GEP handling codeChris Lattner2005-05-031-1/+1
| | | | llvm-svn: 21670
* Implement optimizations for the strchr and llvm.memset library calls.Reid Spencer2005-05-031-21/+232
| | | | | | | | | | | | | | | 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 llvm-svn: 21669
* add direct support for making GEP instrs with one indexChris Lattner2005-05-031-0/+31
| | | | llvm-svn: 21665
* Use ANSI-approved way of getting the value infinity (otherwise VC++ won't ↵Jeff Cohen2005-05-031-3/+4
| | | | | | compile it) llvm-svn: 21662
OpenPOWER on IntegriCloud