diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-03-24 13:13:43 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2020-12-14 13:37:09 -0500 |
commit | 7e9debd4ceb068effe8ac81892d2cabcb8f55850 (patch) | |
tree | f222f3f3e5d662a12ab00fcb1a81d8e8dfb6c0de /testsuite/tests/plugins | |
parent | c696bb2f4476e0ce4071e0d91687c1fe84405599 (diff) | |
download | haskell-7e9debd4ceb068effe8ac81892d2cabcb8f55850.tar.gz |
Optimise nullary type constructor usage
During the compilation of programs GHC very frequently deals with
the `Type` type, which is a synonym of `TYPE 'LiftedRep`. This patch
teaches GHC to avoid expanding the `Type` synonym (and other nullary
type synonyms) during type comparisons, saving a good amount of work.
This optimisation is described in `Note [Comparing nullary type
synonyms]`.
To maximize the impact of this optimisation, we introduce a few
special-cases to reduce `TYPE 'LiftedRep` to `Type`. See
`Note [Prefer Type over TYPE 'LiftedPtrRep]`.
Closes #17958.
Metric Decrease:
T18698b
T1969
T12227
T12545
T12707
T14683
T3064
T5631
T5642
T9020
T9630
T9872a
T13035
haddock.Cabal
haddock.base
Diffstat (limited to 'testsuite/tests/plugins')
-rw-r--r-- | testsuite/tests/plugins/plugins09.stdout | 1 | ||||
-rw-r--r-- | testsuite/tests/plugins/plugins10.stdout | 1 | ||||
-rw-r--r-- | testsuite/tests/plugins/plugins11.stdout | 1 | ||||
-rw-r--r-- | testsuite/tests/plugins/static-plugins.stdout | 4 |
4 files changed, 2 insertions, 5 deletions
diff --git a/testsuite/tests/plugins/plugins09.stdout b/testsuite/tests/plugins/plugins09.stdout index 0401941734..61f96283ff 100644 --- a/testsuite/tests/plugins/plugins09.stdout +++ b/testsuite/tests/plugins/plugins09.stdout @@ -3,6 +3,5 @@ interfacePlugin: Prelude interfacePlugin: GHC.Float interfacePlugin: GHC.Base typeCheckPlugin (rn) -interfacePlugin: GHC.Types typeCheckPlugin (tc) interfacePlugin: GHC.Num.BigNat diff --git a/testsuite/tests/plugins/plugins10.stdout b/testsuite/tests/plugins/plugins10.stdout index ed31df86f1..37f424b076 100644 --- a/testsuite/tests/plugins/plugins10.stdout +++ b/testsuite/tests/plugins/plugins10.stdout @@ -6,7 +6,6 @@ interfacePlugin: GHC.Float interfacePlugin: GHC.Base interfacePlugin: Language.Haskell.TH.Syntax typeCheckPlugin (rn) -interfacePlugin: GHC.Types typeCheckPlugin (tc) interfacePlugin: GHC.Num.BigNat parsePlugin(a) diff --git a/testsuite/tests/plugins/plugins11.stdout b/testsuite/tests/plugins/plugins11.stdout index b273bc7a10..6bab3559b1 100644 --- a/testsuite/tests/plugins/plugins11.stdout +++ b/testsuite/tests/plugins/plugins11.stdout @@ -3,6 +3,5 @@ interfacePlugin: Prelude interfacePlugin: GHC.Float interfacePlugin: GHC.Base typeCheckPlugin (rn) -interfacePlugin: GHC.Types typeCheckPlugin (tc) interfacePlugin: GHC.Num.BigNat diff --git a/testsuite/tests/plugins/static-plugins.stdout b/testsuite/tests/plugins/static-plugins.stdout index 632af0076c..032992824f 100644 --- a/testsuite/tests/plugins/static-plugins.stdout +++ b/testsuite/tests/plugins/static-plugins.stdout @@ -5,11 +5,11 @@ interfacePlugin: GHC.Float interfacePlugin: GHC.Base interfacePlugin: System.IO typeCheckPlugin (rn) -interfacePlugin: GHC.Prim -interfacePlugin: GHC.Show interfacePlugin: GHC.Types +interfacePlugin: GHC.Show interfacePlugin: GHC.TopHandler typeCheckPlugin (tc) +interfacePlugin: GHC.Prim interfacePlugin: GHC.CString interfacePlugin: GHC.Num.BigNat ==pure.1 |