X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FstgSyn%2FCoreToStg.lhs;h=fc7550fe01aba68bd316dbb72f3694197f04fd34;hb=cbebca1c9164a5e5ae9b117d0dcf5ad217defc6d;hp=b0595ab1ef997cea45b9de84fcd5db736a3c3e98;hpb=6193ff066266120cd18712e0663dfae36034aa51;p=ghc-hetmet.git diff --git a/compiler/stgSyn/CoreToStg.lhs b/compiler/stgSyn/CoreToStg.lhs index b0595ab..fc7550f 100644 --- a/compiler/stgSyn/CoreToStg.lhs +++ b/compiler/stgSyn/CoreToStg.lhs @@ -18,8 +18,8 @@ import StgSyn import Type import TyCon +import MkId ( coercionTokenId ) import Id -import Var ( Var ) import IdInfo import DataCon import CostCentre ( noCCS ) @@ -218,7 +218,7 @@ coreTopBindToStg this_pkg env body_fvs (Rec pairs) -- floated out a binding, in which case it will be approximate. consistentCafInfo :: Id -> GenStgBinding Var Id -> Bool consistentCafInfo id bind - = WARN( not (exact || is_sat_thing) , ppr id ) + = WARN( not (exact || is_sat_thing) , ppr id <+> ppr id_marked_caffy <+> ppr binding_is_caffy ) safe where safe = id_marked_caffy || not binding_is_caffy @@ -549,6 +549,8 @@ coreToStgApp _ f args = do -- All the free vars of the args are disqualified -- from being let-no-escaped. + -- Forcing these fixes a leak in the code generator, noticed while + -- profiling for trac #4367 app `seq` fvs `seq` seqVarSet vars `seq` return ( app, fvs, @@ -570,6 +572,10 @@ coreToStgArgs (Type _ : args) = do -- Type argument (args', fvs) <- coreToStgArgs args return (args', fvs) +coreToStgArgs (Coercion _ : args) -- Coercion argument; replace with place holder + = do { (args', fvs) <- coreToStgArgs args + ; return (StgVarArg coercionTokenId : args', fvs) } + coreToStgArgs (arg : args) = do -- Non-type argument (stg_args, args_fvs) <- coreToStgArgs args (arg', arg_fvs, _escs) <- coreToStgExpr arg @@ -772,7 +778,7 @@ mkStgRhs rhs_fvs srt binder_info rhs assumptions (namely that they will be entered only once). upd_flag | isPAP env rhs = ReEntrant - | otherwise = Updatable + | otherwise = Updatable -} {- ToDo: @@ -1122,7 +1128,7 @@ myCollectArgs expr go (Cast e _) as = go e as go (Note _ e) as = go e as go (Lam b e) as - | isTyCoVar b = go e as -- Note [Collect args] + | isTyVar b = go e as -- Note [Collect args] go _ _ = pprPanic "CoreToStg.myCollectArgs" (ppr expr) \end{code}