[commit: ghc] master: Inline wrappers earlier (8b10b89)

git at git.haskell.org git at git.haskell.org
Fri Apr 20 16:08:23 UTC 2018


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/8b10b8968f25589b1857f12788fc79b3b142c467/ghc

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

commit 8b10b8968f25589b1857f12788fc79b3b142c467
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Apr 20 13:57:16 2018 +0100

    Inline wrappers earlier
    
    This patch has a single significant change:
    
      strictness wrapper functions are inlined earlier,
      in phase 2 rather than phase 0.
    
    As shown by Trac #15056, this gives a better chance for RULEs to fire.
    Before this change, a function that would have inlined early without
    strictness analyss was instead inlining late. Result: applying
    "optimisation" made the program worse.
    
    This does not make too much difference in nofib, but I've stumbled
    over the problem more than once, so even a "no-change" result would be
    quite acceptable.  Here are the headlines:
    
    --------------------------------------------------------------------------------
            Program           Size    Allocs   Runtime   Elapsed  TotalMem
    --------------------------------------------------------------------------------
          cacheprof          -0.5%     -0.5%     +2.5%     +2.5%      0.0%
             fulsom          -1.0%     +2.6%     -0.1%     -0.1%      0.0%
               mate          -0.6%     +2.4%     -0.9%     -0.9%      0.0%
            veritas          -0.7%    -23.2%     0.002     0.002      0.0%
    --------------------------------------------------------------------------------
                Min          -1.4%    -23.2%    -12.5%    -15.3%      0.0%
                Max          +0.6%     +2.6%     +4.4%     +4.3%    +19.0%
     Geometric Mean          -0.7%     -0.2%     -1.4%     -1.7%     +0.2%
    
    * A worthwhile reduction in binary size.
    
    * Runtimes are not to be trusted much but look as if they
      are moving the right way.
    
    * A really big win in veritas, described in comment:1 of
      Trac #15056; more fusion rules fired.
    
    * I investigated the losses in 'mate' and 'fulsom'; see #15056.


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

8b10b8968f25589b1857f12788fc79b3b142c467
 compiler/stranal/WorkWrap.hs                       | 137 +++++++-----
 .../tests/simplCore/should_compile/T13143.stderr   |   4 +-
 testsuite/tests/simplCore/should_compile/T15056.hs |   6 +
 .../tests/simplCore/should_compile/T15056.stderr   |   9 +
 .../tests/simplCore/should_compile/T15056a.hs      |  11 +
 .../tests/simplCore/should_compile/T3717.stderr    |   4 +-
 .../tests/simplCore/should_compile/T4908.stderr    |   6 +-
 .../tests/simplCore/should_compile/T4930.stderr    |   4 +-
 .../tests/simplCore/should_compile/T6056.stderr    |   2 +-
 testsuite/tests/simplCore/should_compile/all.T     |   1 +
 .../simplCore/should_compile/spec-inline.stderr    |   6 +-
 .../tests/stranal/should_compile/T10482.stderr     | 150 ++++++-------
 .../tests/stranal/should_compile/T10482a.stderr    | 248 ++++++++++-----------
 13 files changed, 323 insertions(+), 265 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 8b10b8968f25589b1857f12788fc79b3b142c467


More information about the ghc-commits mailing list