Fix binder-swap bug
This patch fixes #21229 / #21470 properly, by avoiding doing a binder-swap on dictionary Ids. This is pretty subtle, and explained in Note [Care with binder-swap on dictionaries]. This allows us to restore a feature to the specialiser that we had to revert: see Note [Specialising polymorphic dictionaries]. I als modularised things, using a new function scrutBinderSwap_maybe in all the places where we are (effectively) doing a binder-swap, notably * Simplify.Iteration.addAltUnfoldings * SpecConstr.extendCaseBndrs In Simplify.Iteration.addAltUnfoldings I also eliminated a guard Many <- idMult case_bndr because we concluded, in #22123, that it was doing no good.
parent
d5c07d40
No related branches found
No related tags found
Pipeline #57173 failed
Stage: tool-lint
Stage: quick-build
Stage: full-build
Stage: packaging
Stage: testing
Showing
- compiler/GHC/Core/Opt/OccurAnal.hs 137 additions, 76 deletionscompiler/GHC/Core/Opt/OccurAnal.hs
- compiler/GHC/Core/Opt/SetLevels.hs 3 additions, 12 deletionscompiler/GHC/Core/Opt/SetLevels.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs 15 additions, 13 deletionscompiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/Opt/SpecConstr.hs 7 additions, 2 deletionscompiler/GHC/Core/Opt/SpecConstr.hs
- compiler/GHC/Core/Opt/Specialise.hs 12 additions, 14 deletionscompiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Core/Subst.hs 0 additions, 1 deletioncompiler/GHC/Core/Subst.hs
- testsuite/tests/linters/notes.stdout 0 additions, 1 deletiontestsuite/tests/linters/notes.stdout
- testsuite/tests/simplCore/should_compile/all.T 0 additions, 1 deletiontestsuite/tests/simplCore/should_compile/all.T
Loading
Please register or sign in to comment