Three compile perf improvements with deep nesting
These were changes are all triggered by #24471. 1. Make GHC.Core.Opt.SetLevels.lvlMFE behave better when there are many free variables. See Note [Large free-variable sets]. 2. Make GHC.Core.Opt.Arity.floatIn a bit lazier in its Cost argument. This benefits the common case where the ArityType turns out to be nullary. See Note [Care with nested expressions] 3. Make GHC.CoreToStg.Prep.cpeArg behave for deeply-nested expressions. See Note [Eta expansion of arguments in CorePrep] wrinkle (EA2). Compile times go down by up to 4.5%, and much more in artificial cases. (Geo mean of compiler/perf changes is -0.4%.) Metric Decrease: CoOpt_Read T10421 T12425
Showing
- compiler/GHC/Core/Opt/Arity.hs 28 additions, 3 deletionscompiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/SetLevels.hs 27 additions, 3 deletionscompiler/GHC/Core/Opt/SetLevels.hs
- compiler/GHC/CoreToStg/Prep.hs 65 additions, 68 deletionscompiler/GHC/CoreToStg/Prep.hs
- testsuite/tests/perf/compiler/T24471.hs 8 additions, 0 deletionstestsuite/tests/perf/compiler/T24471.hs
- testsuite/tests/perf/compiler/T24471a.hs 8 additions, 0 deletionstestsuite/tests/perf/compiler/T24471a.hs
- testsuite/tests/perf/compiler/all.T 4 additions, 0 deletionstestsuite/tests/perf/compiler/all.T
Loading
Please register or sign in to comment