[commit: ghc] wip/T13861: WIP: check isEvaldUnfolding (8f627c9)

git at git.haskell.org git at git.haskell.org
Tue Jan 2 18:51:17 UTC 2018


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

On branch  : wip/T13861
Link       : http://ghc.haskell.org/trac/ghc/changeset/8f627c9f25b643e2b743b93d1b1059efcdc409ef/ghc

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

commit 8f627c9f25b643e2b743b93d1b1059efcdc409ef
Author: Gabor Greif <ggreif at gmail.com>
Date:   Tue Jan 2 19:50:47 2018 +0100

    WIP: check isEvaldUnfolding
    
    unfortunately it does not cover the "wild_*" variables :-(


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

8f627c9f25b643e2b743b93d1b1059efcdc409ef
 compiler/codeGen/StgCmmClosure.hs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/compiler/codeGen/StgCmmClosure.hs b/compiler/codeGen/StgCmmClosure.hs
index 8bcea14..8c49628 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()
@@ -626,6 +627,10 @@ 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)
+  = 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



More information about the ghc-commits mailing list