Skip to content
  1. Apr 16, 2009
    • Dan Gohman's avatar
      LSR is no longer a GEP optimizer. It is now an IV expression · e2ead2c3
      Dan Gohman authored
      optimizer, which just happen to frequently involve optimizing GEPs.
      
      llvm-svn: 69295
      e2ead2c3
    • Dan Gohman's avatar
      Use ConstantExpr::getIntToPtr instead of SCEVExpander::InsertCastOfTo, · a8be04b2
      Dan Gohman authored
      since the operand is always a constant.
      
      llvm-svn: 69291
      a8be04b2
    • Dan Gohman's avatar
      Use a SCEV expression cast instead of immediately inserting a · 71bccd3e
      Dan Gohman authored
      new instruction with SCEVExpander::InsertCastOfTo.
      
      llvm-svn: 69290
      71bccd3e
    • Dan Gohman's avatar
      Expand GEPs in ScalarEvolution expressions. SCEV expressions can now · 0a40ad93
      Dan Gohman authored
      have pointer types, though in contrast to C pointer types, SCEV
      addition is never implicitly scaled. This not only eliminates the
      need for special code like IndVars' EliminatePointerRecurrence
      and LSR's own GEP expansion code, it also does a better job because
      it lets the normal optimizations handle pointer expressions just
      like integer expressions.
      
      Also, since LLVM IR GEPs can't directly index into multi-dimensional
      VLAs, moving the GEP analysis out of client code and into the SCEV
      framework makes it easier for clients to handle multi-dimensional
      VLAs the same way as other arrays.
      
      Some existing regression tests show improved optimization.
      test/CodeGen/ARM/2007-03-13-InstrSched.ll in particular improved to
      the point where if-conversion started kicking in; I turned it off
      for this test to preserve the intent of the test.
      
      llvm-svn: 69258
      0a40ad93
  2. Mar 18, 2009
  3. Mar 09, 2009
  4. Mar 04, 2009
  5. Feb 24, 2009
  6. Feb 22, 2009
  7. Feb 21, 2009
  8. Feb 20, 2009
  9. Feb 19, 2009
  10. Feb 18, 2009
  11. Feb 17, 2009
  12. Feb 15, 2009
  13. Feb 13, 2009
  14. Feb 09, 2009
  15. Jan 14, 2009
    • Dale Johannesen's avatar
      Fix the time regression I introduced in 464.h264ref with · 1f0e0e7c
      Dale Johannesen authored
      my earlier patch to this file.
      
      The issue there was that all uses of an IV inside a loop
      are actually references to Base[IV*2], and there was one
      use outside that was the same but LSR didn't see the base
      or the scaling because it didn't recurse into uses outside
      the loop; thus, it used base+IV*scale mode inside the loop
      instead of pulling base out of the loop.  This was extra bad
      because register pressure later forced both base and IV into
      memory.  Doing that recursion, at least enough
      to figure out addressing modes, is a good idea in general;
      the change in AddUsersIfInteresting does this.  However,
      there were side effects....
      
      It is also possible for recursing outside the loop to
      introduce another IV where there was only 1 before (if
      the refs inside are not scaled and the ref outside is).
      I don't think this is a common case, but it's in the testsuite.
      It is right to be very aggressive about getting rid of
      such introduced IVs (CheckForIVReuse and the handling of
      nonzero RewriteFactor in StrengthReduceStridedIVUsers).
      In the testcase in question the new IV produced this way
      has both a nonconstant stride and a nonzero base, neither
      of which was handled before.  And when inserting 
      new code that feeds into a PHI, it's right to put such 
      code at the original location rather than in the PHI's 
      immediate predecessor(s) when the original location is outside 
      the loop (a case that couldn't happen before)
      (RewriteInstructionToUseNewBase); better to avoid making
      multiple copies of it in this case.
      
      Also, the mechanism for keeping SCEV's corresponding to GEP's
      no longer works, as the GEP might change after its SCEV
      is remembered, invalidating the SCEV, and we might get a bad
      SCEV value when looking up the GEP again for a later loop.  
      This also couldn't happen before, as we weren't recursing
      into GEP's outside the loop.
      
      Also, when we build an expression that involves a (possibly
      non-affine) IV from a different loop as well as an IV from
      the one we're interested in (containsAddRecFromDifferentLoop),
      don't recurse into that.  We can't do much with it and will
      get in trouble if we try to create new non-affine IVs or something.
      
      More testcases are coming.
      
      llvm-svn: 62212
      1f0e0e7c
  16. Jan 12, 2009
  17. Dec 24, 2008
Loading