This patch addresses the exponential blow-up in the simplifier.
Specifically: #13253 exponential inlining #10421 ditto #18140 strict constructors #18282 another nested-function call case This patch makes two significant changes: 1. For Ids that are used at most once in each branch of a case, make the occurrence analyser record the total number of syntactic occurrences. Then in postInlineUnconditionally use that info to avoid inling something many many times. Actual changes: * See the occ_n_br field of OneOcc. * postInlineUnconditionally See Note [Suppress exponential blowup] in GHC.Core.Opt.Simplify.Utils 2. Change the way that mkDupableCont handles StrictArg. The details are explained in GHC.Core.Opt.Simplify Note [Duplicating StrictArg] Current nofib run Program Size Allocs Runtime Elapsed TotalMem -------------------------------------------------------------------------------- VS -0.3% +115.9% +12.1% +11.2% 0.0% boyer2 -0.3% +10.0% +3.5% +4.0% 0.0% cryptarithm2 -0.3% +39.0% +16.6% +16.1% 0.0% gamteb -0.3% +4.1% -0.0% +0.4% 0.0% last-piece -0.3% +1.4% -1.1% -0.4% 0.0% mate -0.4% -11.1% -8.5% -9.0% 0.0% multiplier -0.3% -2.2% -1.5% -1.5% 0.0% transform -0.3% +3.4% +0.5% +0.8% 0.0% -------------------------------------------------------------------------------- Min -0.8% -11.1% -8.5% -9.0% 0.0% Max -0.3% +115.9% +30.1% +26.4% 0.0% Geometric Mean -0.3% +1.0% +1.0% +1.0% -0.0% Should investigate these numbers. But the tickets are indeed cured, I think.
parent
b9f0d583
Pipeline #22139 failed
Stage: lint
Stage: quick-build
Stage: build
Stage: full-build
Stage: cleanup
Stage: packaging
Stage: testing
Showing
- compiler/GHC/Core/Opt/OccurAnal.hs 11 additions, 7 deletionscompiler/GHC/Core/Opt/OccurAnal.hs
- compiler/GHC/Core/Opt/SetLevels.hs 10 additions, 2 deletionscompiler/GHC/Core/Opt/SetLevels.hs
- compiler/GHC/Core/Opt/Simplify.hs 110 additions, 83 deletionscompiler/GHC/Core/Opt/Simplify.hs
- compiler/GHC/Core/Opt/Simplify/Utils.hs 40 additions, 7 deletionscompiler/GHC/Core/Opt/Simplify/Utils.hs
- compiler/GHC/Core/SimpleOpt.hs 1 addition, 1 deletioncompiler/GHC/Core/SimpleOpt.hs
- compiler/GHC/Types/Basic.hs 10 additions, 15 deletionscompiler/GHC/Types/Basic.hs
- compiler/GHC/Types/Id/Info.hs 1 addition, 1 deletioncompiler/GHC/Types/Id/Info.hs
- testsuite/tests/perf/compiler/T10421.hs 51 additions, 0 deletionstestsuite/tests/perf/compiler/T10421.hs
- testsuite/tests/perf/compiler/T10421_Form.hs 19 additions, 0 deletionstestsuite/tests/perf/compiler/T10421_Form.hs
- testsuite/tests/perf/compiler/T10421_Y.hs 17 additions, 0 deletionstestsuite/tests/perf/compiler/T10421_Y.hs
- testsuite/tests/perf/compiler/T13253-spj.hs 20 additions, 0 deletionstestsuite/tests/perf/compiler/T13253-spj.hs
- testsuite/tests/perf/compiler/T13253.hs 122 additions, 0 deletionstestsuite/tests/perf/compiler/T13253.hs
- testsuite/tests/perf/compiler/T18140.hs 57 additions, 0 deletionstestsuite/tests/perf/compiler/T18140.hs
- testsuite/tests/perf/compiler/all.T 21 additions, 0 deletionstestsuite/tests/perf/compiler/all.T
Loading
Please register or sign in to comment