Interesting functions for inlining
I know that the inliner considers whether the context is "interesting" when deciding whether to inline, but I couldn't find documentation on that. One thing I'm particularly interested in is how this relates to higher-order functions. If a higher-order function is applied to a totally unknown function, that's pretty boring. But it gets more interesting the more is known about the function. I would expect interestingness bonuses if the applied function
- Has a known demand signature that isn't dull.
- Has a known arity greater than the called arity.
- Has an unfolding (especially a small one, such as a wrapper).
Are any of these on tap? I'm interested in getting some non-trivial folds to specialize to sufficiently interesting argument functions, and trying to avoid the INLINE
hammer.