X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fspecialise%2FSpecialise.lhs;h=015332f0408d3f5e1d73f3bd706ac667da47fc30;hp=4d8efdd8c5c2c55dae5cf832fb3f16af9c5906cc;hb=4bc25e8c30559b7a6a87b39afcc79340ae778788;hpb=bd78c94a3b41f8d2097efc0415fa26e0cd1140ef diff --git a/compiler/specialise/Specialise.lhs b/compiler/specialise/Specialise.lhs index 4d8efdd..015332f 100644 --- a/compiler/specialise/Specialise.lhs +++ b/compiler/specialise/Specialise.lhs @@ -15,8 +15,8 @@ module Specialise ( specProgram ) where #include "HsVersions.h" import Id ( Id, idName, idType, mkUserLocal, idCoreRules, - idInlinePragma, setInlinePragma, setIdUnfolding, - isLocalId ) + idInlineActivation, setInlineActivation, setIdUnfolding, + isLocalId ) import TcType ( Type, mkTyVarTy, tcSplitSigmaTy, tyVarsOfTypes, tyVarsOfTheta, isClassPred, tcCmpType, isUnLiftedType @@ -829,7 +829,7 @@ specDefn subst calls fn rhs (tyvars, theta, _) = tcSplitSigmaTy fn_type n_tyvars = length tyvars n_dicts = length theta - inline_prag = idInlinePragma fn + inline_act = idInlineActivation fn -- It's important that we "see past" any INLINE pragma -- else we'll fail to specialise an INLINE thing @@ -913,7 +913,7 @@ specDefn subst calls fn rhs rule_name = mkFastString ("SPEC " ++ showSDoc (ppr fn <+> ppr spec_ty_args)) spec_env_rule = mkLocalRule rule_name - inline_prag -- Note [Auto-specialisation and RULES] + inline_act -- Note [Auto-specialisation and RULES] (idName fn) (poly_tyvars ++ inst_dict_ids) inst_args @@ -922,7 +922,7 @@ specDefn subst calls fn rhs -- Add the { d1' = dx1; d2' = dx2 } usage stuff final_uds = foldr addDictBind rhs_uds dx_binds - spec_pr | inline_rhs = (spec_f `setInlinePragma` inline_prag, Note InlineMe spec_rhs) + spec_pr | inline_rhs = (spec_f `setInlineActivation` inline_act, Note InlineMe spec_rhs) | otherwise = (spec_f, spec_rhs) ; return (Just (spec_pr, final_uds, spec_env_rule)) } } @@ -1068,7 +1068,8 @@ Note [Inline specialisations] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We transfer to the specialised function any INLINE stuff from the original. This means (a) the Activation in the IdInfo, and (b) any -InlineMe on the RHS. +InlineMe on the RHS. We do not, however, transfer the RuleMatchInfo +since we do not expect the specialisation to occur in rewrite rules. This is a change (Jun06). Previously the idea is that the point of inlining was precisely to specialise the function at its call site,