- spec_pr | inline_rhs = (spec_f_w_arity `setInlineActivation` inline_act, Note InlineMe spec_rhs)
- | otherwise = (spec_f_w_arity, spec_rhs)
-
- ; return (Just (spec_pr, final_uds, spec_env_rule)) } }
+ -- Adding arity information just propagates it a bit faster
+ -- See Note [Arity decrease] in Simplify
+ -- Copy InlinePragma information from the parent Id.
+ -- So if f has INLINE[1] so does spec_f
+ spec_f_w_arity = spec_f `setIdArity` max 0 (fn_arity - n_dicts)
+ `setInlineActivation` inl_act
+
+ -- Add an InlineRule if the parent has one
+ -- See Note [Inline specialisations]
+ final_spec_f
+ | Just sat <- fn_has_inline_rule
+ = let
+ mb_spec_arity = if sat then Just spec_arity else Nothing
+ in
+ spec_f_w_arity `setIdUnfolding` mkInlineRule spec_rhs mb_spec_arity
+ | otherwise
+ = spec_f_w_arity
+
+ ; return (Just ((final_spec_f, spec_rhs), final_uds, spec_env_rule)) } }