{-# INLINE me_harder #-}

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Sat May 12 08:48:22 EDT 2007


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



More information about the Glasgow-haskell-users mailing list