Run float-inwards immediately before the strictness analyser.
authorSimon Peyton Jones <simonpj@microsoft.com>
Fri, 23 May 2014 12:42:05 +0000 (13:42 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Thu, 28 Aug 2014 10:14:15 +0000 (11:14 +0100)
commit1122857e6967795a4595a837f3b080cf5f0e18c2
treebd62ef2034d36ec5cf992e1398c8cfbac0f95a47
parent86a2ebf8deae9505c7a183acf0847b3e53b43fee
Run float-inwards immediately before the strictness analyser.

Doing so pushes bindings nearer their use site and hence makes
them more likely to be strict. These bindings might only show
up after the inlining from simplification.  Example in fulsom,
Csg.calc, where an arg of timesDouble thereby becomes strict.

Very few programs are affected, but it's basically good news.

        Program           Size    Allocs   Runtime   Elapsed  TotalMem
--------------------------------------------------------------------------------
            fft          -0.2%     +1.3%      0.06      0.06    -10.0%
         fulsom          -0.0%     -2.6%     -4.3%     -4.7%     -6.7%
         simple          +0.0%     -0.8%      0.0%      0.0%      0.0%
--------------------------------------------------------------------------------
            Min          -0.5%     -2.6%     -4.5%     -4.7%    -10.0%
            Max          +0.1%     +1.3%     +3.3%     +3.4%     +2.6%
 Geometric Mean          -0.0%     -0.0%     -0.6%     -0.6%     -0.2%

The lossage in fft is the loss of detecting a common sub-expression,
and can be fixed by doing earlier CSE.  But that is in any case a bit
of a fluke so I don't mind losing it in exchange for this more reliable
gain.
compiler/simplCore/SimplCore.lhs