Adjust inlining heursitics
authorsimonpj@microsoft.com <unknown>
Fri, 3 Apr 2009 08:46:34 +0000 (08:46 +0000)
committersimonpj@microsoft.com <unknown>
Fri, 3 Apr 2009 08:46:34 +0000 (08:46 +0000)
commitb71760aac3a1b2e7d772a4c0457ff3f19eac8631
tree7c6f1c8297f9be18cb68cf18ff36872868308e90
parent9060e51e4773bdff1829d17e3f7c42edb910d805
Adjust inlining heursitics

This patch is the result of a long series of nofib-based experiments
to improve GHC's inlining heuristics.

In the end, I'm not sure how worthwhile it all was: I only got a
   1% decrease in code size
   1% decrease in allocation
and I don't trust the runtime statistics enough to quote.

Still, in doing all this I tidied up the code quite a bit, and
I understand it much better now, so I'm going to commit it.

The main changes are in CoreUnfold, which has lots of new comments.
Other changes:

  - litSize moves from Literal to CoreUnfold
  - interestingArg moves from SimplUtils to CoreUnfold
  - the default unfolding threshold (in StaticFlags)
      reduces from 8 to 6 (since the size calculation
      has changed a bit)
compiler/basicTypes/Literal.lhs
compiler/coreSyn/CoreUnfold.lhs
compiler/main/StaticFlags.hs
compiler/simplCore/SimplUtils.lhs