diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2016-12-09 00:04:00 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2016-12-23 12:34:33 +0000 |
commit | 432f952ef64641be9f32152a0fbf2b8496d8fe9c (patch) | |
tree | 451798066f26f35e038947eca7827e23d6e6b7bf /compiler/prelude/TysPrim.hs | |
parent | 11306d62250bcb8c40b1feb511ab90006dcd01d5 (diff) | |
download | haskell-432f952ef64641be9f32152a0fbf2b8496d8fe9c.tar.gz |
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.
Diffstat (limited to 'compiler/prelude/TysPrim.hs')
-rw-r--r-- | compiler/prelude/TysPrim.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/prelude/TysPrim.hs b/compiler/prelude/TysPrim.hs index 364aea41f1..dce0369edf 100644 --- a/compiler/prelude/TysPrim.hs +++ b/compiler/prelude/TysPrim.hs @@ -32,12 +32,12 @@ module TysPrim( funTyCon, funTyConName, primTyCons, - charPrimTyCon, charPrimTy, - intPrimTyCon, intPrimTy, - wordPrimTyCon, wordPrimTy, - addrPrimTyCon, addrPrimTy, - floatPrimTyCon, floatPrimTy, - doublePrimTyCon, doublePrimTy, + charPrimTyCon, charPrimTy, charPrimTyConName, + intPrimTyCon, intPrimTy, intPrimTyConName, + wordPrimTyCon, wordPrimTy, wordPrimTyConName, + addrPrimTyCon, addrPrimTy, addrPrimTyConName, + floatPrimTyCon, floatPrimTy, floatPrimTyConName, + doublePrimTyCon, doublePrimTy, doublePrimTyConName, voidPrimTyCon, voidPrimTy, statePrimTyCon, mkStatePrimTy, |