| Commit message (Collapse) | Author | Age | Files | Lines | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
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
 | 
| | 
| 
| 
|  | 
llvm-svn: 21762
 | 
| | 
| 
| 
| 
| 
|  | 
Reassociate/shifttest.ll
llvm-svn: 21761
 | 
| | 
| 
| 
|  | 
llvm-svn: 21759
 | 
| | 
| 
| 
|  | 
llvm-svn: 21758
 | 
| | 
| 
| 
|  | 
llvm-svn: 21752
 | 
| | 
| 
| 
|  | 
llvm-svn: 21751
 | 
| | 
| 
| 
| 
| 
|  | 
still to come.
llvm-svn: 21749
 | 
| | 
| 
| 
|  | 
llvm-svn: 21748
 | 
| | 
| 
| 
|  | 
llvm-svn: 21747
 | 
| | 
| 
| 
|  | 
llvm-svn: 21746
 | 
| | 
| 
| 
|  | 
llvm-svn: 21743
 | 
| | 
| 
| 
| 
| 
|  | 
varargs munging code
llvm-svn: 21742
 | 
| | 
| 
| 
| 
| 
|  | 
not change code after testing it without retesting!
llvm-svn: 21741
 | 
| | 
| 
| 
|  | 
llvm-svn: 21740
 | 
| | 
| 
| 
|  | 
llvm-svn: 21739
 | 
| | 
| 
| 
|  | 
llvm-svn: 21738
 | 
| | 
| 
| 
|  | 
llvm-svn: 21737
 | 
| | 
| 
| 
|  | 
llvm-svn: 21736
 | 
| | 
| 
| 
|  | 
llvm-svn: 21734
 | 
| | 
| 
| 
|  | 
llvm-svn: 21729
 | 
| | 
| 
| 
|  | 
llvm-svn: 21727
 | 
| | 
| 
| 
| 
| 
|  | 
Alexander Friedman.
llvm-svn: 21722
 | 
| | 
| 
| 
|  | 
llvm-svn: 21720
 | 
| | 
| 
| 
|  | 
llvm-svn: 21719
 | 
| | 
| 
| 
|  | 
llvm-svn: 21718
 | 
| | 
| 
| 
| 
| 
|  | 
and.ll:test31
llvm-svn: 21717
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
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
 | 
| | 
| 
| 
|  | 
llvm-svn: 21713
 | 
| | 
| 
| 
|  | 
llvm-svn: 21712
 | 
| | 
| 
| 
|  | 
llvm-svn: 21709
 | 
| | 
| 
| 
| 
| 
|  | 
* Remove commented-out debug printouts
llvm-svn: 21707
 | 
| | 
| 
| 
|  | 
llvm-svn: 21706
 | 
| | 
| 
| 
|  | 
llvm-svn: 21704
 | 
| | 
| 
| 
|  | 
llvm-svn: 21701
 | 
| | 
| 
| 
|  | 
llvm-svn: 21700
 | 
| | 
| 
| 
| 
| 
|  | 
Lower debug info to noops.
llvm-svn: 21698
 | 
| | 
| 
| 
|  | 
llvm-svn: 21697
 | 
| | 
| 
| 
| 
| 
|  | 
LowerSetJmp/2005-05-05-OldUses.ll
llvm-svn: 21696
 | 
| | 
| 
| 
|  | 
llvm-svn: 21693
 | 
| | 
| 
| 
| 
| 
|  | 
21164 is broken until expand works.
llvm-svn: 21692
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
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
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
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
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
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
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
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
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
|  | 
population (ctpop).  Generic lowering is implemented, however only promotion
is implemented for SelectionDAG at the moment.
More coming soon.
llvm-svn: 21676
 | 
| | 
| 
| 
|  | 
llvm-svn: 21670
 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|  | 
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
 | 
| | 
| 
| 
|  | 
llvm-svn: 21665
 | 
| | 
| 
| 
| 
| 
|  | 
compile it)
llvm-svn: 21662
 |