Re-do the "function application discount" (fixes Trac #6048)
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 9 May 2012 15:22:49 +0000 (16:22 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 9 May 2012 15:22:49 +0000 (16:22 +0100)
commit980372f357667c1ba63b28acbf5798826890b7a5
treef0db814eaaaeeda58cacb4f86b815b458cc351ab
parent2112f43c466935818a371c53c706608cfa069d01
Re-do the "function application discount" (fixes Trac #6048)

* Undoes Max's very aggressive function-inlining change
  (see comments with Trac #6048)

* Resticts function application discount to functions
  that occur just once in the body. It was the multiple
  occurrences that led to the exponential behavour in
  Trac #6048.

See Note [Function application discount] in CoreUnfold.

Module binary sizes are down 2% on average, which is good.
Allocations wobble about a bit, but only on a few benchmarks
and not by much, so it seems a price worth paying to avoid
exponential behaviour!

                         Allocs
            Min           -1.2%
            Max           +2.8%
 Geometric Mean           +0.0%
compiler/coreSyn/CoreUnfold.lhs