[commit: ghc] wip/T16039: tinker with exprIsCheapX (ceca8ef)

git at git.haskell.org git at git.haskell.org
Thu Dec 27 17:02:02 UTC 2018


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

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

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

commit ceca8ef33715572ea5e5c4e84ddc11558fffa3ee
Author: Gabor Greif <ggreif at gmail.com>
Date:   Tue Dec 18 21:52:05 2018 +0100

    tinker with exprIsCheapX


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

ceca8ef33715572ea5e5c4e84ddc11558fffa3ee
 compiler/coreSyn/CoreUtils.hs | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/compiler/coreSyn/CoreUtils.hs b/compiler/coreSyn/CoreUtils.hs
index 9c425e7..ea76f6d 100644
--- a/compiler/coreSyn/CoreUtils.hs
+++ b/compiler/coreSyn/CoreUtils.hs
@@ -62,7 +62,7 @@ module CoreUtils (
 import GhcPrelude
 
 import CoreSyn
-import PrelNames ( makeStaticName )
+import PrelNames ( makeStaticName, absentErrorIdKey, noinlineIdKey )
 import PprCore
 import CoreFVs( exprFreeVars )
 import Var
@@ -75,7 +75,6 @@ import DataCon
 import PrimOp
 import Id
 import IdInfo
-import PrelNames( absentErrorIdKey )
 import Type
 import TyCoRep( TyCoBinder(..), TyBinder )
 import Coercion
@@ -1239,6 +1238,9 @@ exprIsCheapX ok_app e
                     | otherwise       = go n e
     go n (Lam x e)  | isRuntimeVar x  = n==0 || go (n-1) e
                     | otherwise       = go n e
+    go n (App f e)  | App (Var v) Type {} <- f
+                    , v `hasKey` noinlineIdKey
+                    , isRuntimeArg e  = go n e
     go n (App f e)  | isRuntimeArg e  = go (n+1) f && ok e
                     | otherwise       = go n f
     go n (Let (NonRec _ r) e)         = go n e && ok r



More information about the ghc-commits mailing list