X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fstranal%2FWwLib.lhs;h=e44e521c83b6dd09dd8e5782331743372a076862;hb=9db74caf09e2e0a5387d63499de87579d83835cb;hp=e1a1da6463532f6490298a0d1515ec719cbafccc;hpb=98688c6e8fd33f31c51218cf93cbf03fe3a5e73d;p=ghc-hetmet.git diff --git a/ghc/compiler/stranal/WwLib.lhs b/ghc/compiler/stranal/WwLib.lhs index e1a1da6..e44e521 100644 --- a/ghc/compiler/stranal/WwLib.lhs +++ b/ghc/compiler/stranal/WwLib.lhs @@ -295,7 +295,7 @@ mk_wrap_arg uniq ty dmd one_shot \begin{code} mkWWstr :: [Var] -- Wrapper args; have their demand info on them - -- *Includes type variables* + -- *Includes type variables* -> UniqSM ([Var], -- Worker args CoreExpr -> CoreExpr, -- Wrapper body, lacking the worker call -- and without its lambdas @@ -358,7 +358,7 @@ mkWWstr_one arg -- of dropping seqs in the worker Eval (Poly Abs) -> let - arg_w_unf = arg `setIdUnfolding` mkOtherCon [] + arg_w_unf = arg `setIdUnfolding` evaldUnfolding -- Tell the worker arg that it's sure to be evaluated -- so that internal seqs can be dropped in @@ -429,8 +429,8 @@ mkWWcpr body_ty RetCPR arg = mk_ww_local arg_uniq con_arg_ty1 con_app = mkConApp data_con (map Type tycon_arg_tys ++ [Var arg]) in - returnUs (\ wkr_call -> Case wkr_call arg [(DEFAULT, [], con_app)], - \ body -> workerCase body work_wild [(DataAlt data_con, [arg], Var arg)], + returnUs (\ wkr_call -> Case wkr_call arg (exprType con_app) [(DEFAULT, [], con_app)], + \ body -> workerCase body work_wild con_arg_ty1 [(DataAlt data_con, [arg], Var arg)], con_arg_ty1) | otherwise -- The general case @@ -445,8 +445,8 @@ mkWWcpr body_ty RetCPR ubx_tup_app = mkConApp ubx_tup_con (map Type con_arg_tys ++ arg_vars) con_app = mkConApp data_con (map Type tycon_arg_tys ++ arg_vars) in - returnUs (\ wkr_call -> Case wkr_call wrap_wild [(DataAlt ubx_tup_con, args, con_app)], - \ body -> workerCase body work_wild [(DataAlt data_con, args, ubx_tup_app)], + returnUs (\ wkr_call -> Case wkr_call wrap_wild (exprType con_app) [(DataAlt ubx_tup_con, args, con_app)], + \ body -> workerCase body work_wild ubx_tup_ty [(DataAlt data_con, args, ubx_tup_app)], ubx_tup_ty) where (_, tycon_arg_tys, data_con, con_arg_tys) = splitProductType "mkWWcpr" body_ty @@ -467,8 +467,8 @@ mkWWcpr body_ty other -- No CPR info -- This transform doesn't move work or allocation -- from one cost centre to another -workerCase (Note (SCC cc) e) arg alts = Note (SCC cc) (Case e arg alts) -workerCase e arg alts = Case e arg alts +workerCase (Note (SCC cc) e) arg ty alts = Note (SCC cc) (Case e arg ty alts) +workerCase e arg ty alts = Case e arg ty alts \end{code} @@ -494,9 +494,10 @@ mk_unpk_case arg unpk_args boxing_con boxing_tycon body -- A data type = Case (Var arg) (sanitiseCaseBndr arg) + (exprType body) [(DataAlt boxing_con, unpk_args, body)] -mk_seq_case arg body = Case (Var arg) (sanitiseCaseBndr arg) [(DEFAULT, [], body)] +mk_seq_case arg body = Case (Var arg) (sanitiseCaseBndr arg) (exprType body) [(DEFAULT, [], body)] sanitiseCaseBndr :: Id -> Id -- The argument we are scrutinising has the right type to be