Skip to content
  1. May 08, 2005
  2. May 07, 2005
  3. May 06, 2005
  4. May 05, 2005
  5. May 04, 2005
    • Chris Lattner's avatar
      Instcombine: cast (X != 0) to int, cast (X == 1) to int -> X iff X has only the low bit set. · 809dfac4
      Chris Lattner authored
      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
      809dfac4
    • Reid Spencer's avatar
      Implement the IsDigitOptimization for simplifying calls to the isdigit · 282d0574
      Reid Spencer authored
      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
      282d0574
    • Reid Spencer's avatar
      * Correct the function prototypes for some of the functions to match the · 1e520fd6
      Reid Spencer authored
        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
      1e520fd6
  6. May 03, 2005
  7. May 02, 2005
  8. May 01, 2005
  9. Apr 30, 2005
    • Reid Spencer's avatar
      Fix a comment that stated the wrong thing. · 16449a9e
      Reid Spencer authored
      llvm-svn: 21638
      16449a9e
    • Reid Spencer's avatar
      * Don't depend on "guessing" what a FILE* is, just require that the actual · 4c444fe0
      Reid Spencer authored
        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)
      
      llvm-svn: 21626
      4c444fe0
  10. Apr 29, 2005
  11. Apr 28, 2005
  12. Apr 27, 2005
    • Reid Spencer's avatar
      Doxygenate. · 7ddcfb33
      Reid Spencer authored
      llvm-svn: 21602
      7ddcfb33
    • Chris Lattner's avatar
      remove 'statement with no effect' warning · 36ffb1ff
      Chris Lattner authored
      llvm-svn: 21600
      36ffb1ff
    • Reid Spencer's avatar
      More Cleanup: · 08b49405
      Reid Spencer authored
      * Name the instructions by appending to name of original
      * Factor common part out of a switch statement.
      
      llvm-svn: 21597
      08b49405
    • Reid Spencer's avatar
      This is a cleanup commit: · e249a82e
      Reid Spencer authored
      * 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.
      
      llvm-svn: 21589
      e249a82e
Loading