Commits on Source (3)
-
Simon Peyton Jones authored
The Specialiser has, for some time, fires class-op RULES in the specialiser itself: see Note [Specialisation modulo dictionary selectors] This MR beefs it up a bit, so that it fires /all/ RULES in the specialiser, not just class-op rules. See Note [Fire rules in the specialiser] The result is a bit more specialisation; see test simplCore/should_compile/T21851_2 This pushed me into a bit of refactoring. I made a new data types GHC.Core.Rules.RuleEnv, which combines - the several source of rules (local, home-package, external) - the orphan-module dependencies in a single record for `getRules` to consult. That drove a bunch of follow-on refactoring, including allowing me to remove cr_visible_orphan_mods from the CoreReader data type. I moved some of the RuleBase/RuleEnv stuff into GHC.Core.Rule. The reorganisation in the Simplifier improve compile times a bit (geom mean -0.1%), but T9961 is an outlier Metric Decrease: T9961
f9f17b68 -
Simon Peyton Jones authored
The problem here is described at some length in Note [Boxity for bottoming functions] and Note [Reboxed crud for bottoming calls] in GHC.Core.Opt.DmdAnal. This patch adds a SPECIALISE pragma for indexError, which makes it much less vulnerable to the problem described in these Notes. (This came up in another line of work, where a small change made indexError do reboxing (in nofib/spectral/simple/table_sort) that didn't happen before my change. I've opened #22404 to document the fagility.
2b3d0bee -
Simon Peyton Jones authored
The error message for DsUselessSpecialiseForClassMethodSelector was just wrong (a typo in some earlier work); trivial fix
399e921b
Showing
- compiler/GHC/Core.hs 21 additions, 52 deletionscompiler/GHC/Core.hs
- compiler/GHC/Core/InstEnv.hs 3 additions, 1 deletioncompiler/GHC/Core/InstEnv.hs
- compiler/GHC/Core/Opt/DmdAnal.hs 3 additions, 0 deletionscompiler/GHC/Core/Opt/DmdAnal.hs
- compiler/GHC/Core/Opt/Monad.hs 13 additions, 13 deletionscompiler/GHC/Core/Opt/Monad.hs
- compiler/GHC/Core/Opt/Pipeline.hs 9 additions, 14 deletionscompiler/GHC/Core/Opt/Pipeline.hs
- compiler/GHC/Core/Opt/Simplify.hs 34 additions, 27 deletionscompiler/GHC/Core/Opt/Simplify.hs
- compiler/GHC/Core/Opt/Simplify/Monad.hs 1 addition, 1 deletioncompiler/GHC/Core/Opt/Simplify/Monad.hs
- compiler/GHC/Core/Opt/Simplify/Utils.hs 1 addition, 1 deletioncompiler/GHC/Core/Opt/Simplify/Utils.hs
- compiler/GHC/Core/Opt/Specialise.hs 151 additions, 80 deletionscompiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Core/Rules.hs 123 additions, 32 deletionscompiler/GHC/Core/Rules.hs
- compiler/GHC/Driver/Config/Core/Opt/Simplify.hs 10 additions, 11 deletionscompiler/GHC/Driver/Config/Core/Opt/Simplify.hs
- compiler/GHC/HsToCore/Errors/Ppr.hs 1 addition, 1 deletioncompiler/GHC/HsToCore/Errors/Ppr.hs
- compiler/GHC/Unit/External.hs 1 addition, 2 deletionscompiler/GHC/Unit/External.hs
- libraries/base/GHC/Ix.hs 21 additions, 3 deletionslibraries/base/GHC/Ix.hs
- libraries/base/GHC/Real.hs 4 additions, 1 deletionlibraries/base/GHC/Real.hs
- testsuite/tests/simplCore/should_compile/T21851.stderr 0 additions, 2 deletionstestsuite/tests/simplCore/should_compile/T21851.stderr
- testsuite/tests/simplCore/should_compile/T21851_2.hs 15 additions, 0 deletionstestsuite/tests/simplCore/should_compile/T21851_2.hs
- testsuite/tests/simplCore/should_compile/T21851_2.stderr 120 additions, 0 deletionstestsuite/tests/simplCore/should_compile/T21851_2.stderr
- testsuite/tests/simplCore/should_compile/T21851_2a.hs 11 additions, 0 deletionstestsuite/tests/simplCore/should_compile/T21851_2a.hs
- testsuite/tests/simplCore/should_compile/all.T 4 additions, 0 deletionstestsuite/tests/simplCore/should_compile/all.T