X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fstranal%2FWorkWrap.lhs;h=29702cf9f3289c3a972c7d68d55f782a8a7d0b59;hb=dfcf88523ec5988fbcaa2cbf812cc5862ad621cf;hp=d964026756a178f7da9b6d9aaa83bbe2474d270d;hpb=302265d525004c7870864549f7a07a5759d32912;p=ghc-hetmet.git diff --git a/compiler/stranal/WorkWrap.lhs b/compiler/stranal/WorkWrap.lhs index d964026..29702cf 100644 --- a/compiler/stranal/WorkWrap.lhs +++ b/compiler/stranal/WorkWrap.lhs @@ -26,7 +26,7 @@ import NewDemand ( Demand(..), StrictSig(..), DmdType(..), DmdResult(..), ) import UniqSupply ( UniqSupply, initUs_, returnUs, thenUs, mapUs, getUniqueUs, UniqSM ) import Unique ( hasKey ) -import BasicTypes ( RecFlag(..), isNonRec, Activation(..) ) +import BasicTypes ( RecFlag(..), isNonRec ) import VarEnv ( isEmptyVarEnv ) import Maybes ( orElse ) import DynFlags @@ -256,14 +256,19 @@ splitFun fn_id fn_info wrap_dmds res_info inline_prag rhs work_rhs = work_fn rhs work_id = mkWorkerId work_uniq fn_id (exprType work_rhs) `setInlinePragma` inline_prag + -- Any inline pragma (which sets when inlining is active) + -- on the original function is duplicated on the worker and wrapper + -- It *matters* that the pragma stays on the wrapper + -- It seems sensible to have it on the worker too, although we + -- can't think of a compelling reason. (In ptic, INLINE things are + -- not w/wd) `setIdNewStrictness` StrictSig (mkTopDmdType work_demands work_res_info) -- Even though we may not be at top level, -- it's ok to give it an empty DmdEnv wrap_rhs = wrap_fn work_id wrap_id = fn_id `setIdWorkerInfo` HasWorker work_id arity - `setInlinePragma` AlwaysActive -- Zap any inline pragma; - -- Put it on the worker instead + in returnUs ([(work_id, work_rhs), (wrap_id, wrap_rhs)]) -- Worker first, because wrapper mentions it