[commit: ghc] master: Join-point refactoring (71037b6)

git at git.haskell.org git at git.haskell.org
Tue May 2 09:14:34 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/71037b61597d8e80ba5acebc8ad2295e5266dc07/ghc

>---------------------------------------------------------------

commit 71037b61597d8e80ba5acebc8ad2295e5266dc07
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Thu Apr 27 17:04:14 2017 +0100

    Join-point refactoring
    
    This commit has a raft of refactorings that improve the treatment
    of join points.  I wasn't aiming so much as to gain performance as
    to make the code simpler.
    
    The two big things are these:
    
    * Make mkDupableCont work for SimplBind as well.  This is simpler than
      I thought and quite neat.  (Luke had aready done StrictArg.)  That's
      a win in its own right. But also now /all/ continuations can be made
      dup-able
    
    * Now that all continuations can be made dup-able, I could simplify
      mkDupableCont to return just one SimplCont, instead of two.
      That really is a worthwhile simlification!  Much easier to think
      about.
    
    Plus a bunch of smaller things:
    
    * Remove the join-arity that had been added to seIdSubst.
      It can be done more simply by putting it in DoneEx, which
      is the only constructor that actually needs it, and now we
      don't need the unsavoury isJoinIdInEnv_maybe.
    
    * Re-order the handling of join points in Simplify, so that we don't need
      the horrible resultTypeOfDupableCont
    
    * Add field names for StrictBind, StrictArg; and use them
    
    * Define simplMonad.newJoinId, and use it
    
    * Rename the seFloats field of SimplEnv to seLetFloats
    
    Binary sizes seem to go up slightly, but allocations generally
    improve, sometimes significantly.  I don't believe the runtime numbers
    are reliable enough to draw any conclusions about
    
    --------------------------------------------------------------------------------
            Program           Size    Allocs   Runtime   Elapsed  TotalMem
    --------------------------------------------------------------------------------
              event          +1.1%    -12.0%     -0.2%     -0.2%     -8.7%
             fulsom          +1.9%    -11.8%    -10.0%    -10.0%     +5.3%
         last-piece          +2.3%     -1.2%     -1.2%     -1.2%     +0.0%
               mate          +0.9%     -1.4%     -0.6%     -0.7%     +0.0%
         multiplier          +1.5%     -8.3%      0.17      0.17     +0.0%
             parser          +2.0%     +1.0%      0.04      0.04     +0.0%
            parstof          +1.5%     +0.7%      0.01      0.01     +0.0%
              sched          +1.3%     -6.1%      0.03      0.03     +0.0%
             simple          +1.8%     +1.0%     +9.7%     +9.6%     +0.0%
    --------------------------------------------------------------------------------
                Min          +0.5%    -12.0%    -10.0%    -10.0%     -8.7%
                Max          +3.0%     +1.0%    +14.2%    +14.2%    +50.0%
     Geometric Mean          +1.4%     -0.4%     +0.3%     +0.4%     +0.5%
    
    There's also a tests/perf/compiler improvement of 20% allocation in
    T6048.  I think it's because we now generate smaller code.


>---------------------------------------------------------------

71037b61597d8e80ba5acebc8ad2295e5266dc07
 compiler/simplCore/SimplEnv.hs                     | 237 ++++----
 compiler/simplCore/SimplMonad.hs                   |  20 +-
 compiler/simplCore/SimplUtils.hs                   | 125 ++--
 compiler/simplCore/Simplify.hs                     | 627 +++++++++++----------
 testsuite/tests/perf/compiler/all.T                |   3 +-
 .../tests/simplCore/should_compile/T12603.stdout   |   2 +-
 .../tests/simplCore/should_compile/T3234.stderr    |  10 +-
 7 files changed, 548 insertions(+), 476 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 71037b61597d8e80ba5acebc8ad2295e5266dc07


More information about the ghc-commits mailing list