Specialize functions guaranteed to inline?
I found this particular, commented out, case in Specialize.hs.
-- && not (certainlyWillInline (idUnfolding fn)) -- And it's not small
-- See Note [Inline specialisation] for why we do not
-- switch off specialisation for inline functions
I think the goal here was to disable specialization for functions who will inline anyway. But at some point in time 20 years ago simon disabled this given this reasoning:
-- At one time I tried not specialising small functions
-- but sometimes there are big functions marked INLINE
-- that we'd like to specialise. In particular, dictionary
-- functions, which Marcin is keen to inline
I imagine the issue might have been that we would not end up inlining such a function for some reason at the time.
However these days certainlyWillInline
changes the unfolding of such functions to one that guarantees it will inline.
So maybe we should reenable this now.