1. 22 Dec, 2010 1 commit
    • simonpj@microsoft.com's avatar
      Make mkDFunUnfolding more robust · 3e0a7b9f
      simonpj@microsoft.com authored
      It now uses tcSplitDFunTy, which is designed for the purpose and
      allows arbitrary argument types to the dfun, rather than
      tcSplitSigmaTy.  This generality is used in DPH, which has
      internally-generated dfuns with impliciation-typed arguments.
      
      To do this I had to make tcSplitDFunTy return the number of
      arguments, so there are some minor knock-on effects in other
      modules.
      3e0a7b9f
  2. 21 Dec, 2010 5 commits
    • Simon Marlow's avatar
      Count allocations more accurately · db0c13a4
      Simon Marlow authored
      The allocation stats (+RTS -s etc.) used to count the slop at the end
      of each nursery block (except the last) as allocated space, now we
      count the allocated words accurately.  This should make allocation
      figures more predictable, too.
      
      This has the side effect of reducing the apparent allocations by a
      small amount (~1%), so remember to take this into account when looking
      at nofib results.
      db0c13a4
    • simonpj@microsoft.com's avatar
      Add a simple arity analyser · 1d7a3cf3
      simonpj@microsoft.com authored
      I've wanted to do this for ages, but never gotten around to
      it.  The main notes are in Note [Arity analysis] in SimplUtils.
      
      The motivating example for arity analysis is this:
      
        f = \x. let g = f (x+1)
                in \y. ...g...
      
      What arity does f have?  Really it should have arity 2, but a naive
      look at the RHS won't see that.  You need a fixpoint analysis which
      says it has arity "infinity" the first time round.
      
      This makes things more robust to the way in which you write code.  For
      example, see Trac #4474 which is fixed by this change.
      
      Not a huge difference, but worth while:
      
              Program           Size    Allocs   Runtime   Elapsed
      --------------------------------------------------------------------------------
                  Min          -0.4%     -2.2%    -10.0%    -10.0%
                  Max          +2.7%     +0.3%     +7.1%     +6.9%
       Geometric Mean          -0.3%     -0.2%     -2.1%     -2.2%
      
      I don't really believe the runtime numbers, because the machine was
      busy, but the bottom line is that not much changes, and what does
      change reliably (allocation and size) is in the right direction.
      1d7a3cf3
    • simonpj@microsoft.com's avatar
      62af0377
    • simonpj@microsoft.com's avatar
      Comments only · 05fecd15
      simonpj@microsoft.com authored
      05fecd15
    • simonpj@microsoft.com's avatar
      Single-method classes are implemented with a newtype · 3d16d9d8
      simonpj@microsoft.com authored
      This patch changes things so that such classes rely on the coercion
      mechanism for inlining (since the constructor is really just a cast)
      rather than on the dfun mechanism, therby removing some needless
      runtime indirections.
      3d16d9d8
  3. 01 Nov, 2010 1 commit
  4. 21 Dec, 2010 5 commits
  5. 16 Dec, 2010 1 commit
  6. 20 Dec, 2010 1 commit
    • simonpj@microsoft.com's avatar
      Small improvement to CorePrep · c391db23
      simonpj@microsoft.com authored
      This change avoids unnecessary bindings. Example
      
           foo (let fn = \x.blah in
                in fn)
      
      We were generating something stupid like
      
          let fn = \x.blah in
          let fn' = \eta. fn eta
          in foo fn
      
      Now we don't.  The change is quite small.
      
      Thanks to Ben for showing me an example of this happening.
      c391db23
  7. 19 Dec, 2010 4 commits
  8. 18 Dec, 2010 8 commits
  9. 17 Dec, 2010 6 commits
  10. 16 Dec, 2010 4 commits
  11. 15 Dec, 2010 2 commits
  12. 16 Dec, 2010 1 commit
  13. 09 Dec, 2010 1 commit