Skip to content
  1. Dec 15, 2008
    • Chris Lattner's avatar
      make GVN try to rename inputs to the resultant replaced values, which · 69131fd8
      Chris Lattner authored
      cleans up the generated code a bit.  This should have the added benefit of
      not randomly renaming functions/globals like my previous patch did. :)
      
      llvm-svn: 61023
      69131fd8
    • Chris Lattner's avatar
      Implement initial support for PHI translation in memdep. This means that · ff9f3dba
      Chris Lattner authored
      memdep keeps track of how PHIs affect the pointer in dep queries, which 
      allows it to eliminate the load in cases like rle-phi-translate.ll, which
      basically end up being:
      
      BB1:
         X = load P
         br BB3
      BB2:
         Y = load Q
         br BB3
      BB3:
         R = phi [P] [Q]
         load R
      
      turning "load R" into a phi of X/Y.  In addition to additional exposed
      opportunities, this makes memdep safe in many cases that it wasn't before
      (which is required for load PRE) and also makes it substantially more 
      efficient.  For example, consider:
      
      
      bb1:  // has many predecessors.
         P = some_operator()
         load P
      
      In this example, previously memdep would scan all the predecessors of BB1
      to see if they had something that would mustalias P.  In some cases (e.g.
      test/Transforms/GVN/rle-must-alias.ll) it would actually find them and end
      up eliminating something.  In many other cases though, it would scan and not
      find anything useful.  MemDep now stops at a block if the pointer is defined
      in that block and cannot be phi translated to predecessors.  This causes it
      to miss the (rare) cases like rle-must-alias.ll, but makes it faster by not
      scanning tons of stuff that is unlikely to be useful.  For example, this
      speeds up GVN as a whole from 3.928s to 2.448s (60%)!.  IMO, scalar GVN 
      should be enhanced to simplify the rle-must-alias pointer base anyway, which
      would allow the loads to be eliminated.
      
      In the future, this should be enhanced to phi translate through geps and 
      bitcasts as well (as indicated by FIXMEs) making memdep even more powerful.
      
      llvm-svn: 61022
      ff9f3dba
    • Owen Anderson's avatar
      Add support for slow-path GVN with full phi construction for scalars. This is... · bfe133e4
      Owen Anderson authored
      Add support for slow-path GVN with full phi construction for scalars.  This is disabled for now, as it actually pessimizes code in the abscence
      of phi translation for load elimination.  This slow down GVN a bit, by about 2% on 403.gcc.
      
      llvm-svn: 61021
      bfe133e4
    • Nick Lewycky's avatar
      Fix whitespace in comment. · e88d388f
      Nick Lewycky authored
      Remove TODO; icmp isn't a binary operator, so this function will never deal
      with them.
      
      llvm-svn: 61020
      e88d388f
    • Nick Lewycky's avatar
      Introducing nocapture, a parameter attribute for pointers to indicate that the · ddffe620
      Nick Lewycky authored
      callee will not introduce any new aliases of that pointer.
      
      The attributes had all bits allocated already, so I decided to collapse
      alignment. Alignment was previously stored as a 16-bit integer from bits 16 to
      32 of the attribute, but it was required to be a power of 2. Now it's stored in
      log2 encoded form in five bits from 16 to 21. That gives us 11 more bits of
      space.
      
      You may have already noticed that you only need four bits to encode a 16-bit
      power of two, so why five bits? Because the AsmParser accepted 32-bit
      alignments, even though we couldn't store them (they were silently discarded).
      Now we can store them in memory, but not in the bitcode.
      
      The bitcode format was already storing these as 64-bit VBR integers. So, the
      bitcode format stays the same, keeping the alignment values stored as 16 bit
      raw values. There's some hideous code in the reader and writer that deals with
      this, waiting to be ripped out the moment we run out of bits again and have to
      replace the parameter attributes table encoding.
      
      llvm-svn: 61019
      ddffe620
  2. Dec 14, 2008
  3. Dec 13, 2008
Loading