Skip to content
  1. Apr 30, 2005
    • Chris Lattner's avatar
      Add llvm.sqrt intrinsic, patch contributed by Morten Ofstad · 1c636f11
      Chris Lattner authored
      llvm-svn: 21627
      1c636f11
    • 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
  2. Apr 29, 2005
  3. Apr 28, 2005
  4. Apr 27, 2005
  5. Apr 26, 2005
    • Chris Lattner's avatar
      don't let Reid build void*'s :) · 41d183ed
      Chris Lattner authored
      llvm-svn: 21571
      41d183ed
    • Reid Spencer's avatar
      Fix some bugs found by running on llvm-test: · 4855ebf6
      Reid Spencer authored
      * MemCpyOptimization can only be optimized if the 3rd and 4th arguments are
        constants and we weren't checking for that.
      * The result of llvm.memcpy (and llvm.memmove) is void* not sbyte*, put in
        a cast.
      
      llvm-svn: 21570
      4855ebf6
    • Reid Spencer's avatar
      Changes From Review Feedback: · bb92b4fd
      Reid Spencer authored
      * Have the SimplifyLibCalls pass acquire the TargetData and pass it down to
        the optimization classes so they can use it to make better choices for
        the signatures of functions, etc.
      * Rearrange the code a little so the utility functions are closer to their
        usage and keep the core of the pass near the top of the files.
      * Adjust the StrLen pass to get/use the correct prototype depending on the
        TargetData::getIntPtrType() result. The result of strlen is size_t which
        could be either uint or ulong depending on the platform.
      * Clean up some coding nits (cast vs. dyn_cast, remove redundant items from
        a switch, etc.)
      * Implement the MemMoveOptimization as a twin of MemCpyOptimization (they
        only differ in name).
      
      llvm-svn: 21569
      bb92b4fd
    • Chris Lattner's avatar
      Make interval partition print correctly, patch contributed by · eb2a461a
      Chris Lattner authored
      Vladimir Prus!
      
      llvm-svn: 21566
      eb2a461a
    • Chris Lattner's avatar
      Fix the compile failures from last night. · bd43b9db
      Chris Lattner authored
      llvm-svn: 21565
      bd43b9db
    • Duraid Madina's avatar
      constmul bugfix: multiply by 27611 was broken · e06ef802
      Duraid Madina authored
      llvm-svn: 21564
      e06ef802
    • Duraid Madina's avatar
      clean up the code! (oops) lots more cleaning left, however. · bbd0cd71
      Duraid Madina authored
      llvm-svn: 21563
      bbd0cd71
    • Reid Spencer's avatar
      * Merge get_GVInitializer and getCharArrayLength into a single function · b4f7b83d
      Reid Spencer authored
        named getConstantStringLength. This is the common part of StrCpy and
        StrLen optimizations and probably several others, yet to be written. It
        performs all the validity checks for looking at constant arrays that are
        supposed to be null-terminated strings and then computes the actual
        length of the string.
      * Implement the MemCpyOptimization class. This just turns memcpy of 1, 2, 4
        and 8 byte data blocks that are properly aligned on those boundaries into
        a load and a store. Much more could be done here but alignment
        restrictions and lack of knowledge of the target instruction set prevent
        use from doing significantly more. That will have to be delegated to the
        code generators as they lower llvm.memcpy calls.
      
      llvm-svn: 21562
      b4f7b83d
    • Duraid Madina's avatar
      * Add code to reduce multiplies by constant integers to shifts, adds and · 81ebb577
      Duraid Madina authored
        subtracts. This is a very rough and nasty implementation of Lefevre's
        "pattern finding" algorithm. With a few small changes though, it should
        end up beating most other methods in common use, regardless of the size
        of the constant (currently, it's often one or two shifts worse)
      
        TODO: rewrite it so it's not hideously ugly (this is a translation from
              perl, which doesn't help ;)
              bypass most of it for multiplies by 2^n+1
      	(eventually) teach it that some combinations of shift+add are
      	cheaper than others (e.g. shladd on ia64, scaled adds on alpha)
      	get it to try multiple booth encodings in search of the cheapest
      	routine
      	make it work for negative constants
      
        This is hacked up as a DAG->DAG transform, so once I clean it up I hope
        it'll be pulled out of here and put somewhere else. The only thing backends
        should really have to worry about for now is where to draw the line
        between using this code vs. going ahead and doing an integer multiply
        anyway.
      
      llvm-svn: 21560
      81ebb577
    • Reid Spencer's avatar
      * Implement StrLenOptimization · 76dab9a5
      Reid Spencer authored
      * Factor out commonalities between StrLenOptimization and StrCatOptimization
      * Make sure that signatures return sbyte* not void*
      
      llvm-svn: 21559
      76dab9a5
Loading