[commit: ghc] master: Float unboxed expressions by boxing (432f952)

git at git.haskell.org git at git.haskell.org
Fri Dec 23 12:34:53 UTC 2016


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

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

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

commit 432f952ef64641be9f32152a0fbf2b8496d8fe9c
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Dec 9 00:04:00 2016 +0000

    Float unboxed expressions by boxing
    
    This patch makes GHC's floating more robust, by allowing it
    to float unboxed expressions of at least some common types.
    
    See Note [Floating MFEs of unlifted type] in SetLevels.
    
    This was all provoked by Trac #12603
    
    In working this through I also made a number of other corner-case
    changes in SetLevels:
    
    * Previously we inconsistently use exprIsBottom (which checks for
      bottom) instead of exprBotStrictness_maybe (which checks for
      bottoming functions).  As well as being inconsistent it was
      simply less good.
    
      See Note [Bottoming floats]
    
    * I fixed a case where were were unprofitably floating an
      expression because we thought it escaped a value lambda
      (see Note [Escaping a value lambda]).  The relevant code is
           float_me = (dest_lvl `ltMajLvl` (le_ctxt_lvl env)
                      && not float_is_lam)   -- NEW
    
    * I made lvlFloatRhs work properly in the case where abs_vars
      is non-empty.  It wasn't wrong before, but it did some stupid
      extra floating.


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

432f952ef64641be9f32152a0fbf2b8496d8fe9c
 compiler/prelude/TysPrim.hs                        |  12 +-
 compiler/prelude/TysWiredIn.hs                     |  28 ++
 compiler/simplCore/SetLevels.hs                    | 297 +++++++++++++--------
 testsuite/tests/simplCore/should_compile/Makefile  |   4 +
 testsuite/tests/simplCore/should_compile/T12603.hs |  45 ++++
 .../tests/simplCore/should_compile/T12603.stdout   |   1 +
 testsuite/tests/simplCore/should_compile/all.T     |   5 +
 7 files changed, 274 insertions(+), 118 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 432f952ef64641be9f32152a0fbf2b8496d8fe9c


More information about the ghc-commits mailing list