[commit: ghc] wip/T14626: WIP: look at evaluated-ness (e2514f6)
git at git.haskell.org
git at git.haskell.org
Wed Jan 3 16:16:51 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/T14626
Link : http://ghc.haskell.org/trac/ghc/changeset/e2514f666c5d39ed241f4f16176fddce8cad1829/ghc
>---------------------------------------------------------------
commit e2514f666c5d39ed241f4f16176fddce8cad1829
Author: Gabor Greif <ggreif at gmail.com>
Date: Wed Jan 3 16:55:15 2018 +0100
WIP: look at evaluated-ness
>---------------------------------------------------------------
e2514f666c5d39ed241f4f16176fddce8cad1829
compiler/codeGen/StgCmmClosure.hs | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/compiler/codeGen/StgCmmClosure.hs b/compiler/codeGen/StgCmmClosure.hs
index bc9bb65..63d3178 100644
--- a/compiler/codeGen/StgCmmClosure.hs
+++ b/compiler/codeGen/StgCmmClosure.hs
@@ -69,6 +69,7 @@ module StgCmmClosure (
import GhcPrelude
import StgSyn
+import CoreSyn (isEvaldUnfolding)
import SMRep
import Cmm
import PprCmmExpr()
@@ -625,6 +626,15 @@ getCallMethod dflags name id (LFThunk _ _ updatable std_form_info is_fun)
getCallMethod _ _name _ (LFUnknown True) _n_arg _v_args _cg_locs _self_loop_info
= SlowCall -- might be a function
+getCallMethod _ name id (LFUnknown False) 0 _v_args _cg_loc _self_loop_info
+ | isEvaldUnfolding (idUnfolding id)
+ , ('w':'i':'l':'d':_) <- occNameString (nameOccName name) -- FIXME: remove later
+ = pprTrace "getCallMethod" (ppr id) ReturnIt -- seems to come from case, must be (tagged) WHNF already
+{-
+getCallMethod _ name _ (LFUnknown False) 0 _v_args _cg_loc _self_loop_info
+ | occNameString (nameOccName name) == "wild" -- TODO: make this robust
+ = ReturnIt -- seems to come from case, must be (tagged) WHNF already
+-}
getCallMethod _ name _ (LFUnknown False) n_args _v_args _cg_loc _self_loop_info
= ASSERT2( n_args == 0, ppr name <+> ppr n_args )
EnterIt -- Not a function
More information about the ghc-commits
mailing list