[commit: ghc] master: Another improvement to SetLevels (b8f58d7)

git at git.haskell.org git at git.haskell.org
Tue Feb 7 14:01:07 UTC 2017


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

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

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

commit b8f58d79ee3e34840beeea2fab846a9f47bff21a
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Dec 23 14:17:42 2016 +0000

    Another improvement to SetLevels
    
    In my recent commit
       commit 432f952ef64641be9f32152a0fbf2b8496d8fe9c
       Float unboxed expressions by boxing
    I changed how float_me in lvlMFE worked.  That was right, but
    it exposed another bug: an error expression wasn't getting floated
    as it should from a case alternative.  And that led to a collection
    of minor improvements
    
    * I found a much better way to cast it, by using lvlFloatRhs for
      top-level bindinds as well as nested ones, which is
        (a) more consistent and
        (b) works correctly.
    
      See Note [Floating from a RHS]
    
    * I also found some delicacy in the "floating to the top" stuff, so I
      greatly elaborated the Note [Floating to the top].
    
    * I simplified the "bottoming-float" stuff; the change is in the treatment
      of bottoming lambdas (\x y. error blah), where we now float the
      (error blah) part instead of the whole lambda (which risks just making
      duplicate lambdas.  See Note [Bottoming floats], esp (2).
    
    Perf effects are minor.
    
    * perf/compiler/T13056 improved sligtly (about 2%) in compiler
      allocations. Also T9233 improved by 1%.  I'm not sure why.
    
    * Some small nofib changes:
        - Generally some very small reductions in run-time
          allocation, except k-nucleotide, which halves for some
          reason.  (I did try to look but it's a big complicated
          function and it was far from obvious.  Had it been a loss
          I would have looked harder!
    
    NB: there's a nearby patch "Do not inline bottoming things" that could
    also be responsible for either or both.  I didn't think it was worth
    more testing to distinguish.
    
    --------------------------------------------------------------------------------
            Program           Size    Allocs   Runtime   Elapsed  TotalMem
    --------------------------------------------------------------------------------
               grep          +0.1%     -0.2%      0.00      0.00     +0.0%
             mandel          -0.1%     -1.4%      0.13      0.13     +0.0%
       k-nucleotide          +0.1%    -51.6%     -1.0%     -1.0%     +0.0%
    --------------------------------------------------------------------------------
                Min          -0.3%    -51.6%     -9.4%     -9.1%     -4.0%
                Max          +0.2%     +0.0%    +31.8%    +32.7%     +0.0%
     Geometric Mean          -0.0%     -0.8%     +1.4%     +1.4%     -0.1%


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

b8f58d79ee3e34840beeea2fab846a9f47bff21a
 compiler/coreSyn/CoreUtils.hs       |   7 +-
 compiler/simplCore/SetLevels.hs     | 499 ++++++++++++++++++++++--------------
 compiler/simplCore/Simplify.hs      |   8 +-
 testsuite/tests/perf/compiler/all.T |  19 +-
 4 files changed, 329 insertions(+), 204 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 b8f58d79ee3e34840beeea2fab846a9f47bff21a


More information about the ghc-commits mailing list