Worker/wrapper: Preserve float barriers (#21150)
Issue #21150 shows that worker/wrapper allocated a worker function for a function with multiple calls that said "called at most once" when the first argument was absent. That's bad! This patch makes it so that WW preserves at least one non-one-shot value lambda (see `Note [Preserving float barriers]`) by passing around `void#` in place of absent arguments. Fixes #21150. Since the fix is pretty similar to `Note [Protecting the last value argument]`, I put the logic in `mkWorkerArgs`. There I realised (#21204) that `-ffun-to-thunk` is basically useless with `-ffull-laziness`, so I deprecated the flag, simplified and split into `needsVoidWorkerArg`/`addVoidWorkerArg`. SpecConstr is another client of that API. Fixes #21204. Metric Decrease: T14683
Showing
- compiler/GHC/Core/Lint.hs 1 addition, 1 deletioncompiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Opt/SpecConstr.hs 16 additions, 11 deletionscompiler/GHC/Core/Opt/SpecConstr.hs
- compiler/GHC/Core/Opt/Specialise.hs 1 addition, 1 deletioncompiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Core/Opt/WorkWrap.hs 0 additions, 12 deletionscompiler/GHC/Core/Opt/WorkWrap.hs
- compiler/GHC/Core/Opt/WorkWrap/Utils.hs 112 additions, 60 deletionscompiler/GHC/Core/Opt/WorkWrap/Utils.hs
- compiler/GHC/Driver/Flags.hs 1 addition, 1 deletioncompiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Session.hs 2 additions, 1 deletioncompiler/GHC/Driver/Session.hs
- docs/users_guide/using-optimisation.rst 11 additions, 2 deletionsdocs/users_guide/using-optimisation.rst
- testsuite/tests/simplCore/should_compile/T19794.hs 5 additions, 1 deletiontestsuite/tests/simplCore/should_compile/T19794.hs
- testsuite/tests/stranal/should_compile/T21150.hs 37 additions, 0 deletionstestsuite/tests/stranal/should_compile/T21150.hs
- testsuite/tests/stranal/should_compile/T21150.stderr 237 additions, 0 deletionstestsuite/tests/stranal/should_compile/T21150.stderr
- testsuite/tests/stranal/should_compile/all.T 2 additions, 1 deletiontestsuite/tests/stranal/should_compile/all.T
Loading
Please register or sign in to comment