
12 May
2007
12 May
'07
12:48 p.m.
On Fri, 2007-05-11 at 16:05 -0400, Isaac Dupree wrote:
Simon Peyton-Jones wrote:
It's very difficult to get inlining right all the time. Even for a function marked INLINE, there's really no point in inlining in some contexts. E.g. map f xs (don't inline f).
Would it make sense to tentatively inline anyway, and in a later stage, if that bit of code is still equivalent to a call to f (i.e., no optimizations have taken advantage of it), replace it with a reference to f?
Not really because, so long as it remains in the form of map f xs we can always choose to inline map whenever it later looks like it might be beneficial (eg when we know something about f or xs). Also, uninlining is nigh on impossible. Duncan