Do not float HNFs out of lambdas
This MR adjusts SetLevels so that it is less eager to float a HNF (lambda or constructor application) out of a lambda, unless it gets to top level. Data suggests that this change is a small net win: * nofib bytes-allocated falls by -0.09% (but a couple go up) * perf/should_compile bytes-allocated falls by -0.5% * perf/should_run bytes-allocated falls by -0.1% See !12410 for more detail. When fiddling elsewhere, I also found that this patch had a huge positive effect on the (very delicate) test perf/should_run/T21839r But that improvement doesn't show up in this MR by itself. Metric Decrease: MultiLayerModulesRecomp T15703 parsing001
Showing
- compiler/GHC/Core/Opt/SetLevels.hs 104 additions, 58 deletionscompiler/GHC/Core/Opt/SetLevels.hs
- testsuite/tests/simplCore/should_compile/T18013.stderr 5 additions, 9 deletionstestsuite/tests/simplCore/should_compile/T18013.stderr
- testsuite/tests/simplCore/should_run/simplrun009.hs 1 addition, 1 deletiontestsuite/tests/simplCore/should_run/simplrun009.hs
Loading
Please register or sign in to comment