diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2021-02-08 16:03:46 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-03-26 19:00:07 -0400 |
commit | 532c6a541570e79891b3b68749cae9fcec42a939 (patch) | |
tree | ed0acea865c3e1bb72ee4f4d7e651f7d62184e4f /compiler/GHC/Driver | |
parent | 599efd90d54a01802b1285c0e357738e4d0bdb3a (diff) | |
download | haskell-532c6a541570e79891b3b68749cae9fcec42a939.tar.gz |
Remove UniqSupply from NameCache
As suggested by @alexbiehl, this patch replaces the always updated
UniqSupply in NameCache with a fixed Char and use it with `uniqFromMask`
to generate uniques.
This required some refactoring because getting a new unique from the
NameCache can't be done in pure code anymore, in particular not in an
atomic update function for `atomicModifyIORef`. So we use an MVar
instead to store the OrigNameCache field.
For some reason, T12545 increases (+1%) on i386 while it decreases on
other CI runners.
T9630 ghc/peak increases only with the dwarf build on CI (+16%).
Metric Decrease:
T12425
T12545
T9198
T12234
Metric Increase:
T12545
T9630
Update haddock submodule
Diffstat (limited to 'compiler/GHC/Driver')
-rw-r--r-- | compiler/GHC/Driver/Main.hs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/GHC/Driver/Main.hs b/compiler/GHC/Driver/Main.hs index e77ce02c65..92d8034127 100644 --- a/compiler/GHC/Driver/Main.hs +++ b/compiler/GHC/Driver/Main.hs @@ -190,7 +190,6 @@ import GHC.Types.Error import GHC.Types.Fixity.Env import GHC.Types.CostCentre import GHC.Types.IPE -import GHC.Types.Unique.Supply import GHC.Types.SourceFile import GHC.Types.SrcLoc import GHC.Types.Name @@ -244,8 +243,7 @@ newHscEnv dflags = do -- we don't store the unit databases and the unit state to still -- allow `setSessionDynFlags` to be used to set unit db flags. eps_var <- newIORef initExternalPackageState - us <- mkSplitUniqSupply 'r' - nc_var <- initNameCache us knownKeyNames + nc_var <- initNameCache 'r' knownKeyNames fc_var <- initFinderCache logger <- initLogger tmpfs <- initTmpFs |