Add Eq and Ord instance to `IfaceType`
We add an `Ord` instance so that we can store `IfaceType` in a `Data.Map` container. This is required to deduplicate `IfaceType` while writing `.hi` files to disk. Deduplication has many beneficial consequences to both file size and memory usage, as the deduplication enables implicit sharing of values. See issue #24540 for more motivation. The `Ord` instance would be unnecessary if we used a `TrieMap` instead of `Data.Map` for the deduplication process. While in theory this is clerarly the better option, experiments on the agda code base showed that a `TrieMap` implementation has worse run-time performance characteristics. To the change itself, we mostly derive `Eq` and `Ord`. This requires us to change occurrences of `FastString` with `LexicalFastString`, since `FastString` has no `Ord` instance. We change the definition of `IfLclName` to a newtype of `LexicalFastString`, to make such changes in the future easier. Bump haddock submodule for IfLclName changes
Showing
- compiler/GHC/Core/TyCo/Rep.hs 2 additions, 2 deletionscompiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/CoreToIface.hs 13 additions, 13 deletionscompiler/GHC/CoreToIface.hs
- compiler/GHC/Data/FastString.hs 4 additions, 1 deletioncompiler/GHC/Data/FastString.hs
- compiler/GHC/Iface/Decl.hs 3 additions, 4 deletionscompiler/GHC/Iface/Decl.hs
- compiler/GHC/Iface/Env.hs 7 additions, 8 deletionscompiler/GHC/Iface/Env.hs
- compiler/GHC/Iface/Ext/Utils.hs 3 additions, 3 deletionscompiler/GHC/Iface/Ext/Utils.hs
- compiler/GHC/Iface/Recomp.hs 2 additions, 2 deletionscompiler/GHC/Iface/Recomp.hs
- compiler/GHC/Iface/Syntax.hs 2 additions, 1 deletioncompiler/GHC/Iface/Syntax.hs
- compiler/GHC/Iface/Type.hs 44 additions, 14 deletionscompiler/GHC/Iface/Type.hs
- compiler/GHC/IfaceToCore.hs 14 additions, 14 deletionscompiler/GHC/IfaceToCore.hs
- compiler/GHC/Types/Basic.hs 1 addition, 1 deletioncompiler/GHC/Types/Basic.hs
- compiler/GHC/Types/Var.hs 1 addition, 1 deletioncompiler/GHC/Types/Var.hs
- compiler/Language/Haskell/Syntax/Type.hs 2 additions, 1 deletioncompiler/Language/Haskell/Syntax/Type.hs
- compiler/Language/Haskell/Syntax/Type.hs-boot 2 additions, 0 deletionscompiler/Language/Haskell/Syntax/Type.hs-boot
- utils/haddock 1 addition, 1 deletionutils/haddock
Loading
Please register or sign in to comment