X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FbasicTypes%2FMkId.lhs;h=0c84685f87bb9fa0e5732e55738ad572429fcbe2;hb=7d44782fdfab8c280ae8de1846cb40a78b6edb95;hp=84b3546e622f1b1f4421b6bc544caaca89a89b4a;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1;p=ghc-hetmet.git diff --git a/compiler/basicTypes/MkId.lhs b/compiler/basicTypes/MkId.lhs index 84b3546..0c84685 100644 --- a/compiler/basicTypes/MkId.lhs +++ b/compiler/basicTypes/MkId.lhs @@ -252,7 +252,7 @@ mkDataConIds wrap_name wkr_name data_con isSingleton orig_arg_tys ) -- No existentials on a newtype, but it can have a context -- e.g. newtype Eq a => T a = MkT (...) - mkTopUnfolding $ Note InlineMe $ + mkCompulsoryUnfolding $ mkLams tyvars $ Lam id_arg1 $ mkNewTypeBody tycon result_ty (Var id_arg1) @@ -902,22 +902,26 @@ seqId ty = mkForAllTys [alphaTyVar,openBetaTyVar] (mkFunTy alphaTy (mkFunTy openBetaTy openBetaTy)) [x,y] = mkTemplateLocals [alphaTy, openBetaTy] --- gaw 2004 rhs = mkLams [alphaTyVar,openBetaTyVar,x,y] (Case (Var x) x openBetaTy [(DEFAULT, [], Var y)]) -- lazy :: forall a?. a? -> a? (i.e. works for unboxed types too) -- Used to lazify pseq: pseq a b = a `seq` lazy b --- No unfolding: it gets "inlined" by the worker/wrapper pass --- Also, no strictness: by being a built-in Id, it overrides all --- the info in PrelBase.hi. This is important, because the strictness +-- +-- Also, no strictness: by being a built-in Id, all the info about lazyId comes from here, +-- not from GHC.Base.hi. This is important, because the strictness -- analyser will spot it as strict! +-- +-- Also no unfolding in lazyId: it gets "inlined" by a HACK in the worker/wrapper pass +-- (see WorkWrap.wwExpr) +-- We could use inline phases to do this, but that would be vulnerable to changes in +-- phase numbering....we must inline precisely after strictness analysis. lazyId = pcMiscPrelId lazyIdName ty info where info = noCafIdInfo ty = mkForAllTys [alphaTyVar] (mkFunTy alphaTy alphaTy) -lazyIdUnfolding :: CoreExpr -- Used to expand LazyOp after strictness anal +lazyIdUnfolding :: CoreExpr -- Used to expand 'lazyId' after strictness anal lazyIdUnfolding = mkLams [openAlphaTyVar,x] (Var x) where [x] = mkTemplateLocals [openAlphaTy]