[commit: ghc] wip/T16039: tinker with exprIsCheapX (e990b91)
git at git.haskell.org
git at git.haskell.org
Sun Mar 31 15:07:16 UTC 2019
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/T16039
Link : http://ghc.haskell.org/trac/ghc/changeset/e990b91b03a0b510d2c207c8b9f3a663045b4e15/ghc
>---------------------------------------------------------------
commit e990b91b03a0b510d2c207c8b9f3a663045b4e15
Author: Gabor Greif <ggreif at gmail.com>
Date: Tue Dec 18 21:52:05 2018 +0100
tinker with exprIsCheapX
>---------------------------------------------------------------
e990b91b03a0b510d2c207c8b9f3a663045b4e15
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