Skip to content
Snippets Groups Projects
Commit 083a7583 authored by Ben Gamari's avatar Ben Gamari Committed by Marge Bot
Browse files

Increase type sharing

Fixes #20541 by making mkTyConApp do more sharing of types.
In particular, replace

* BoxedRep Lifted    ==>  LiftedRep
* BoxedRep Unlifted  ==>  UnliftedRep
* TupleRep '[]       ==>  ZeroBitRep
* TYPE ZeroBitRep    ==>  ZeroBitType

In each case, the thing on the right is a type synonym
for the thing on the left, declared in ghc-prim:GHC.Types.
See Note [Using synonyms to compress types] in GHC.Core.Type.

The synonyms for ZeroBitRep and ZeroBitType are new, but absolutely
in the same spirit as the other ones.   (These synonyms are mainly
for internal use, though the programmer can use them too.)

I also renamed GHC.Core.Ty.Rep.isVoidTy to isZeroBitTy, to be
compatible with the "zero-bit" nomenclature above.  See discussion
on !6806.

There is a tricky wrinkle: see GHC.Core.Types
  Note [Care using synonyms to compress types]

Compiler allocation decreases by up to 0.8%.
parent 3e94b5a7
No related branches found
No related tags found
Loading
Showing
with 442 additions and 254 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment