Make kick-out more selective
This MR revised the crucial kick-out criteria in the constraint solver. Ticket #24984 showed an example in which * We were kicking out unnecessarily * That gave rise to extra work, of course * But it /also/ led to exponentially-sized coercions due to lack of sharing in coercions (something we want to fix separately #20264) This MR sharpens up the kick-out criteria; specifially in (KK2) we look only under type family applications if (fs>=fw). This forced me to understand the existing kick-out story, and I ended up rewriting many of the careful Notes in GHC.Tc.Solver.InertSet. Especially look at the new `Note [The KickOut Criteria]` The proof of termination is not air-tight, but it is better than before, and both Richard and I think it's correct :-).
Showing
- compiler/GHC/Core/Predicate.hs 5 additions, 11 deletionscompiler/GHC/Core/Predicate.hs
- compiler/GHC/Core/Type.hs 1 addition, 1 deletioncompiler/GHC/Core/Type.hs
- compiler/GHC/Tc/Errors.hs 11 additions, 7 deletionscompiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Solver/InertSet.hs 365 additions, 308 deletionscompiler/GHC/Tc/Solver/InertSet.hs
- compiler/GHC/Tc/Types/Constraint.hs 7 additions, 6 deletionscompiler/GHC/Tc/Types/Constraint.hs
- compiler/GHC/Tc/Utils/TcType.hs 60 additions, 45 deletionscompiler/GHC/Tc/Utils/TcType.hs
- compiler/GHC/Utils/Misc.hs 7 additions, 1 deletioncompiler/GHC/Utils/Misc.hs
- testsuite/tests/indexed-types/should_compile/T3208b.stderr 2 additions, 4 deletionstestsuite/tests/indexed-types/should_compile/T3208b.stderr
- testsuite/tests/indexed-types/should_fail/ExtraTcsUntch.stderr 6 additions, 14 deletions...uite/tests/indexed-types/should_fail/ExtraTcsUntch.stderr
- testsuite/tests/indexed-types/should_fail/T8227.stderr 2 additions, 2 deletionstestsuite/tests/indexed-types/should_fail/T8227.stderr
- testsuite/tests/perf/compiler/T24984.hs 64 additions, 0 deletionstestsuite/tests/perf/compiler/T24984.hs
- testsuite/tests/perf/compiler/all.T 6 additions, 0 deletionstestsuite/tests/perf/compiler/all.T
- testsuite/tests/typecheck/should_compile/T23156.stderr 2 additions, 2 deletionstestsuite/tests/typecheck/should_compile/T23156.stderr
Loading
Please register or sign in to comment