CorePrep: Eta expand arguments (#23083)
Previously, we'd only eta expand let bindings and lambdas, now we'll also eta expand arguments such as in T23083: ```hs g f h = f (h `seq` (h $)) ``` Unless `-fpedantic-bottoms` is set, we'll now transform to ```hs g f h = f (\eta -> h eta) ``` in CorePrep. See the new `Note [Eta expansion of arguments in CorePrep]` for the details. We only do this optimisation with -O2 because we saw 2-3% ghc/alloc regressions in T4801 and T5321FD. Fixes #23083.
parent
105494e0
Branches wip/ttg-booleanformula
No related tags found
Checking pipeline status
Showing
- compiler/GHC/CoreToStg/Prep.hs 55 additions, 1 deletioncompiler/GHC/CoreToStg/Prep.hs
- compiler/GHC/Driver/Config/CoreToStg/Prep.hs 7 additions, 2 deletionscompiler/GHC/Driver/Config/CoreToStg/Prep.hs
- compiler/GHC/Driver/Flags.hs 1 addition, 0 deletionscompiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Session.hs 2 additions, 0 deletionscompiler/GHC/Driver/Session.hs
- docs/users_guide/using-optimisation.rst 10 additions, 0 deletionsdocs/users_guide/using-optimisation.rst
- testsuite/tests/simplCore/should_compile/T23083.hs 6 additions, 0 deletionstestsuite/tests/simplCore/should_compile/T23083.hs
- testsuite/tests/simplCore/should_compile/T23083.stderr 42 additions, 0 deletionstestsuite/tests/simplCore/should_compile/T23083.stderr
- testsuite/tests/simplCore/should_compile/all.T 1 addition, 0 deletionstestsuite/tests/simplCore/should_compile/all.T
Loading
Please register or sign in to comment