Skip to content
  1. Apr 28, 2011
  2. Apr 26, 2011
    • Chris Lattner's avatar
      Improve the bail-out predicate to really only kick in when phi · eb045f9c
      Chris Lattner authored
      translation fails.  We were bailing out in some cases that would
      cause us to miss GVN'ing some non-local cases away.
      
      llvm-svn: 130206
      eb045f9c
    • Chris Lattner's avatar
      Enhance MemDep: When alias analysis returns a partial alias result, · 6f83d06f
      Chris Lattner authored
      return it as a clobber.  This allows GVN to do smart things.
      
      Enhance GVN to be smart about the case when a small load is clobbered
      by a larger overlapping load.  In this case, forward the value.  This
      allows us to compile stuff like this:
      
      int test(void *P) {
        int tmp = *(unsigned int*)P;
        return tmp+*((unsigned char*)P+1);
      }
      
      into:
      
      _test:                                  ## @test
      	movl	(%rdi), %ecx
      	movzbl	%ch, %eax
      	addl	%ecx, %eax
      	ret
      
      which has one load.  We already handled the case where the smaller
      load was from a must-aliased base pointer.
      
      llvm-svn: 130180
      6f83d06f
  3. Mar 30, 2011
  4. Jan 24, 2011
    • Dan Gohman's avatar
      Give GetUnderlyingObject a TargetData, to keep it in sync · 0f124e19
      Dan Gohman authored
      with BasicAA's DecomposeGEPExpression, which recently began
      using a TargetData. This fixes PR8968, though the testcase
      is awkward to reduce.
      
      Also, update several off GetUnderlyingObject's users
      which happen to have a TargetData handy to pass it in.
      
      llvm-svn: 124134
      0f124e19
  5. Jan 11, 2011
  6. Jan 04, 2011
  7. Jan 03, 2011
  8. Jan 02, 2011
  9. Dec 22, 2010
  10. Dec 21, 2010
  11. Dec 19, 2010
  12. Dec 16, 2010
  13. Dec 15, 2010
  14. Nov 30, 2010
  15. Nov 19, 2010
  16. Nov 18, 2010
    • Owen Anderson's avatar
      Completely rework the datastructure GVN uses to represent the value number to... · c21c100f
      Owen Anderson authored
      Completely rework the datastructure GVN uses to represent the value number to leader mapping.  Previously,
      this was a tree of hashtables, and a query recursed into the table for the immediate dominator ad infinitum
      if the initial lookup failed.  This led to really bad performance on tall, narrow CFGs.
      
      We can instead replace it with what is conceptually a multimap of value numbers to leaders (actually
      represented by a hashtable with a list of Value*'s as the value type), and then
      determine which leader from that set to use very cheaply thanks to the DFS numberings maintained by
      DominatorTree.  Because there are typically few duplicates of a given value, this scan tends to be
      quite fast.  Additionally, we use a custom linked list and BumpPtr allocation to avoid any unnecessary
      allocation in representing the value-side of the multimap.
      
      This change brings with it a 15% (!) improvement in the total running time of GVN on 403.gcc, which I
      think is pretty good considering that includes all the "real work" being done by MemDep as well.
      
      The one downside to this approach is that we can no longer use GVN to perform simple conditional progation,
      but that seems like an acceptable loss since we now have LVI and CorrelatedValuePropagation to pick up
      the slack.  If you see conditional propagation that's not happening, please file bugs against LVI or CVP.
      
      llvm-svn: 119714
      c21c100f
  17. Nov 17, 2010
    • Duncan Sands's avatar
      Remove dead code in GVN: now that SimplifyInstruction is called · 72313843
      Duncan Sands authored
      systematically, CollapsePhi will always return null here.  Note
      that CollapsePhi did an extra check, isSafeReplacement, which
      the SimplifyInstruction logic does not do.  I think that check
      was bogus - I guess we will soon find out!  (It was originally
      added in commit 41998 without a testcase).
      
      llvm-svn: 119456
      72313843
  18. Nov 14, 2010
  19. Nov 12, 2010
    • Duncan Sands's avatar
      Have GVN simplify instructions as it goes. For example, consider · 246b71c5
      Duncan Sands authored
      "%z = %x and %y".  If GVN can prove that %y equals %x, then it turns
      this into "%z = %x and %x".  With the new code, %z will be replaced
      with %x everywhere (and then deleted).  Previously %z would be value
      numbered too, which is a waste of time.  Also, while a clever value
      numbering algorithm would give %z the same value number as %x, our
      current one doesn't do so (at least I don't think it does).  The new
      logic has an essentially equivalent effect to what you would get if
      %z was given the same value number as %x, i.e. it should make value
      numbering smarter.  While there, get hold of target data once at the
      start rather than a gazillion times all over the place.
      
      llvm-svn: 118923
      246b71c5
  20. Nov 11, 2010
Loading