Message dug out from 27/10/97, which nobody replied to...  (Sorry
Sergey!)

[EMAIL PROTECTED] (S.D.Mechveliani) writes:

> When  ghc-2.08-linux-i386..., (binaries by S.Panne)
> 
> compiles the below module with  -O,  it in-lines both  g  and  f,
> as this can be seen from  M.hi
> But  f  is rather large to be in-lined, is not it?
> 
> I tried to surpress it with  {-# notINLINE f #-}.
> But ghc ignores it.

To suppress or encourage inlinings, the following flags may be useful:

-funfolding-use-threshold<n>

        A metric governing the maximum size an expression can be
        for it to be inlined.  GHC < 3.02 set this to 3, we're
        now setting it to 8.

-funfolding-con-discount<n>

        A discount given to the cost of an inlining if the compiler
        knows it can eliminate a 'case' expression by performing
        the inlining.  GHC < 3.02 set this to 1, we're now setting it
        to 3.

-funfolding-keenness-factor<n>
        
        All the discounts are multiplied by this factor.  Default: 2.

-funfolding-creation-threshold<n>
        
        A metric governing how big an expression can be for it to
        be even *considered* for future inlinings.  Default: 30.

-funfolding-interface-threshold<n>

        The maximum size of a function definition for its unfolding
        to appear in the interface file. (I think this is what
        Sergey was after above).  Default: 30.


GHC 3.02 will accept all of these flags, to use them with a previous
version just prefix the flag with '-optC'.  GHC 3.02 should also also
have a 'NOINLINE' pragma if I get it working in time.

Cheers,
        Simon

-- 
Simon Marlow                                             [EMAIL PROTECTED]
University of Glasgow                       http://www.dcs.gla.ac.uk/~simonm/
finger for PGP public key

Reply via email to