GHC thinks it is smarter than me [was: RE: Transitive inlining]

Manuel M. T. Chakravarty chak@cse.unsw.edu.au
Sun, 31 Dec 2000 00:56:38 +1100


"Manuel M. T. Chakravarty" <chak@cse.unsw.edu.au> wrote,

[..]
> In
> particular - at least if a function is large enough - it
> doesn't inline the function anymore if the function is used
> more than once.

Moreover, I am wondering which the exact conditions are
under which NOINLINE pragmas are ignored by the compiler.
It seems at least always to be ignored in code like

  {-# NOINLINE foo #-}
  foo = <some code>

  bar .. = ..foo..

If that is the only occurence of `foo', inlining is
certainly always save, but on the other hand if I take the
trouble to add a NOINLINE pragma, I actually mean it.  For
example, I sometimes want to see what Core code is produced
for <some code> using -ddump-simpl.  The compiler can't know
that, so IMHO it should better just follow my instructions,
instead of trying to be extra smart.

Cheers,
Manuel