[compiler-hacking] @inline attribute?

Mark Shinwell mark at three-tuns.net
Thu Oct 30 16:27:08 GMT 2014


On Thu, Oct 30, 2014 at 05:19:29PM +0100, Pierre Chambart wrote:
> > Agreed. And an opposite attribute to ensure a function is not inlined
> > would be useful too.
>
> Why would you need something like that ?

For a function where 99% of the time it takes a short code path, and for
1% of the time takes the long one, it's probably going to give better
cache performance if the 1% code path is taken out into another,
non-inlinable function.

To Anil's point: I've wondered about a mode (using the allocation profiling
compiler) in Merlin or the like where allocations would be highlighted in
the editor.  The idea of inlining feedback seems as if it might require
similar infrastructure.  Could be very cool.

Mark


More information about the Cam-compiler-hacking mailing list