Drop dead Given bindings in setImplicationStatus
Trac #13032 pointed out that we sometimes generate unused bindings for Givens, and (worse still) we can't always discard them later (we don't drop a case binding unless we can prove that the scrutinee is non-bottom. It looks as if this may be a major reason for the performace problems in #14338 (see comment:29). This patch fixes the problem at source, by pruning away all the dead Givens. See Note [Delete dead Given evidence bindings] Remarkably, compiler allocation falls by 23% in perf/compiler/T12227! I have not confirmed whether this change actualy helps with (cherry picked from commit 954cbc7c)
Showing
- compiler/basicTypes/VarEnv.hs 4 additions, 1 deletioncompiler/basicTypes/VarEnv.hs
- compiler/typecheck/TcEvidence.hs 6 additions, 1 deletioncompiler/typecheck/TcEvidence.hs
- compiler/typecheck/TcInstDcls.hs 13 additions, 20 deletionscompiler/typecheck/TcInstDcls.hs
- compiler/typecheck/TcRnMonad.hs 5 additions, 1 deletioncompiler/typecheck/TcRnMonad.hs
- compiler/typecheck/TcRnTypes.hs 34 additions, 12 deletionscompiler/typecheck/TcRnTypes.hs
- compiler/typecheck/TcSMonad.hs 17 additions, 19 deletionscompiler/typecheck/TcSMonad.hs
- compiler/typecheck/TcSimplify.hs 148 additions, 99 deletionscompiler/typecheck/TcSimplify.hs
- compiler/typecheck/TcUnify.hs 7 additions, 10 deletionscompiler/typecheck/TcUnify.hs
- testsuite/tests/indexed-types/should_compile/T7837.stderr 0 additions, 1 deletiontestsuite/tests/indexed-types/should_compile/T7837.stderr
- testsuite/tests/perf/compiler/all.T 2 additions, 1 deletiontestsuite/tests/perf/compiler/all.T
- testsuite/tests/simplCore/should_compile/T4398.stderr 1 addition, 17 deletionstestsuite/tests/simplCore/should_compile/T4398.stderr
- testsuite/tests/typecheck/should_compile/T13032.hs 12 additions, 0 deletionstestsuite/tests/typecheck/should_compile/T13032.hs
- testsuite/tests/typecheck/should_compile/T13032.stderr 20 additions, 0 deletionstestsuite/tests/typecheck/should_compile/T13032.stderr
- testsuite/tests/typecheck/should_compile/all.T 1 addition, 0 deletionstestsuite/tests/typecheck/should_compile/all.T
Loading
Please register or sign in to comment