Move typeSize/coercionSize into TyCoRep
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 21 Dec 2016 11:24:25 +0000 (11:24 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 21 Dec 2016 12:26:24 +0000 (12:26 +0000)
commitc66dd05c8d02e2b7df825ed2f13b79fb3a16ab58
treee57ac7e92fe14e93b2d7101e836f81676985a0cd
parentc73a982bc49a234a030cea2496b70829c98b1e10
Move typeSize/coercionSize into TyCoRep

While investigating something else I found that 'typeSize' was
allocating like crazy.  Stupid becuase it should allocate precisely
nothing!!

Turned out that it was because typeSize and coercionSize were mutually
recursive across module boundaries, and so could not benefit from the
CPR property.  To fix this I moved them both into TyCoRep.

It's not critical (because typeSize is really only used in
debug mode, but I tripped over and example (T5642) in which
typeSize was one of the biggest single allocators in all of GHC.
And it's easy to fix, so I did.
compiler/types/Coercion.hs
compiler/types/Coercion.hs-boot
compiler/types/TyCoRep.hs
compiler/types/Type.hs