Simon Peyton Jones pushed to branch wip/T23559 at Glasgow Haskell Compiler / GHC
Commits:
-
89a3718e
by Simon Peyton Jones at 2025-11-26T14:59:23+00:00
-
85b1977f
by Simon Peyton Jones at 2025-11-26T14:59:32+00:00
4 changed files:
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Flags.hs
- docs/users_guide/using-optimisation.rst
- utils/check-exact/ExactPrint.hs
Changes:
| ... | ... | @@ -1268,6 +1268,7 @@ optLevelFlags -- see Note [Documenting optimisation flags] |
| 1268 | 1268 | , ([1,2], Opt_CfgBlocklayout) -- Experimental
|
| 1269 | 1269 | |
| 1270 | 1270 | , ([1,2], Opt_Specialise)
|
| 1271 | + , ([1,2], Opt_PolymorphicSpecialisation) -- Now on by default (#23559)
|
|
| 1271 | 1272 | , ([1,2], Opt_CrossModuleSpecialise)
|
| 1272 | 1273 | , ([1,2], Opt_InlineGenerics)
|
| 1273 | 1274 | , ([1,2], Opt_Strictness)
|
| ... | ... | @@ -909,6 +909,7 @@ optimisationFlags = EnumSet.fromList |
| 909 | 909 | , Opt_SpecialiseAggressively
|
| 910 | 910 | , Opt_CrossModuleSpecialise
|
| 911 | 911 | , Opt_StaticArgumentTransformation
|
| 912 | + , Opt_PolymorphicSpecialisation
|
|
| 912 | 913 | , Opt_CSE
|
| 913 | 914 | , Opt_StgCSE
|
| 914 | 915 | , Opt_StgLiftLams
|
| ... | ... | @@ -1325,10 +1325,7 @@ as such you shouldn't need to set any of them explicitly. A flag |
| 1325 | 1325 | :reverse: -fno-polymorphic-specialisation
|
| 1326 | 1326 | :category:
|
| 1327 | 1327 | |
| 1328 | - :default: off
|
|
| 1329 | - |
|
| 1330 | - Warning, this feature is highly experimental and may lead to incorrect runtime
|
|
| 1331 | - results. Use at your own risk (:ghc-ticket:`23469`, :ghc-ticket:`23109`, :ghc-ticket:`21229`, :ghc-ticket:`23445`).
|
|
| 1328 | + :default: on
|
|
| 1332 | 1329 | |
| 1333 | 1330 | Enable specialisation of function calls to known dictionaries with free type variables.
|
| 1334 | 1331 | The created specialisation will abstract over the type variables free in the dictionary.
|
| ... | ... | @@ -19,6 +19,13 @@ |
| 19 | 19 | {-# LANGUAGE UndecidableInstances #-} -- For the (StmtLR GhcPs GhcPs (LocatedA (body GhcPs))) ExactPrint instance
|
| 20 | 20 | {-# OPTIONS_GHC -Wno-incomplete-uni-patterns -Wno-incomplete-record-updates #-}
|
| 21 | 21 | |
| 22 | +-- We switch off specialisation in this module. Otherwise we get lots of functions
|
|
| 23 | +-- specialised on lots of (GHC syntax tree) data types. Compilation time allocation
|
|
| 24 | +-- (at least with -fpolymorphic-specialisation; see !15058) blows up from 17G to 108G.
|
|
| 25 | +-- Bad! ExactPrint is not a performance-critical module so it's not worth taking the
|
|
| 26 | +-- largely-fruitless hit in compile time.
|
|
| 27 | +{-# OPTIONS_GHC -fno-specialise #-}
|
|
| 28 | + |
|
| 22 | 29 | module ExactPrint
|
| 23 | 30 | (
|
| 24 | 31 | ExactPrint(..)
|