[commit: ghc] wip/T14626: WIP: look at evaluated-ness (c6c3939)

git at git.haskell.org git at git.haskell.org
Sun Jan 28 16:06:13 UTC 2018


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

On branch  : wip/T14626
Link       : http://ghc.haskell.org/trac/ghc/changeset/c6c3939426c639a6f370c3cedd8dc49c4a0da293/ghc

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

commit c6c3939426c639a6f370c3cedd8dc49c4a0da293
Author: Gabor Greif <ggreif at gmail.com>
Date:   Wed Jan 3 16:55:15 2018 +0100

    WIP: look at evaluated-ness


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

c6c3939426c639a6f370c3cedd8dc49c4a0da293
 compiler/codeGen/StgCmmClosure.hs | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/compiler/codeGen/StgCmmClosure.hs b/compiler/codeGen/StgCmmClosure.hs
index 669b1e5..4c7fdd7 100644
--- a/compiler/codeGen/StgCmmClosure.hs
+++ b/compiler/codeGen/StgCmmClosure.hs
@@ -71,6 +71,7 @@ import GhcPrelude
 import CoreSyn( isValueUnfolding, maybeUnfoldingTemplate, Expr(Cast) )
 import CoreOpt( exprIsSatConApp_maybe )
 import StgSyn
+import CoreSyn (isEvaldUnfolding)
 import SMRep
 import Cmm
 import PprCmmExpr()
@@ -631,6 +632,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