[commit: ghc] wip/T16039: WIP: refactor and generalise (#16039) (797e434)

git at git.haskell.org git at git.haskell.org
Sun Mar 31 15:07:26 UTC 2019


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

On branch  : wip/T16039
Link       : http://ghc.haskell.org/trac/ghc/changeset/797e43444ec0f41b3db2dc23e07777a74dff1ecb/ghc

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

commit 797e43444ec0f41b3db2dc23e07777a74dff1ecb
Author: Gabor Greif <ggreif at gmail.com>
Date:   Wed Dec 12 13:43:09 2018 +0100

    WIP: refactor and generalise (#16039)


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

797e43444ec0f41b3db2dc23e07777a74dff1ecb
 compiler/simplCore/SetLevels.hs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/compiler/simplCore/SetLevels.hs b/compiler/simplCore/SetLevels.hs
index e2aa945..87e0e18 100644
--- a/compiler/simplCore/SetLevels.hs
+++ b/compiler/simplCore/SetLevels.hs
@@ -969,7 +969,7 @@ notWorthFloating :: CoreExpr -> [Var] -> Bool
 -- we replace e with (lvl79 x y) and then run FloatOut again, don't want
 -- to replace (lvl79 x y) with (lvl83 x y)!
 
-notWorthFloating (App (App (Var v) Type{}) Var{}) _ | v `hasKey` noinlineIdKey = True
+--notWorthFloating (App (App (Var v) Type{}) Var{}) _ | v `hasKey` noinlineIdKey = True
 
 notWorthFloating e abs_vars
   = go e (count isId abs_vars)
@@ -982,6 +982,9 @@ notWorthFloating e abs_vars
     go (App e arg) n
        | Type {}     <- arg = go e n
        | Coercion {} <- arg = go e n
+       | App (Var v) Type {} <- e
+       , v `hasKey` noinlineIdKey
+       , is_triv arg        = True
        | n==0               = False
        | is_triv arg        = go e (n-1)
        | otherwise          = False



More information about the ghc-commits mailing list