More improvements to worker/wrapper
This patch fixes #21888, and simplifies finaliseArgBoxities by eliminating the (recently introduced) data type FinalDecision. A delicate interaction meant that this patch commit d1c25a48 Date: Tue Jul 12 16:33:46 2022 +0100 Refactor wantToUnboxArg a bit make worker/wrapper go into an infinite loop. This patch fixes it by narrowing the handling of case (B) of Note [Boxity for bottoming functions], to deal only the arguemnts that are type variables. Only then do we drop the trimBoxity call, which is what caused the bug. I also * Added documentation of case (B), which was previously completely un-mentioned. And a regression test, T21888a, to test it. * Made unboxDeeplyDmd stop at lazy demands. It's rare anyway for a bottoming function to have a lazy argument (mainly when the data type is recursive and then we don't want to unbox deeply). Plus there is Note [No lazy, Unboxed demands in demand signature] * Refactored the Case equation for dmdAnal a bit, to do less redundant pattern matching.
Showing
- compiler/GHC/Core/Opt/DmdAnal.hs 133 additions, 116 deletionscompiler/GHC/Core/Opt/DmdAnal.hs
- compiler/GHC/Core/Opt/WorkWrap/Utils.hs 28 additions, 26 deletionscompiler/GHC/Core/Opt/WorkWrap/Utils.hs
- compiler/GHC/Types/Demand.hs 5 additions, 3 deletionscompiler/GHC/Types/Demand.hs
- testsuite/tests/simplCore/should_compile/T20103.stderr 1 addition, 1 deletiontestsuite/tests/simplCore/should_compile/T20103.stderr
- testsuite/tests/stranal/sigs/BottomFromInnerLambda.stderr 2 additions, 2 deletionstestsuite/tests/stranal/sigs/BottomFromInnerLambda.stderr
- testsuite/tests/stranal/sigs/T21119.stderr 2 additions, 2 deletionstestsuite/tests/stranal/sigs/T21119.stderr
- testsuite/tests/stranal/sigs/T21888.hs 63 additions, 0 deletionstestsuite/tests/stranal/sigs/T21888.hs
- testsuite/tests/stranal/sigs/T21888.stderr 30 additions, 0 deletionstestsuite/tests/stranal/sigs/T21888.stderr
- testsuite/tests/stranal/sigs/T21888a.hs 19 additions, 0 deletionstestsuite/tests/stranal/sigs/T21888a.hs
- testsuite/tests/stranal/sigs/T21888a.stderr 21 additions, 0 deletionstestsuite/tests/stranal/sigs/T21888a.stderr
- testsuite/tests/stranal/sigs/UnsatFun.stderr 4 additions, 4 deletionstestsuite/tests/stranal/sigs/UnsatFun.stderr
- testsuite/tests/stranal/sigs/all.T 2 additions, 0 deletionstestsuite/tests/stranal/sigs/all.T
Loading
Please register or sign in to comment